@shijiu/jsview-vue 1.9.888 → 1.9.921

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.
Files changed (44) hide show
  1. package/package.json +1 -1
  2. package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +36 -67
  3. package/utils/JsViewEngineWidget/TemplateParser.js +146 -138
  4. package/utils/JsViewEngineWidget/WidgetCommon.js +2 -11
  5. package/utils/JsViewPlugin/BrowserPluginLoader.js +14 -0
  6. package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +1 -1
  7. package/utils/JsViewPlugin/JsvPlayer/version.js +19 -0
  8. package/utils/JsViewVueTools/JsvDynamicKeyFrames.js +1 -101
  9. package/utils/JsViewVueTools/JsvHashHistory.js +10 -10
  10. package/utils/JsViewVueTools/JsvImpactTracer.js +1 -1
  11. package/utils/JsViewVueTools/JsvStyleClass.js +1 -10
  12. package/utils/JsViewVueTools/JsvTextTools.js +7 -2
  13. package/utils/JsViewVueTools/TypeCheckAndSet.js +5 -5
  14. package/utils/JsViewVueTools/index.d.ts +1 -5
  15. package/utils/JsViewVueTools/index.js +0 -2
  16. package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserQrcode.vue +173 -152
  17. package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserSpray.vue +1 -1
  18. package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserTextureAnim.vue +88 -51
  19. package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/BrowserApic.vue +65 -63
  20. package/utils/JsViewVueWidget/JsvApic/JsvApic.vue +45 -82
  21. package/utils/JsViewVueWidget/JsvFilterView.vue +12 -17
  22. package/utils/JsViewVueWidget/JsvGrid.vue +10 -2
  23. package/utils/JsViewVueWidget/JsvInput/Cursor.vue +7 -5
  24. package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +8 -60
  25. package/utils/JsViewVueWidget/JsvMarquee.vue +9 -12
  26. package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +30 -24
  27. package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +1 -1
  28. package/utils/JsViewVueWidget/JsvPosterDiv.vue +2 -2
  29. package/utils/JsViewVueWidget/JsvPosterImage.vue +4 -4
  30. package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +8 -8
  31. package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +4 -4
  32. package/utils/JsViewVueWidget/JsvScaleTextBox.vue +1 -1
  33. package/utils/JsViewVueWidget/JsvSoundPool.js +1 -1
  34. package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +13 -15
  35. package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +1 -1
  36. package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +115 -111
  37. package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +1 -1
  38. package/utils/JsViewVueWidget/JsvTextBox.vue +38 -16
  39. package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +16 -12
  40. package/utils/JsViewVueWidget/JsvTransparentDiv.vue +1 -1
  41. package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +3 -3
  42. package/utils/JsViewVueWidget/JsvVisibleSensor/index.js +0 -3
  43. package/utils/JsViewVueWidget/index.js +8 -13
  44. package/utils/JsViewVueWidget/utils/text.js +3 -4
@@ -5,11 +5,12 @@
5
5
  * @LastEditTime: 2021-10-13 17:13:24
6
6
  * @Description: file content
7
7
  -->
8
- <script>
8
+ <script setup>
9
9
  import Viewer from "./Viewer";
10
10
  import WebpData from "./WebpData";
11
11
  import GifData from "./GifData";
12
12
  import { LoopType } from "./LoopToolBase";
13
+ import { onMounted, shallowRef } from "vue";
13
14
 
14
15
  const loadImage = (url) => {
15
16
  return new Promise((resolve, reject) => {
@@ -51,74 +52,75 @@ const getUrl = (base_url) => {
51
52
  }
52
53
  };
53
54
 
54
- let TOKEN = 0;
55
-
56
- export default {
57
- props: {
58
- src: String,
59
- style: Object,
60
- autoPlay: {
61
- type: Boolean,
62
- default: true,
63
- },
64
- loopType: {
65
- type: Number,
66
- default: LoopType.LOOP_DEFAULT,
67
- },
68
- loopInfo: {
69
- type: Array,
70
- default: () => [[-1, -1, -1]],
71
- },
72
- onStart: Function,
73
- onEnd: Function,
74
- onLoad: Function,
55
+ const props = defineProps({
56
+ src: String,
57
+ style: Object,
58
+ autoPlay: {
59
+ type: Boolean,
60
+ default: true,
75
61
  },
76
- setup() {
77
- return {
78
- viewId: -1,
79
- viewer: null,
80
- canvasId: "JsvApic" + TOKEN++,
81
- };
62
+ loopType: {
63
+ type: Number,
64
+ default: LoopType.LOOP_DEFAULT,
82
65
  },
83
- methods: {
84
- play() {
85
- this.viewer?.play();
86
- },
87
- stop() {
88
- this.viewer?.stop();
89
- },
66
+ loopInfo: {
67
+ type: Array,
68
+ default: () => [[-1, -1, -1]],
90
69
  },
91
- mounted() {
92
- let canvas = window.originDocument.getElementById(this.canvasId);
93
- if (canvas) {
94
- loadImage(getUrl(this.src))
95
- .then((data) => {
96
- let listener = {
97
- onstart: this.onStart,
98
- onend: this.onEnd,
99
- };
100
- this.viewer = new Viewer(
101
- data,
102
- canvas,
103
- listener,
104
- this.autoPlay,
105
- this.loopType,
106
- this.loopInfo
107
- );
108
- if (this.onLoad) {
109
- this.onLoad();
110
- }
111
- })
112
- .catch((err) => console.error(err));
113
- } else {
114
- console.error("apic get canvas failed.");
115
- }
70
+ onStart: Function,
71
+ onEnd: Function,
72
+ onLoad: Function,
73
+ });
74
+
75
+ let viewer = null;
76
+ let canvasProxyRef = shallowRef(null);
77
+
78
+ onMounted(() => {
79
+ let domLayoutView = canvasProxyRef.value.jsvGetProxyView();
80
+ domLayoutView.RegisterOnProxyReady(() => {
81
+ // 制作canvas
82
+ let canvas = window.originDocument.createElement("canvas");
83
+ canvas.style.width = props.style.width + "px";
84
+ canvas.style.height = props.style.height + "px";
85
+ domLayoutView.HtmlGetElement().appendChild(canvas);
86
+
87
+ loadImage(getUrl(props.src))
88
+ .then((data) => {
89
+ let listener = {
90
+ onstart: props.onStart,
91
+ onend: props.onEnd,
92
+ };
93
+ viewer = new Viewer(
94
+ data,
95
+ canvas,
96
+ listener,
97
+ props.autoPlay,
98
+ props.loopType,
99
+ props.loopInfo
100
+ );
101
+ if (props.onLoad) {
102
+ props.onLoad();
103
+ }
104
+ })
105
+ .catch((err) => console.error(err));
106
+ });
107
+ });
108
+
109
+ defineExpose({
110
+ play: () => {
111
+ viewer?.play();
116
112
  },
117
- };
113
+ stop: () => {
114
+ viewer?.stop();
115
+ },
116
+ });
117
+ </script>
118
118
 
119
+ <script>
120
+ import { LoopType } from "./LoopToolBase";
119
121
  export { LoopType };
120
122
  </script>
121
123
 
122
124
  <template>
123
- <jsve-canvas :id="canvasId" :style="style" />
124
- </template>
125
+ <div ref="canvasProxyRef" :style="props.style" />
126
+ </template>
@@ -68,59 +68,34 @@ export default {
68
68
  methods: {
69
69
  play() {
70
70
  if (this.$refs.element) {
71
- let main_view = this.$refs.element.jsvGetProxyView();
72
- if (main_view && main_view.ChildViews.length > 0) {
73
- let target_view = main_view.ChildViews[0];
74
- if (
75
- target_view.TextureSetting &&
76
- target_view.TextureSetting.Texture &&
77
- target_view.TextureSetting.Texture.RenderTexture
78
- ) {
79
- let params = {
80
- LT: this.loopType,
81
- LI: this.loopInfo,
82
- };
83
- ForgeExtension.TextureManager.DispatchCommand(
84
- target_view.TextureSetting.Texture.RenderTexture.IdToken,
85
- 0,
86
- JSON.stringify(params)
87
- );
88
- target_view.TextureSetting.Texture.unregisterOnStart(
89
- this.onStartId
90
- );
91
- if (this.onStart) {
92
- this.onStartId =
93
- target_view.TextureSetting.Texture.registerOnStart(
94
- this.onStart
95
- );
96
- }
97
- target_view.TextureSetting.Texture.unregisterOnEnd(this.onEndId);
98
- if (this.onEnd) {
99
- this.onEndId = target_view.TextureSetting.Texture.registerOnEnd(
100
- this.onEnd
101
- );
102
- }
103
- }
71
+ let mainViewTexture = this.$refs.element.jsvGetProxyTexture(
72
+ ForgeExtension.TextureManager
73
+ );
74
+
75
+ let params = {
76
+ LT: this.loopType,
77
+ LI: this.loopInfo,
78
+ };
79
+ mainViewTexture.DispatchCommand(
80
+ Forge.NativeConstant.APIC_PLAY,
81
+ JSON.stringify(params)
82
+ );
83
+ mainViewTexture.unregisterOnStart(this.onStartId);
84
+ if (this.onStart) {
85
+ this.onStartId = mainViewTexture.registerOnStart(this.onStart);
86
+ }
87
+ mainViewTexture.unregisterOnEnd(this.onEndId);
88
+ if (this.onEnd) {
89
+ this.onEndId = mainViewTexture.registerOnEnd(this.onEnd);
104
90
  }
105
91
  }
106
92
  },
107
93
  stop() {
108
94
  if (this.$refs.element) {
109
- let main_view = this.$refs.element.jsvGetProxyView();
110
- if (main_view && main_view.ChildViews.length > 0) {
111
- let target_view = main_view.ChildViews[0];
112
- if (
113
- target_view.TextureSetting &&
114
- target_view.TextureSetting.Texture &&
115
- target_view.TextureSetting.Texture.RenderTexture
116
- ) {
117
- ForgeExtension.TextureManager.DispatchCommand(
118
- target_view.TextureSetting.Texture.RenderTexture.IdToken,
119
- 1,
120
- ""
121
- );
122
- }
123
- }
95
+ let mainViewTexture = this.$refs.element.jsvGetProxyTexture(
96
+ ForgeExtension.TextureManager
97
+ );
98
+ mainViewTexture.DispatchCommand(Forge.NativeConstant.APIC_STOP, "");
124
99
  }
125
100
  },
126
101
  },
@@ -130,44 +105,26 @@ export default {
130
105
  }
131
106
  if (this.onLoad) {
132
107
  if (this.$refs.element) {
133
- let main_view = this.$refs.element.jsvGetProxyView();
134
- if (main_view && main_view.ChildViews.length > 0) {
135
- let target_view = main_view.ChildViews[0];
136
- if (
137
- target_view.TextureSetting &&
138
- target_view.TextureSetting.Texture &&
139
- target_view.TextureSetting.Texture.RenderTexture
140
- ) {
141
- target_view.TextureSetting.Texture.RegisterLoadImageCallback(
142
- null,
143
- this.onLoad,
144
- null
145
- );
146
- }
147
- }
108
+ let mainViewTexture = this.$refs.element.jsvGetProxyTexture(
109
+ ForgeExtension.TextureManager
110
+ );
111
+ mainViewTexture.RegisterLoadImageCallback(null, this.onLoad, null);
148
112
  }
149
113
  }
150
114
  },
151
115
  beforeUnmount() {
152
116
  this.stop();
153
117
  if (this.$refs.element) {
154
- let main_view = this.$refs.element.jsvGetProxyView();
155
- if (main_view && main_view.ChildViews.length > 0) {
156
- let target_view = main_view.ChildViews[0];
157
- if (
158
- target_view.TextureSetting &&
159
- target_view.TextureSetting.Texture &&
160
- target_view.TextureSetting.Texture.RenderTexture
161
- ) {
162
- if (this.onStart) {
163
- target_view.TextureSetting.Texture.unregisterOnStart(
164
- this.onStartId
165
- );
166
- }
167
- if (this.onEnd) {
168
- target_view.TextureSetting.Texture.unregisterOnEnd(this.onEndId);
169
- }
170
- }
118
+ let mainViewTexture = this.$refs.element.jsvGetProxyTexture(
119
+ ForgeExtension.TextureManager
120
+ );
121
+
122
+ if (this.onStart) {
123
+ mainViewTexture.unregisterOnStart(this.onStartId);
124
+ }
125
+
126
+ if (this.onEnd) {
127
+ mainViewTexture.unregisterOnEnd(this.onEndId);
171
128
  }
172
129
  }
173
130
  },
@@ -175,5 +132,11 @@ export default {
175
132
  </script>
176
133
 
177
134
  <template>
178
- <img jsv_disable_apic_autoplay alt="" ref="element" :src="src" :style="style" />
179
- </template>
135
+ <img
136
+ data-jsv-disable-apic-autoplay
137
+ alt=""
138
+ ref="element"
139
+ :src="src"
140
+ :style="style"
141
+ />
142
+ </template>
@@ -32,22 +32,17 @@ const props = defineProps({
32
32
  filterType: {
33
33
  type: String,
34
34
  default: null,
35
- }
35
+ },
36
36
  });
37
37
 
38
38
  let filterView = new Forge.FilterView();
39
- const view_store = ForgeExtension.RootActivity
40
- ? ForgeExtension.RootActivity.ViewStore
41
- : Forge.sViewStore;
42
39
 
43
- let viewId = view_store.add(
44
- new Forge.ViewInfo(filterView)
45
- );
40
+ let viewId = Forge.sViewStore.add(new Forge.ViewInfo(filterView, null));
46
41
 
47
42
  // 监控filter改变
48
43
  watchEffect(() => {
49
44
  if (filterView) {
50
- console.log(`filterType change to ${props.filterType}`)
45
+ console.log(`filterType change to ${props.filterType}`);
51
46
  switch (props.filterType) {
52
47
  case "gray-down":
53
48
  filterView.FilterSwitch(true);
@@ -59,23 +54,23 @@ watchEffect(() => {
59
54
  });
60
55
 
61
56
  onBeforeUnmount(() => {
62
- const view_store = ForgeExtension.RootActivity
63
- ? ForgeExtension.RootActivity.ViewStore
64
- : Forge.sViewStore;
65
- view_store.remove(viewId);
57
+ if (viewId > 0) {
58
+ Forge.sViewStore.remove(viewId);
59
+ viewId = -1;
60
+ }
66
61
  });
67
-
68
62
  </script>
69
63
 
70
64
  <template>
71
- <div
65
+ <div
72
66
  :style="{
73
67
  left: left,
74
68
  top: top,
75
69
  width: width,
76
- height: height
77
- }"
78
- :jsv_innerview="viewId">
70
+ height: height,
71
+ }"
72
+ :data-jsv-vw-innerview="viewId"
73
+ >
79
74
  <slot></slot>
80
75
  </div>
81
76
  </template>
@@ -66,7 +66,7 @@
66
66
  -->
67
67
  <script>
68
68
  import { reactive } from "vue";
69
- import { EdgeDirection, FocusMoveType } from "../JsViewEngineWidget";
69
+ import { EdgeDirection } from "jsview/utils/JsViewEngineWidget";
70
70
 
71
71
  const TAG = "JsvGrid";
72
72
 
@@ -93,6 +93,14 @@ class LineType extends UpdateType {
93
93
  }
94
94
  }
95
95
 
96
+ const FocusMoveType = {
97
+ NO_ADJUST: 0x00000000,
98
+ COLUMN_LOOP: 0x00000001,
99
+ ROW_LOOP: 0x00000001 << 1,
100
+ COLUMN_FIND_NEAR: 0x00000001 << 2,
101
+ ROW_FIND_NEAR: 0x00000001 << 3,
102
+ };
103
+
96
104
  export { PageType, LineType, FocusMoveType };
97
105
 
98
106
  export default {
@@ -660,4 +668,4 @@ export default {
660
668
  ></slot>
661
669
  </div>
662
670
  </jsv-focus-block>
663
- </template>
671
+ </template>
@@ -1,16 +1,18 @@
1
1
  <!--
2
2
  * @Author: ChenChanghua
3
3
  * @Date: 2022-01-20 10:37:01
4
- * @LastEditors: ChenChanghua
5
- * @LastEditTime: 2022-09-02 13:28:59
4
+ * @LastEditTime: 2023-02-01 13:47:13
6
5
  * @Description: file content
7
6
  -->
8
7
  <script>
9
- import { ref, shallowRef } from "vue";
8
+ import { ref } from "vue";
10
9
  export default {
11
10
  props: {
12
- left: Number,
13
- top: Number,
11
+ left: {
12
+ type: Number,
13
+ default: 0,
14
+ },
15
+ top: { type: Number, default: 0 },
14
16
  width: Number,
15
17
  height: Number,
16
18
  color: String,
@@ -1,13 +1,12 @@
1
1
  <!--
2
2
  * @Author: ChenChanghua
3
3
  * @Date: 2022-01-20 10:35:56
4
- * @LastEditors: ChenChanghua
5
- * @LastEditTime: 2022-09-02 13:44:56
4
+ * @LastEditTime: 2023-02-01 13:47:26
6
5
  * @Description: file content
7
6
  -->
8
7
  <script>
8
+ import { EdgeDirection } from "jsview/utils/JsViewEngineWidget";
9
9
  import { Forge, ForgeExtension } from "@shijiu/jsview/dom/jsv-forge-define";
10
- import { EdgeDirection } from "../../JsViewEngineWidget";
11
10
  import CursorVue from "./Cursor.vue";
12
11
 
13
12
  const InputType = {
@@ -279,52 +278,6 @@ export default {
279
278
  return Forge.sTextUtils.GetTextWidth(this._getStringWithFont(str));
280
279
  },
281
280
 
282
- // _dispatchEvent(event) {
283
- // if (!event || this.readonly) {
284
- // return;
285
- // }
286
-
287
- // const pre_full_str = this.fullString;
288
- // const pre_index = this.curOffset;
289
- // switch (event.type) {
290
- // case InputDispatcher.Type.add:
291
- // if (this.type === Input.type.NUMBER && !ifDigital(event.data)) {
292
- // console.log(`The input data:${event.data} is not number`);
293
- // break;
294
- // }
295
- // if (this.fullString.length < this.maxlength) {
296
- // const new_str =
297
- // pre_full_str.slice(0, pre_index) +
298
- // event.data +
299
- // pre_full_str.slice(pre_index);
300
- // const new_index = pre_index + event.data.length;
301
- // this._onTextChanged(new_str, new_index);
302
- // } else {
303
- // if (this.onTextOverflow) {
304
- // this.onTextOverflow();
305
- // }
306
- // }
307
- // break;
308
- // case InputDispatcher.Type.delete:
309
- // if (pre_index > 0) {
310
- // const new_str =
311
- // pre_full_str.slice(0, pre_index - 1) +
312
- // pre_full_str.slice(pre_index);
313
- // const new_index = pre_index - 1;
314
- // this._onTextChanged(new_str, new_index);
315
- // }
316
- // break;
317
- // case InputDispatcher.Type.clear:
318
- // this._onTextChanged("", 0);
319
- // break;
320
- // case InputDispatcher.Type.replace:
321
- // this._onTextChanged(event.data, event.data.length);
322
- // break;
323
- // default:
324
- // break;
325
- // }
326
- // },
327
-
328
281
  add(string) {
329
282
  if (this.type === InputType.NUMBER && !ifDigital(string)) {
330
283
  // console.log(`The input data:${string} is not number`);
@@ -710,10 +663,8 @@ export default {
710
663
  this.editControlView = new Forge.EditControlView();
711
664
  this.editControlView.OnTextChanged = this._onTextChanged;
712
665
  this.editControlView.OnStatusChanged = this._onStatusChanged;
713
- const view_store = ForgeExtension.RootActivity
714
- ? ForgeExtension.RootActivity.ViewStore
715
- : Forge.sViewStore;
716
- this.editControlViewId = view_store.add(
666
+
667
+ this.editControlViewId = Forge.sViewStore.add(
717
668
  new Forge.ViewInfo(this.editControlView)
718
669
  );
719
670
  const cur_position = this._calculateCursorPosition(
@@ -735,10 +686,7 @@ export default {
735
686
  },
736
687
  beforeUnmount() {
737
688
  if (this.editControlViewId != -1) {
738
- const view_store = ForgeExtension.RootActivity
739
- ? ForgeExtension.RootActivity.ViewStore
740
- : Forge.sViewStore;
741
- view_store.remove(this.editControlViewId);
689
+ Forge.sViewStore.remove(this.editControlViewId);
742
690
  this.editControlViewId = -1;
743
691
  }
744
692
  this.clearCursorPauseTimer();
@@ -773,7 +721,7 @@ export default {
773
721
  left: this.textLeft,
774
722
  width: this.textWidth,
775
723
  height: height,
776
- lineHeight: `${height}px`,
724
+ lineHeight: height,
777
725
  ...this.fontStyle,
778
726
  }"
779
727
  >
@@ -785,7 +733,7 @@ export default {
785
733
  left: 0,
786
734
  width: width,
787
735
  height: height,
788
- lineHeight: `${height}px`,
736
+ lineHeight: height,
789
737
  ...fontStyle,
790
738
  color: placeholderColor,
791
739
  }"
@@ -801,6 +749,6 @@ export default {
801
749
  :color="cursorColorInner"
802
750
  :width="cursorWidth"
803
751
  />
804
- <div :jsv_innerview="editControlViewId" />
752
+ <div :data-jsv-vw-innerview="editControlViewId" />
805
753
  </jsv-focus-block>
806
754
  </template>
@@ -10,21 +10,15 @@
10
10
 
11
11
  <script setup>
12
12
  import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
13
- import { getTextWidth } from "./utils";
14
- import {
15
- shallowRef,
16
- computed,
17
- toRaw,
18
- onMounted,
19
- onBeforeUnmount,
20
- } from "vue";
13
+ import { getTextWidth } from "../JsViewVueTools/JsvTextTools";
14
+ import { shallowRef, computed, toRaw, onMounted, onBeforeUnmount } from "vue";
21
15
 
22
16
  const defaultFontStyle = () => {
23
17
  return {
24
18
  color: "rgba(255,255,255,1.0)",
25
19
  fontSize: 10,
26
20
  textAlign: "start",
27
- lineHeight: "20px",
21
+ lineHeight: 20,
28
22
  whiteSpace: "nowrap",
29
23
  direction: "ltr",
30
24
  };
@@ -45,7 +39,7 @@ const props = defineProps({
45
39
  color: "rgba(255,255,255,1.0)",
46
40
  fontSize: 10,
47
41
  textAlign: "start",
48
- lineHeight: "20px",
42
+ lineHeight: 20,
49
43
  whiteSpace: "nowrap",
50
44
  direction: "ltr",
51
45
  };
@@ -214,8 +208,11 @@ onBeforeUnmount(() => {
214
208
  >
215
209
  <div
216
210
  ref="textDiv"
217
- :style="{ ...fontStyle, height: style.height }"
218
- :jsv_text_align_minwidth="style.width"
211
+ :style="{
212
+ ...fontStyle,
213
+ height: style.height,
214
+ JsvTextAlignMinWidth: style.width,
215
+ }"
219
216
  >
220
217
  {{ text }}
221
218
  </div>
@@ -107,34 +107,40 @@ export default {
107
107
  this.cache.maskHeight = this.maskHeight;
108
108
  },
109
109
  _initForHtml() {
110
- const canvas = window.originDocument.createElement("canvas");
111
- canvas.style.width = this.style.width + "px";
112
- canvas.style.height = this.style.height + "px";
113
- this.$refs.innerView?.jsvGetProxyView(true).Element.appendChild(canvas);
110
+ let _this = this;
111
+ this.$refs.innerView?.jsvGetProxyView(true).RegisterOnProxyReady(() => {
112
+ const canvas = window.originDocument.createElement("canvas");
113
+ canvas.style.width = _this.style.width + "px";
114
+ canvas.style.height = _this.style.height + "px";
115
+ _this.$refs.innerView
116
+ ?.jsvGetProxyView(true)
117
+ .HtmlGetElement()
118
+ .appendChild(canvas);
114
119
 
115
- const clip_image = new Image();
116
- const bg_image = new Image();
117
- clip_image.src = this.maskSrc;
118
- bg_image.src = this.viewSrc;
119
- let clip_ready = false;
120
- let bg_ready = false;
120
+ const clip_image = new Image();
121
+ const bg_image = new Image();
122
+ clip_image.src = _this.maskSrc;
123
+ bg_image.src = _this.viewSrc;
124
+ let clip_ready = false;
125
+ let bg_ready = false;
121
126
 
122
- clip_image.onload = () => {
123
- clip_ready = true;
124
- this._drawClip(canvas, clip_image, clip_ready, bg_image, bg_ready);
125
- };
127
+ clip_image.onload = () => {
128
+ clip_ready = true;
129
+ _this._drawClip(canvas, clip_image, clip_ready, bg_image, bg_ready);
130
+ };
126
131
 
127
- bg_image.onload = () => {
128
- bg_ready = true;
129
- this._drawClip(canvas, clip_image, clip_ready, bg_image, bg_ready);
130
- };
132
+ bg_image.onload = () => {
133
+ bg_ready = true;
134
+ _this._drawClip(canvas, clip_image, clip_ready, bg_image, bg_ready);
135
+ };
136
+ });
131
137
  },
132
138
  _updateInnerView() {
133
139
  if (this.innerView === null) {
134
140
  // 初始化View
135
141
  this.innerView = new Forge.LayoutView();
136
- this.innerViewId = ForgeExtension.RootActivity.ViewStore.add(
137
- new Forge.ViewInfo(this.innerView)
142
+ this.innerViewId = Forge.sViewStore.add(
143
+ new Forge.ViewInfo(this.innerView, null)
138
144
  );
139
145
  }
140
146
 
@@ -187,7 +193,7 @@ export default {
187
193
  beforeUnmount() {
188
194
  // 清理View管理缓存
189
195
  if (this.innerViewId !== -1) {
190
- ForgeExtension.RootActivity.ViewStore.remove(this.innerViewId);
196
+ Forge.sViewStore.remove(this.innerViewId);
191
197
  this.innerViewId = -1;
192
198
  this.innerView = null;
193
199
  }
@@ -207,12 +213,12 @@ export default {
207
213
  <div
208
214
  v-else
209
215
  ref="innerView"
210
- :jsv_innerview="innerViewId"
216
+ :data-jsv-vw-innerview="innerViewId"
211
217
  :style="{
212
218
  top: style.top,
213
219
  left: style.left,
214
220
  width: style.width,
215
- height: style.height
221
+ height: style.height,
216
222
  }"
217
223
  ></div>
218
- </template>
224
+ </template>
@@ -100,4 +100,4 @@ export default {
100
100
  <div v-else :style="{ ...style }">
101
101
  <slot />
102
102
  </div>
103
- </template>
103
+ </template>