vue-router
-
返回上级页面
- this.$router.go(-1)
-
Vue 项目子路由 不继承父元素路由
-
Vue 给组件绑定的事件为什么无法触发
- 在 Vue 2.0 中,为自定义组件绑定原生事件必须使用 .native 修饰符
-
vue-router 传参方法
-
缓存部分页面
<keep-alive>
<router-view v-if="$route.meta.keepAlive"></router-view>
</keep-alive>
<router-view v-if="!$route.meta.keepAlive"></router-view>
routes: [
{
path: '/data',
name: 'Data',
component: Data,
children: [
{
path: '/data/show',
name: 'ShowData',
component: ShowData,
meta: { keepAlive: true },
},
{
path: '/data/detail',
name: 'Detail',
component: Detail,
meta: { keepAlive: false },
},
]
},
]
Vue watch
- Vue 事件监听
Vuex
-
在组件内 应用 Vuex 中的属性
- import { mapState } from ‘vuex’
- computed: {
…mapState([‘flag’])
},
-
在组件中 调用 Vuex 的方法
- this.$store.commit(‘方法名’, 参数)
动画特效
实用知识的
-
stylus 中使用媒体查询
-
vue dom 绑定多个事件
- <button type=“button” @click=“a();b()”>vue按钮