如何在H(vue.js)函数内进行循环(Vor)动态?
我有一个反应变量列表ref
或vue.js项目中的反应性
我
创建了一个依赖于此列表(反应性)的应用
let list = ref(['item']);
let vNode = h(
'ul',
list.value.map((v, i) => { return h('li', { key: i }, v) })
);
let customApp = createApp(vNode);
customApp.mount('#trial')
, 变化, 如何使其动态并与列表同步?
I have a reactive variable list either ref
or reactive
in a vue.Js project
and i create an app that depends on this list(reactive)
let list = ref(['item']);
let vNode = h(
'ul',
list.value.map((v, i) => { return h('li', { key: i }, v) })
);
let customApp = createApp(vNode);
customApp.mount('#trial')
when list changes the mounted component doesn't change,
how can i make it dynamic and sync with list?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用组件而非VNODE解决了该问题。
the problem was solved using a component not a vnode.