vue3传属性时报错 [Vue warn]: Component is missing template or render function.

02-27 阅读 0评论

上网查这个问题,解决方案很多,没有一款适合我。。。先说我的解决办法,如果解决不了再往下看,我的原因是 用的子组件的ref和子组件的标签名一样了:

vue3传属性时报错 [Vue warn]: Component is missing template or render function.,vue3传属性时报错 [Vue warn]: Component is missing template or render function.,词库加载错误:未能找到文件“C:\Users\Administrator\Desktop\火车头9.8破解版\Configuration\Dict_Stopwords.txt”。,使用,解决方案,解决办法,第1张
(图片来源网络,侵删)
    
      
插槽 content 内容000000000
插槽 footer 内容11111111

vue3传属性时报错 [Vue warn]: Component is missing template or render function.

给 ref 改个名字就好了。。。

使用技术:vue3+ts

用的props传值,本来都好好的,后来发现给一个子组件传值发生变化的时候,子组件展示有问题并且报警告:[Vue warn]: Component is missing template or render function

[Vue warn]: Component is missing template or render function

意思很明显,好像是我写了空白的缺少 template和script的组件,但问题是我组件内容是完整的啊:

  
组件1
import { ref, reactive, defineEmits, onBeforeMount, onMounted } from 'vue'; const data: any = reactive({}); export default { name: 'ChildComponent1', data() { return {}; }, };

如果你的问题不是这个,可以看看网上常见的别的解决办法:

vue3传属性时报错 [Vue warn]: Component is missing template or render function.,vue3传属性时报错 [Vue warn]: Component is missing template or render function.,词库加载错误:未能找到文件“C:\Users\Administrator\Desktop\火车头9.8破解版\Configuration\Dict_Stopwords.txt”。,使用,解决方案,解决办法,第3张
(图片来源网络,侵删)
  1. 子组件是空白的
  2. 子组件引入的时候没有写.vue
import ChildComponent1from './ChildComponent1';
// 改为
import ChildComponent1from './ChildComponent1.vue';

希望本文对您有所帮助!

vue3传属性时报错 [Vue warn]: Component is missing template or render function.,vue3传属性时报错 [Vue warn]: Component is missing template or render function.,词库加载错误:未能找到文件“C:\Users\Administrator\Desktop\火车头9.8破解版\Configuration\Dict_Stopwords.txt”。,使用,解决方案,解决办法,第4张
(图片来源网络,侵删)

免责声明
本网站所收集的部分公开资料来源于AI生成和互联网,转载的目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。
文章版权声明:除非注明,否则均为主机测评原创文章,转载或复制请以超链接形式并注明出处。

发表评论

快捷回复: 表情:
评论列表 (暂无评论,人围观)

还没有评论,来说两句吧...

目录[+]