non-element

vue_error_Runtime directive used on component with non-element root node. The directives will not function as intended

翻译: '运行时指令,用于非元素根节点的组件。这些指令将无法发挥预期的作用'; 这个错误发生在我将v-show放在自定义组件上时, 我想是因为自定义组件在渲染时会被自定义组件的内部元素替换, 因此设置是无效的 解决: 在自定义组件外加一个div, 把v-show写在div上 ......

[Vue warn]: Runtime directive used on component with non-element root node. The directives will not function as intended.

![](https://img2023.cnblogs.com/blog/1987782/202308/1987782-20230815231125882-1972945533.png) ### 原因 意思是自定义指令不能放到组件上,而是要放到自有的元素上,也就是这里用到的`v-dialogDrag ......
共2篇  :1/1页 首页上一页1下一页尾页