随笔分类 -  vue3随手记

Vue.use
摘要:Vue.use(plugin: Object|Function) 当plugin是Object时,会找plugin中的install方法(plugin对象中必须提供install方法),再自动传入参数Vue,并执行该install方法 当plugin是Function时,会自动传入参数Vue,并执行 阅读全文

posted @ 2022-09-27 21:42 In-6026 阅读(39) 评论(0) 推荐(0)

TypeError: Cannot read properties of undefined (reading "xxx")报错
摘要:我遇到的情况是请求的数据比较大,数据是一个json对象,层数挺多,之所以会报这个错是因为请求的数据还没到就被调用,用?.可以避免,例子 let a = reactive({ data: {} }) Axios.get(..).then(d => { a.data = d }) d类似这样: { n: 阅读全文

posted @ 2022-04-11 23:31 In-6026 阅读(1285) 评论(0) 推荐(0)

vue3动态改audio的src,改了,但是不生效(不能播放)
摘要:let audioSource = ref('') axios(...).then(res => { audioSource.value = res.data.url }) <audio :src = "audioSource" /> //这样看到的效果:src是改了,但是不能播放 解决方法,用do 阅读全文

posted @ 2022-03-13 17:57 In-6026 阅读(2045) 评论(0) 推荐(0)

选项式——nextTick
摘要:参考: https://blog.csdn.net/weixin_43882226/article/details/123194859?spm=1001.2014.3001.5501 摘要: Vue响应式更新并不是数据变化之后Dom立即发生变化,而是按照一定策略进行更新的 正是因为Vue是异步更新D 阅读全文

posted @ 2022-03-02 22:48 In-6026 阅读(30) 评论(0) 推荐(0)

Vue 引入路径正确的,一直报错: Already included file name ‘××ב differs from file name ‘××ב only in casing.
摘要:查了一圈百度,虽然有人提出了"去掉.vue后缀","重启vscode等方法",但是没有解决我的问题。最后得知vscode插件的问题,写vue2的时候应该用这个插件: vue3用: 而且每次只能用其中一个,另一个要禁用 然后我的问题得到了解决 阅读全文

posted @ 2022-03-02 21:37 In-6026 阅读(1141) 评论(0) 推荐(1)

vue动态绑定图片,找不到图片地址
摘要:html: <ul> <li v-for="(i, index) in imgArray"> <img :src="i.imgs" :alt="index"/> </li> </ul> vue: data: { imgArray: [ {imgs: '../img/01.png'}, //这样是找不 阅读全文

posted @ 2021-03-23 14:30 In-6026 阅读(167) 评论(0) 推荐(0)

导航