摘要:
在使用vue init创建脚手架的时候会有如下的选择: Runtime + compiler Runtime only 1、区别一 通过这两种方法创建的脚手架,区别在于main.js(在src文件夹中) 在Vue实例中,runtime-compiler创建的项目中参数是: components和te 阅读全文
posted @ 2020-01-01 20:20
jbw123
阅读(2084)
评论(0)
推荐(0)
摘要:
在TabBarItem.vue文件中 <template> <div class="tab-bar-item" @click=itemClick> <div v-if='!isActive'> <slot name="item-icon"></slot> </div> <div v-else> <s 阅读全文
posted @ 2020-01-01 19:53
jbw123
阅读(650)
评论(0)
推荐(0)
摘要:
一、$route表示当前路由信息对象 表示当前激活的路由的状态信息,包含了当前URL解析得到的信息,还有URL匹配到的路由记录 路由信息对象:即$router会被注入每个组件中,可以利用它进行一些信息的获取 1)$route.path: 字符串,对应当前路由的路径,总是解析为绝对路径:'/foo/b 阅读全文
posted @ 2020-01-01 19:12
jbw123
阅读(550)
评论(0)
推荐(0)
摘要:
在src/components下新建一个文件夹:tabbar 在该文件夹下创建两个vue文件:TabBar.vue和TabBarItem.vue 1、在TabBar.vue文件中:设置tab-bar的样式 <template> <div id="tab-bar"> <slot></slot> </d 阅读全文
posted @ 2020-01-01 18:33
jbw123
阅读(779)
评论(0)
推荐(0)
摘要:
1、改变路由的哈希模式(在路由中会出现#): 在src/router/index.js中 创建路由对象: const routes = [ {path:"",redirect:"/home"}, {path:"/home",component:Home}, {path:"/cart",comspon 阅读全文
posted @ 2020-01-01 17:06
jbw123
阅读(2390)
评论(0)
推荐(0)

浙公网安备 33010602011771号