目录前言 1、 props / $emit 2、ref / $refs 3、eventBus事件总线($emit / $on) 4、依赖注入(provide / inject) 5、$parent /
顺晟科技
2021-06-19 08:09:07
284
子组件是tool,如果不加v-if就正常,加了v-if后可以执行子组件钩子函数,但是找不到dom节点,请问如何解决,谢谢
顺晟科技:
v-show is like setting CSS display to none. So the DOM still exists, but you can’t see it.v-if is like using javascript to set element to remove from tree that you specified.
因為你給的資訊太少了 不過如果是async的問題 可以用這種方式解掉 不一定要註冊在tool上面
tool组件没写dom元素
If you want the DOM still exists, using v-show.
thanks for reply,but in my project,i need to use “v-if”,because i have to prepare the data which used by the “tool” component in an async function,if i use v-show to render the “tool” component,it would cause complex problem
09
2022-11
30
2022-09
23
2022-09
23
2022-09
23
2022-09
23
2022-09