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