封装addClass
addClassFun: function (ele, classes) {
var self = this;
var el = self.$el;
ele.forEach(function (element) {
if (el.find(element).hasClass(classes)) {
return
} else {
el.find(element).addClass(classes)
}
})
},
调用
this.addClassFun([‘.inside’, ‘.clinet>li’, ‘.rcurrent’], ‘color_3’)