@yoooloo42/joker 1.0.47 → 1.0.49

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
@@ -1,4 +1,4 @@
1
- import { computed, createElementBlock, openBlock, Fragment, createCommentVNode, createElementVNode, normalizeStyle, toDisplayString, defineComponent, h, onMounted, onBeforeUnmount, ref, watch, nextTick as nextTick$1, reactive, resolveComponent, createBlock, withCtx, renderList, createTextVNode, createVNode, unref } from 'vue';
1
+ import { computed, createElementBlock, openBlock, Fragment, createCommentVNode, createElementVNode, normalizeStyle, toDisplayString, defineComponent, h, onMounted, onBeforeUnmount, ref, watch, nextTick as nextTick$1, reactive, resolveComponent, createBlock, withCtx, renderList, createTextVNode, createVNode, unref, watchEffect, withDirectives, vShow } from 'vue';
2
2
 
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -40139,14 +40139,20 @@ var script$e = {
40139
40139
  setup(__props) {
40140
40140
 
40141
40141
  const props = __props;
40142
- // 监听 myProps.menu 的变化
40143
- watch(() => props.myProps.menu, (newMenu, oldMenu) => {
40144
- console.log('--- WATCH: myProps.menu 变化 ---');
40145
- console.log('新值长度:', newMenu ? newMenu.length : 0);
40146
- // 检查此时 v-if 条件是否应该为 true
40147
- console.log('v-if 条件现在应为 true:', newMenu && newMenu.length > 0);
40148
- }, {
40149
- immediate: true // 立即执行一次,观察初始状态
40142
+
40143
+ // 1. 创建本地响应式副本
40144
+ const localMyProps = reactive({});
40145
+ // 2. 使用 watchEffect 监听 props.myProps 的变化并同步到本地副本
40146
+ // 每次 props.myProps 发生变化时,这里都会执行
40147
+ watchEffect(() => {
40148
+ // 强制将 props.myProps 的所有属性复制过来,确保 localMyProps 是响应式的
40149
+ // 这样,即使 props.myProps 自身非响应式,但它作为整体变化时,watchEffect 仍能捕获到。
40150
+ Object.assign(localMyProps, props.myProps);
40151
+
40152
+ // 可以在这里进行额外的调试
40153
+ if (localMyProps.menu && localMyProps.menu.length > 0) {
40154
+ console.log("WATCH EFFECT: menu已加载,准备渲染");
40155
+ }
40150
40156
  });
40151
40157
 
40152
40158
  const style = reactive({
@@ -40166,13 +40172,12 @@ return (_ctx, _cache) => {
40166
40172
 
40167
40173
  return (openBlock(), createElementBlock(Fragment, null, [
40168
40174
  createCommentVNode(" 置顶菜单 "),
40169
- (__props.myProps.menu && __props.myProps.menu.length > 0)
40170
- ? (openBlock(), createBlock(_component_ly0Menu, {
40171
- key: 0,
40172
- scopeThis: __props.scopeThis,
40173
- myProps: __props.myProps.menu
40174
- }, null, 8 /* PROPS */, ["scopeThis", "myProps"]))
40175
- : createCommentVNode("v-if", true),
40175
+ withDirectives(createVNode(_component_ly0Menu, {
40176
+ scopeThis: __props.scopeThis,
40177
+ myProps: __props.myProps.menu
40178
+ }, null, 8 /* PROPS */, ["scopeThis", "myProps"]), [
40179
+ [vShow, __props.myProps.menu && __props.myProps.menu.length > 0]
40180
+ ]),
40176
40181
  createCommentVNode(" 表单区域可以分为多个列 "),
40177
40182
  createElementVNode("div", {
40178
40183
  style: normalizeStyle(style.root_box)
@@ -40291,7 +40296,7 @@ return (_ctx, _cache) => {
40291
40296
  ], 4 /* STYLE */),
40292
40297
  createCommentVNode(" 提交 "),
40293
40298
  (__props.dataBox.hdlSubmit)
40294
- ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
40299
+ ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
40295
40300
  createElementVNode("div", {
40296
40301
  style: normalizeStyle(style.line)
40297
40302
  }, null, 4 /* STYLE */),