vue element 返回顶部

vue element 返回顶部

<template>
	<div id="box">我是内容</div>
</template>
<script>
  data(){
    return {}
    },
    methods:{
	    top(){    //box 为最大的父盒子,scrollIntoView为element 方法
	    	box.scrollIntoView()
	    }
    }
</script>

猜你喜欢

转载自blog.csdn.net/weixin_41760500/article/details/105863590
今日推荐