this.$nextTick(() => {
const bodyStyle = document.body.style; // 获取body样式
bodyStyle.overflow = 'hidden'; // 设置溢出内容为隐藏
const htmlStyle = document.getElementsByTagName('html')[0].style; // 获取html样式
htmlStyle.overflow = 'hidden'; // 设置溢出内容为隐藏
});
vue通过created设置overflow为hidden
最新推荐文章于 2024-03-18 14:56:09 发布