赞
踩
一般情况下uniapp vue2 是可以自动引入的:
然后我在index.vue 文件中这样引入组件:
- <template>
- <view class="task-view">
- <task-list :list="taskList"></task-list>
- </view>
- </template>
-
- <script setup>
- import { ref, getCurrentInstance } from 'vue';
- import {
- onLoad,
- onShow
- } from "@dcloudio/uni-app";
-
- let { proxy } = getCurrentInstance();
-
- const taskList = ref([])
可以看到上面有个变量 taskList,结果和 components 中的 task-list 组件冲突了,给我找了老半天才发现问题,把 taskList 变量改成其他名字就行了,记录一下,犯了低级错误。【北屋有雨】
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。