vue3插槽内部v-model失效问题

场景

插槽内部无法向上抛出 onUpdate:modelValue事件

let children = h(resolveComponent('draggable'), {
        class: 'draggable-box',
        id: name, itemKey: 'cid',
        group: 'formGroup',
        list: this.list,
        onChange: this.change,
      }, {
        item: withCtx(itemSlot)
      });
      let vNode = h('div', {
        class: classes, style: {
          minHeight: '50px',
          marginTop: '10px',
          color: 'rgba(0,0,0,0.5)',
          fontSize: '13px',
          overflowX: 'auto',
        }
      }, [children]);

解决办法

https://template-explorer.vuejs.org/
item: withCtx(itemSlot)
posted @ 2022-07-25 19:13  fight139  阅读(601)  评论(0编辑  收藏  举报