一、vue的实例
let vm = new Vue({
el: '',
data: function() {},
methods: {},
watch: {},
computed: {},
component: {},
template: {},
store: {},
router: function(c) {return c(com)};
});
二、vue的指令
- vue 内置指令(详情地址)。
- vue 自定义指令(详情地址):
(1)注册指令
① 正常写法:
Vue.directive('focus', {
bind: function (el, binding, vnode, oldVnode) {},
inserted: function (el, binding, vnode, oldVnode) {},
update: function (el, binding, vnode, oldVnode) {},
componentUpdated: function (el, binding, vnode, oldVnode) {},
unbind: function (el, binding, vnode, oldVnode) {}
})
② 简便写法:
Vue.directive('color-swatch', function (el, binding, vnode, oldVnode) {
el.style.backgroundColor = binding.value
})
③ 定义私有指令,即局部指令:
new Vue({
el: '#app',
data: {},
methods: {},
directives: {
'focus': {
bind: function (el, binding, vnode, oldVnode) {},
inserted: function (el, binding, vnode, oldVnode) {},
update: function (el, binding, vnode, oldVnode) {},
componentUpdated: function (el, binding, vnode, oldVnode) {},
unbind: function (el, binding, vnode, oldVnode) {}
}
}
});
(2)指令应用:
<input v-focus>
三、vue的动画实现
1.自带动画效果
2.使用animate.css库实现
3.使用钩子函数实现
四、vue的组件
[待完善]
五、vue的路由
[待完善]
六、vue的请求
[待完善]