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)