@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.esm.js CHANGED
@@ -9913,6 +9913,7 @@ const PopsTooltipConfig = () => {
9913
9913
  useShadowRoot: true,
9914
9914
  target: null,
9915
9915
  content: "默认文字",
9916
+ isDiffContent: false,
9916
9917
  position: "top",
9917
9918
  className: "",
9918
9919
  isFixed: false,
@@ -10038,6 +10039,19 @@ class ToolTip {
10038
10039
  if (text == null) {
10039
10040
  text = this.getContent();
10040
10041
  }
10042
+ if (this.$data.config.isDiffContent) {
10043
+ let contentPropKey = "data-content";
10044
+ // @ts-ignore
10045
+ let originContentText = this.$el.$content[contentPropKey];
10046
+ if (typeof originContentText === "string") {
10047
+ if (originContentText === text) {
10048
+ // 内容未改变,不修改避免渲染
10049
+ return;
10050
+ }
10051
+ }
10052
+ // @ts-ignore
10053
+ this.$el.$content[contentPropKey] = text;
10054
+ }
10041
10055
  PopsSafeUtils.setSafeHTML(this.$el.$content, text);
10042
10056
  }
10043
10057
  /**