@yoooloo42/joker 1.0.48 → 1.0.50

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.cjs.js CHANGED
@@ -40143,14 +40143,20 @@ var script$e = {
40143
40143
  setup(__props) {
40144
40144
 
40145
40145
  const props = __props;
40146
- // 监听 myProps.menu 的变化
40147
- vue.watch(() => props.myProps.menu, (newMenu, oldMenu) => {
40148
- console.log('--- WATCH: myProps.menu 变化 ---');
40149
- console.log('新值长度:', newMenu ? newMenu.length : 0);
40150
- // 检查此时 v-if 条件是否应该为 true
40151
- console.log('v-if 条件现在应为 true:', newMenu && newMenu.length > 0);
40152
- }, {
40153
- immediate: true // 立即执行一次,观察初始状态
40146
+
40147
+ // 1. 创建本地响应式副本
40148
+ const localMyProps = vue.reactive({});
40149
+ // 2. 使用 watchEffect 监听 props.myProps 的变化并同步到本地副本
40150
+ // 每次 props.myProps 发生变化时,这里都会执行
40151
+ vue.watchEffect(() => {
40152
+ // 强制将 props.myProps 的所有属性复制过来,确保 localMyProps 是响应式的
40153
+ // 这样,即使 props.myProps 自身非响应式,但它作为整体变化时,watchEffect 仍能捕获到。
40154
+ Object.assign(localMyProps, props.myProps);
40155
+
40156
+ // 可以在这里进行额外的调试
40157
+ if (localMyProps.menu && localMyProps.menu.length > 0) {
40158
+ console.log("WATCH EFFECT: menu已加载,准备渲染");
40159
+ }
40154
40160
  });
40155
40161
 
40156
40162
  const style = vue.reactive({
@@ -40172,9 +40178,9 @@ return (_ctx, _cache) => {
40172
40178
  vue.createCommentVNode(" 置顶菜单 "),
40173
40179
  vue.withDirectives(vue.createVNode(_component_ly0Menu, {
40174
40180
  scopeThis: __props.scopeThis,
40175
- myProps: __props.myProps.menu
40181
+ myProps: localMyProps.menu
40176
40182
  }, null, 8 /* PROPS */, ["scopeThis", "myProps"]), [
40177
- [vue.vShow, __props.myProps.menu && __props.myProps.menu.length > 0]
40183
+ [vue.vShow, localMyProps.menu && localMyProps.menu.length > 0]
40178
40184
  ]),
40179
40185
  vue.createCommentVNode(" 表单区域可以分为多个列 "),
40180
40186
  vue.createElementVNode("div", {