在
beforeCreate
中用js添加样式
在beforDestory钩子中用js移除样式
beforeCreate: function() {
document.getElementsByTagName("body")[0].className="active";
},
beforeDestroy: function() { document.body.removeAttribute("class","active"); }
在
beforeCreate
中用js添加样式
在beforDestory钩子中用js移除样式
beforeCreate: function() {
document.getElementsByTagName("body")[0].className="active";
},
beforeDestroy: function() { document.body.removeAttribute("class","active"); }
转载于:https://www.cnblogs.com/xiao-911/p/11088384.html