解决:this.$refs引用子组件报错 is not a function

02-27 阅读 0评论

解决:this.$refs引用子组件报错 is not a function

  • 问题描述:

    解决:this.$refs引用子组件报错 is not a function,解决:this.$refs引用子组件报错 is not a function,词库加载错误:未能找到文件“C:\Users\Administrator\Desktop\火车头9.8破解版\Configuration\Dict_Stopwords.txt”。,设置,方法,修改,第1张
    (图片来源网络,侵删)

    vue通过this.$refs引用子组件出现undefined或者is not a function的错误

  • 报错如下:

    _this3.$refs.fileUpload.changeFileList is not a function


    问题分析:

    • 问题1:出现undefined错误

      1. 包含子组件的标签需要放在中第一个子标签的子标签中,而且需要设置ref属性,

        因为父组件逻辑代码中是通过该属性调用子组件的方法或者属性的。

    • 问题2: 出现is not a function的错误

      解决:this.$refs引用子组件报错 is not a function,解决:this.$refs引用子组件报错 is not a function,词库加载错误:未能找到文件“C:\Users\Administrator\Desktop\火车头9.8破解版\Configuration\Dict_Stopwords.txt”。,设置,方法,修改,第2张
      (图片来源网络,侵删)
      1. 子组件需要import,import是请确保路径正确
      2. import之后还需要在父组件的component中进行注册

      解决办法:

      • 按上述分析对号入座进行修改即可。

        完结。

        解决:this.$refs引用子组件报错 is not a function,解决:this.$refs引用子组件报错 is not a function,词库加载错误:未能找到文件“C:\Users\Administrator\Desktop\火车头9.8破解版\Configuration\Dict_Stopwords.txt”。,设置,方法,修改,第3张
        (图片来源网络,侵删)

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

发表评论

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

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

目录[+]