File tree Expand file tree Collapse file tree 2 files changed +38
-1
lines changed
Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ export default {
3333 outline : Boolean ,
3434 active : Boolean ,
3535 disabled : Boolean ,
36+ tooltip : String ,
3637 ...Mixins . colorProps ,
3738 ...Mixins . linkIconProps ,
3839 ...Mixins . linkRouterProps ,
@@ -83,6 +84,7 @@ export default {
8384 }
8485 return (
8586 < a
87+ ref = "el"
8688 id = { id }
8789 style = { style }
8890 className = { self . classes }
@@ -177,4 +179,23 @@ export default {
177179 this . dispatchEvent ( 'click' , event ) ;
178180 } ,
179181 } ,
182+ componentDidMount ( ) {
183+ const self = this ;
184+ const { tooltip } = self . props ;
185+ if ( ! tooltip ) return ;
186+ self . $f7ready ( ( f7 ) => {
187+ self . f7Tooltip = f7 . tooltip . create ( {
188+ el : self . refs . el ,
189+ text : tooltip ,
190+ } ) ;
191+ } ) ;
192+ } ,
193+ componentWillUnmount ( ) {
194+ const self = this ;
195+ if ( self . f7Tooltip && self . f7Tooltip . destroy ) {
196+ self . f7Tooltip . destroy ( ) ;
197+ self . f7Tooltip = null ;
198+ delete self . f7Tooltip ;
199+ }
200+ } ,
180201} ;
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ export default {
2424 type : [ String , Boolean ] ,
2525 default : '#' ,
2626 } ,
27+ tooltip : String ,
2728 ...Mixins . colorProps ,
2829 ...Mixins . linkIconProps ,
2930 ...Mixins . linkRouterProps ,
@@ -122,7 +123,7 @@ export default {
122123 componentDidMount ( ) {
123124 const self = this ;
124125 const el = self . refs . el ;
125- const { tabbarLabel, tabLink } = self . props ;
126+ const { tabbarLabel, tabLink, tooltip } = self . props ;
126127 let isTabbarLabel = false ;
127128 if ( tabbarLabel ||
128129 (
@@ -133,6 +134,21 @@ export default {
133134 isTabbarLabel = true ;
134135 }
135136 self . setState ( { isTabbarLabel } ) ;
137+ if ( ! tooltip ) return ;
138+ self . $f7ready ( ( f7 ) => {
139+ self . f7Tooltip = f7 . tooltip . create ( {
140+ el : self . refs . el ,
141+ text : tooltip ,
142+ } ) ;
143+ } ) ;
144+ } ,
145+ componentWillUnmount ( ) {
146+ const self = this ;
147+ if ( self . f7Tooltip && self . f7Tooltip . destroy ) {
148+ self . f7Tooltip . destroy ( ) ;
149+ self . f7Tooltip = null ;
150+ delete self . f7Tooltip ;
151+ }
136152 } ,
137153 computed : {
138154 attrs ( ) {
You can’t perform that action at this time.
0 commit comments