摘要: 1.在home.js中设置url var home = { searchByVender:'/index/search', //首页搜索-商家和商品列表} 2.引入home.js import home from "@/common/api/home" 3.在data中定义关键字和搜索返回的商品列表 阅读全文
posted @ 2020-07-08 23:06 栗子米 阅读(13875) 评论(0) 推荐(0) 编辑
摘要: 方法一: 1.给元素绑定点击监听 @click="goToPage" 2.在methods中写路由跳转函数 goToPage(){ this.$router.push('/test/index');}, 方法二: 给需要页面跳转的button加上router-link <router-link to 阅读全文
posted @ 2020-07-08 16:41 栗子米 阅读(493) 评论(0) 推荐(0) 编辑
摘要: 1.在src文件夹下新建页面文件夹 2.在页面文件夹中新建index.vue 3.在router中配置路由 import index from "@/components/text/index"; { path: '/text/index', name: 'index', component: in 阅读全文
posted @ 2020-07-08 16:20 栗子米 阅读(6567) 评论(0) 推荐(0) 编辑
摘要: 1.安装vuex 并在main.js中引用 2.新建store.js文件 3.在 state 中定义需要保存的状态 test:[] 4.在mutations中写保存记录的函数 只有 mutation 能动 State,mutations里面是一个一个的方法,参数第一个就是state 参数最好是一个对 阅读全文
posted @ 2020-07-08 00:25 栗子米 阅读(616) 评论(0) 推荐(0) 编辑