vue3.0项目迁移后,swiper.vue组件里报错

来源:2-5 【讨论题】你所知道的常用设计模式有哪些?

刘大大美

2021-04-22

图片描述
Uncaught (in promise) TypeError: Cannot read property ‘length’ of undefined
at eval (Swiper.vue?807e:24)
at ComputedRefImpl.reactiveEffect [as effect] (reactivity.esm-bundler.js?a1e9:42)
at ComputedRefImpl.get value [as value] (reactivity.esm-bundler.js?a1e9:861)
at unref (reactivity.esm-bundler.js?a1e9:775)
at Object.get (reactivity.esm-bundler.js?a1e9:778)
at Proxy.eval (Swiper.vue?807e:2)
at renderComponentRoot (runtime-core.esm-bundler.js?5c40:846)
at componentEffect (runtime-core.esm-bundler.js?5c40:4280)
at reactiveEffect (reactivity.esm-bundler.js?a1e9:42)
at effect (reactivity.esm-bundler.js?a1e9:17)

写回答

2回答

刘大大美

提问者

2021-04-25

老师,这是vue3.0的语法吗

0
1
Dell
optional chaining 自己查一下
2021-04-25
共1条回复

Dell

2021-04-24

this.list?.length, 这么写

0
0

Vue2.5-2.6-3.0开发去哪儿网App 零基础入门到实战

课程紧跟Vue3版本迭代,企业主流版本Vue2+Vue3全掌握

10705 学习 · 8203 问题

查看课程