vue
文章平均质量分 51
学后端的小萝卜头
全网最全java笔记,全网最全mysql笔记,0基础和大家一起学后端,记录学后端的过程和笔记,跟着我学后端。。。
展开
-
You should not mix ‘v-for‘ with ‘v-if【eslint-plugin-vue】
[vue/no-use-v-if-with-v-for]错误信息: “The ‘banner’ variable inside ‘v-for’ directive should be replaced with a computed property that returns filtered array instead. You should not mix ‘v-for’ with ‘v-if’.eslint-plugin-vue”在Vue中使用v-for循环一个数组/对象时,如果再使用v-if,那原创 2021-02-01 16:18:13 · 1450 阅读 · 0 评论 -
this.$route.query和this.$route.params的正确使用
1.this.$route.query的使用(1)、传参数:this.$router.push({ path: '/checkout', query:{ productId:id, }})(2)、获取参数:this.$route.query.productId(3)、在url中形式(url中带参数)http://xxx/#/goodsDetails?productId=150642571432849(原创 2021-02-01 15:32:42 · 24966 阅读 · 1 评论 -
this.$router.push路由跳转页面传参
vue-cli项目中this.$router.push传参的各种方式和接受参数1、必须在router/index.js中配置// An highlighted blockVue.use(Router)export default new Router({routes: [ { path: '/', component: Index, name: 'index', redirect: '/home', children: [原创 2021-01-22 14:36:00 · 1632 阅读 · 0 评论 -
vuex的五大属性和使用方法----包括辅助函数
vuex有五个核心概念:state, getters, mutations, actions, modules。1.state:vuex的基本数据,用来存储变量// state存储基本数据state: { userId: '', }在vue中使用 this.$store.state.userId我们可以通过Vue的Computed获得Vuex的state// An highlighted blockconst store = new Vuex.Store({ state原创 2021-01-22 11:34:02 · 6648 阅读 · 4 评论