<script>
export default {
beforeCreate: function() {
document.getElementsByTagName("body")[0].className="bgColor";
},
beforeDestroy: function() {
document.body.removeAttribute("class","bgColor");
}
}
</script>
然后给’‘bgColor’'添加对应的背景颜色就ok了
网友评论