mali-applet-ui 0.2.92 → 0.2.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<view class="ml-tooltip-content" @click="toggleVisible">
|
|
4
4
|
<slot></slot>
|
|
5
5
|
</view>
|
|
6
|
-
<ml-tooltip-view v-if="showTip" :title="title" :placement="placement" position="absolute" :top="top" :left="left"></ml-tooltip-view>
|
|
6
|
+
<ml-tooltip-view v-if="showTip" :title="title" :placement="placement" position="absolute" :width="width" :top="top" :left="left"></ml-tooltip-view>
|
|
7
7
|
</view>
|
|
8
8
|
</template>
|
|
9
9
|
|
|
@@ -16,6 +16,7 @@ export default {
|
|
|
16
16
|
props: {
|
|
17
17
|
value: Boolean,
|
|
18
18
|
title: String,
|
|
19
|
+
width: String,
|
|
19
20
|
placement: String,
|
|
20
21
|
trigger: String,
|
|
21
22
|
className: String
|
|
@@ -34,6 +35,7 @@ export default {
|
|
|
34
35
|
},
|
|
35
36
|
created () {
|
|
36
37
|
this.showTip = this.value
|
|
38
|
+
this.updateStyle()
|
|
37
39
|
},
|
|
38
40
|
methods: {
|
|
39
41
|
open () {
|
|
@@ -48,6 +50,11 @@ export default {
|
|
|
48
50
|
this.showTip = value
|
|
49
51
|
this.$emit('input', value)
|
|
50
52
|
},
|
|
53
|
+
updateStyle () {
|
|
54
|
+
if (this.placement === 'bottom') {
|
|
55
|
+
this.left = '-20rpx'
|
|
56
|
+
}
|
|
57
|
+
},
|
|
51
58
|
toggleVisible () {
|
|
52
59
|
if (!this.trigger || ['tap', 'click'].includes(this.trigger)) {
|
|
53
60
|
if (this.showTip) {
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
<view class="ml-tooltip-view" :class="[className || '', `placement-${placement || 'bottom'}`]" :style="tipStyles">
|
|
3
3
|
<view class="ml-tooltip-warpper">
|
|
4
4
|
<view class="ml-tooltip-title">
|
|
5
|
-
<slow name="title">
|
|
5
|
+
<slow name="title">
|
|
6
|
+
<text>{{ title }}</text>
|
|
7
|
+
</slow>
|
|
6
8
|
</view>
|
|
7
9
|
<view class="ml-tooltip-arrows">
|
|
8
10
|
<ml-icon v-if="placement === 'bottom'" name="arrow-up-filling" />
|
|
@@ -19,6 +21,7 @@ export default {
|
|
|
19
21
|
name: 'MlTooltipView',
|
|
20
22
|
props: {
|
|
21
23
|
title: String,
|
|
24
|
+
width: String,
|
|
22
25
|
position: String,
|
|
23
26
|
top: String,
|
|
24
27
|
left: String,
|
|
@@ -34,7 +37,8 @@ export default {
|
|
|
34
37
|
const bottomSys = this.bottom ? `bottom: ${this.bottom};` : ''
|
|
35
38
|
const leftSys = this.left ? `left: ${this.left};` : ''
|
|
36
39
|
const rightSys = this.right ? `right: ${this.right};` : ''
|
|
37
|
-
|
|
40
|
+
const wSys = this.width ? `width: ${this.width};` : ''
|
|
41
|
+
return `${posSys}${topSys}${bottomSys}${leftSys}${rightSys}${wSys}`
|
|
38
42
|
}
|
|
39
43
|
}
|
|
40
44
|
}
|
|
@@ -43,6 +47,7 @@ export default {
|
|
|
43
47
|
<style lang="scss">
|
|
44
48
|
.ml-tooltip-view {
|
|
45
49
|
z-index: 900;
|
|
50
|
+
width: 300rpx;
|
|
46
51
|
.ml-tooltip-warpper {
|
|
47
52
|
position: relative;
|
|
48
53
|
display: inline-block;
|
|
@@ -53,6 +58,9 @@ export default {
|
|
|
53
58
|
border-radius: $ml-border-radius;
|
|
54
59
|
max-width: 80vw;
|
|
55
60
|
}
|
|
61
|
+
.ml-tooltip-title {
|
|
62
|
+
white-space: pre-wrap;
|
|
63
|
+
}
|
|
56
64
|
.ml-tooltip-arrows {
|
|
57
65
|
position: absolute;
|
|
58
66
|
color: rgba(0, 0, 0, 0.85);
|