@whitesev/pops 2.0.8 → 2.0.9
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.
- package/dist/index.amd.js +14 -0
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +14 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +14 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +14 -0
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +14 -0
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +14 -0
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/Pops.d.ts +1 -0
- package/dist/types/src/components/tooltip/index.d.ts +1 -0
- package/dist/types/src/components/tooltip/indexType.d.ts +7 -0
- package/package.json +1 -1
- package/src/components/tooltip/config.ts +1 -0
- package/src/components/tooltip/index.ts +13 -0
- package/src/components/tooltip/indexType.ts +7 -0
package/dist/types/src/Pops.d.ts
CHANGED
|
@@ -13,6 +13,13 @@ export interface PopsToolTipDetails extends Pick<PopsCommonConfig, "useShadowRoo
|
|
|
13
13
|
* 显示的文字
|
|
14
14
|
*/
|
|
15
15
|
content: string | (() => string);
|
|
16
|
+
/**
|
|
17
|
+
* 是否比较获取到的content的内容是否改变
|
|
18
|
+
*
|
|
19
|
+
* 如果未改变,则在触发.show时不修改内容
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
isDiffContent?: boolean;
|
|
16
23
|
/**
|
|
17
24
|
* 位置
|
|
18
25
|
* + `follow` 跟随鼠标|触摸位置移动
|
package/package.json
CHANGED
|
@@ -128,6 +128,19 @@ export class ToolTip {
|
|
|
128
128
|
if (text == null) {
|
|
129
129
|
text = this.getContent();
|
|
130
130
|
}
|
|
131
|
+
if (this.$data.config.isDiffContent) {
|
|
132
|
+
let contentPropKey = "data-content";
|
|
133
|
+
// @ts-ignore
|
|
134
|
+
let originContentText: string = this.$el.$content[contentPropKey];
|
|
135
|
+
if (typeof originContentText === "string") {
|
|
136
|
+
if (originContentText === text) {
|
|
137
|
+
// 内容未改变,不修改避免渲染
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
// @ts-ignore
|
|
142
|
+
this.$el.$content[contentPropKey] = text;
|
|
143
|
+
}
|
|
131
144
|
PopsSafeUtils.setSafeHTML(this.$el.$content, text);
|
|
132
145
|
}
|
|
133
146
|
/**
|
|
@@ -24,6 +24,13 @@ export interface PopsToolTipDetails
|
|
|
24
24
|
* 显示的文字
|
|
25
25
|
*/
|
|
26
26
|
content: string | (() => string);
|
|
27
|
+
/**
|
|
28
|
+
* 是否比较获取到的content的内容是否改变
|
|
29
|
+
*
|
|
30
|
+
* 如果未改变,则在触发.show时不修改内容
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
isDiffContent?: boolean;
|
|
27
34
|
/**
|
|
28
35
|
* 位置
|
|
29
36
|
* + `follow` 跟随鼠标|触摸位置移动
|