forked from N3-components/N3-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathn3Tooltip.vue
executable file
·44 lines (41 loc) · 933 Bytes
/
n3Tooltip.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<template>
<span >
<span v-el:trigger >
<slot>
</slot>
</span>
<div :class="classObj"
v-el:popover
v-show="show"
:transition="effect">
<div class="{{prefixCls}}-tooltip-arrow"></div>
<div class="{{prefixCls}}-tooltip-inner">
{{{content}}}
</div>
</div>
</span>
</template>
<script>
import PopoverMixin from './popoverMixins'
export default {
props: {
prefixCls: {
type: String,
default: 'n3'
}
},
mixins: [PopoverMixin],
computed: {
classObj () {
let {prefixCls, placement} = this
let klass = {}
klass[prefixCls + '-tooltip'] = true
klass[prefixCls + '-tooltip-top'] = placement === 'top'
klass[prefixCls + '-tooltip-left'] = placement === 'left'
klass[prefixCls + '-tooltip-right'] = placement === 'right'
klass[prefixCls + '-tooltip-bottom'] = placement === 'bottom'
return klass
}
}
}
</script>