此篇博客记录自己再写项目是遇到的App.vue显示问题。
问题:查看页面时,发现有8px的margin,看着很不爽,想要去掉这个margin。
修改前:直接上图
解决方式,通过beforeCreate函数设置App.vue中body的样式
export default {
beforeCreate() {
document.querySelector('body').setAttribute('style', 'margin:0;')
},
}
可以明显看出,外边距已经没有了,over。