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