11// out: ..
22<template lang="pug">
33div(
4- v-bind:style ="style "
4+ v-bind:style ="computedStyle "
55style ="position:absolute;display:block;box-sizing:border-box"
66v-if ="opened"
77v-el:tt
8- v-bind:class ="[ class] "
8+ v-bind:class ="class"
99)
1010 slot No content
1111</template >
@@ -16,12 +16,14 @@ module.exports =
1616mixins : [
1717require (" vue-mixins/getViewportSize" )
1818require (" vue-mixins/isOpened" )
19+ require (" vue-mixins/style" )
1920 ]
2021
2122props :
23+ " style" :
24+ default : -> []
2225" class" :
23- type : String
24- default : " tooltip"
26+ default : -> [" tooltip" ]
2527" anchor" :
2628type : String
2729default : " snwe"
@@ -32,13 +34,13 @@ module.exports =
3234type : Function
3335default : ({el,pos,style,cb})->
3436for key,valof style
35- @style [key]= val
37+ @mergeStyle [key]= val
3638cb ()
3739" transitionOut" :
3840type : Function
3941default : ({el,style,cb})->
4042for key,valof style
41- @style [key]= val
43+ @mergeStyle [key]= val
4244cb ()
4345" ignoreParent" :
4446type : Boolean
@@ -53,7 +55,7 @@ module.exports =
5355default : " parent"
5456
5557data : ->
56- style :
58+ mergeStyle :
5759opacity : 0
5860left : undefined
5961top : undefined
@@ -63,7 +65,7 @@ module.exports =
6365
6466watch :
6567" parent" : " setupParent"
66- " zIndex " : (val )-> @style .zIndex = val
68+ " zIndex " : (val )-> @mergeStyle .zIndex = val
6769
6870methods :
6971setupParent : (parent = @parent )->
@@ -134,13 +136,13 @@ module.exports =
134136isPositioned = false
135137# set initial style before open
136138if pos== " w" or pos== " e"
137- @style .top = top+ ' px'
138- @style .left = if isPositionedthen 0 else @parent .offsetLeft + ' px'
139+ @mergeStyle .top = top+ ' px'
140+ @mergeStyle .left = if isPositionedthen 0 else @parent .offsetLeft + ' px'
139141else
140- @style .top = if isPositionedthen 0 else @parent .offsetTop + ' px'
141- @style .left = left+ ' px'
142- @style .height = ttHeight+ ' px'
143- @style .width = ttWidth+ ' px'
142+ @mergeStyle .top = if isPositionedthen 0 else @parent .offsetTop + ' px'
143+ @mergeStyle .left = left+ ' px'
144+ @mergeStyle .height = ttHeight+ ' px'
145+ @mergeStyle .width = ttWidth+ ' px'
144146# begin opening, wait for initial positioning for transition
145147@ $emit " beforeOpen"
146148@ $nextTick =>
@@ -166,8 +168,8 @@ module.exports =
166168top = scrollTop+ parentPos .top
167169left = scrollLeft+ parentPos .left
168170@ transitionOut el : @$els .tt ,style : {opacity : 0 ,top : top+ ' px' ,left : left+ ' px' },cb : =>
169- @style .width = undefined
170- @style .height = undefined
171+ @mergeStyle .width = undefined
172+ @mergeStyle .height = undefined
171173@ setClosed ()
172174@ $emit " closed"
173175toggle : ->