摘要:vue3: autocomplete="new-password":readonly="readonly"@blur="readonly = true"@click="readonly = false" 参考自:https://blog.csdn.net/qq_40572419/article/de
阅读全文
摘要:直接使用第三方库:https://github.com/Maronato/vue-toastification 1.npm install --save vue-toastification@next2.在main.js导入和使用 import Toast from "vue-toastificat
阅读全文
摘要:参考官方文档:https://router.vuejs.org/zh/guide/essentials/dynamic-matching.html#%E5%93%8D%E5%BA%94%E8%B7%AF%E7%94%B1%E5%8F%82%E6%95%B0%E7%9A%84%E5%8F%98%E5%
阅读全文
摘要:mouseWheel: true 改为true click:true
阅读全文
摘要:img标签可设置 object-fit:属性 contain 会将所有包含进去缩放显示,此时注意设置width,height =100% cover 会自适应裁剪 想事项等比例缩放适应宽高,则参考文章:https://blog.csdn.net/IT_lukaifang/article/detail
阅读全文
摘要:在vue2中,直接 Vue.prototype.$bus = new Vue() 但是在vue3中,方法改变了(因为$on方法的废弃,需要用到mitt) const app = createApp(App) app.config.globalProperties.$bus = new mitt();
阅读全文
摘要:Extraneous non-emits event listeners (swiperimageload) were passed to component but could not be automatically inherited because component renders fra
阅读全文
摘要:props是在开发时,预先设置好,传给组件的。在运行过程中,这些设置是一锤子买卖,以后就不起作用了。假如我们想调用该组件的一个方法,而该方法又依赖于props,问题就出来了:props是旧的。 在组件内部,应该依赖于data,而data的初始值来自于props 当前data 想从props 进行初始
阅读全文
摘要:NaN 是一种数据类型,表明为 不是数字的类型 常出现在 使用Number(),parseInt() 转换为数字中,当不是数字时,则返回NaN 在实际应用中 需要判断能否转换成功,无法使用。xx NaN 的方式,因为都是返回false js提供了一个方法:isNaN
阅读全文
摘要:在vue文件中的style标签上,有一个特殊的属性:scoped。当一个style标签拥有scoped属性时,它的CSS样式就只能作用于当前的组件,也就是说,该样式只能适用于当前组件元素。通过该属性,可以使得组件之间的样式不互相污染。如果一个项目中的所有style标签全部加上了scoped,相当于实
阅读全文
摘要:display: flex;justify-content: center;align-items: center;
阅读全文
摘要:git remote rm origin -- 删除远程仓库 remote add origin 仓库地址 -- 新增远程仓库 git commit -m 'update' --提交 git push -u origin master -- push到远程仓库
阅读全文
摘要:在新版本的vue中使用的是和package.json同级别路径中的vue.config.js module.exports = { devServer: { proxy: 'https://api.xxx.com/v1' }} 转载自:https://blog.csdn.net/lpwmm/arti
阅读全文
摘要:同步请求使用:mutations mutations: { increment(state){ state.counter++ }, incrementcounter(state,count){ state.counter+=count }, addper(state,student){ state
阅读全文
摘要:在vue 2.x中 <template> <div class="tab-bar-item" @click="btnclick"> <div><slot name="item1"></slot></div> <div><slot name="item2"></slot></div> </div></
阅读全文
摘要:在vue-router 3.x中,router-link标签中会被渲染为a标签,实际应用中,有可能需要将a标签改为其它标签 可以使用tag="button"这种方式, 但是在vue-router 4.x中,移除了tag,为了实现这样的效果, <router-link to="/home" custo
阅读全文
摘要:在使用webpack编译vue 时,需要在npm 安装 vue-template-compiler和vue-loader,此时出现过这样的问题 之前未注意安装顺序,都安装成功了,但是编译时,提示保存 TypeError: compiler.parseComponent is not a functi
阅读全文