.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-8
.col-md-4
.col-md-4
.col-md-4
.col-md-4
.col-md-6
.col-md-6
'use strict'
//http://vuejs.org.cn/guide/custom-directive.html
Vue.directive('resize', {
bind: function () {
this.handler = function () {
var width = this.el.offsetWidth
if (this.width === width) {
}
else {
console.log(this.width, width)
this.width = width
this.vm.$get(this.expression)
}
}.bind(this)
window.addEventListener('resize', this.handler)
},
update: function (newValue, oldValue) {
},
unbind: function () {
window.removeEventListener('resize', this.handler)
}
})
var vm = new Vue({
el: '#demo',
methods: {
changed() {
console.log('resize')
},
}
})