今天看代码看到了一个自己没有用过的
export default {
data() {
return {
//下拉浮动标志的显示控制
showFlag: true
};
},
methods: {
//点击事件 实现点击浮动下拉图标,平滑滑动到主页开头部分(也是侧边栏的头)
moveToHome() {
//目标元素距离页面顶部的距离,在这里是恒定值
let total = document.getElementById("blog_main").offsetTop;
move(total);
}
},
created() {
//定时器
const timer = setInterval(() => {
this.showFlag = !this.showFlag;
}, 1000);
this.$once("hook:beforeDestroy", () => {
clearInterval(timer);
});
},
mounted() {},
components: {
Typer
}
};
export default {
data() {