当前位置:   article > 正文

uniapp Vue3 setup 报错 [plugin:commonjs] Expected ‘,‘ or ‘}‘ after property value in JSON at position_[plugin:uni:mp-using-component] expected ',' or '}

[plugin:uni:mp-using-component] expected ',' or '}' after property value in

一般情况下uniapp vue2 是可以自动引入的:

然后我在index.vue 文件中这样引入组件:

  1. <template>
  2. <view class="task-view">
  3. <task-list :list="taskList"></task-list>
  4. </view>
  5. </template>

  1. <script setup>
  2. import { ref, getCurrentInstance } from 'vue';
  3. import {
  4. onLoad,
  5. onShow
  6. } from "@dcloudio/uni-app";
  7. let { proxy } = getCurrentInstance();
  8. const taskList = ref([])

可以看到上面有个变量 taskList,结果和 components 中的 task-list 组件冲突了,给我找了老半天才发现问题,把 taskList 变量改成其他名字就行了,记录一下,犯了低级错误。【北屋有雨】

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/天景科技苑/article/detail/803963
推荐阅读
相关标签
  

闽ICP备14008679号