vue 每次渲染完页面后div的滚动条保持在最底部的方法

栏目: 编程语言 · JavaScript · 前端 · 发布时间: 7年前

内容简介:下面小编就为大家分享一篇vue 每次渲染完页面后div的滚动条保持在最底部的方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧

实例如下:

//每次页面渲染完之后滚动条在最底部
updated:function(){
  this.$nextTick(function(){
  var div = document.getElementById('dialogue_box');
  div.scrollTop = div.scrollHeight;
  })
 }
//第一次页面渲染完之后滚动条在最底部
methods:function(){

  this.$nextTick(function(){
  var div = document.getElementById('dialogue_box');
  div.scrollTop = div.scrollHeight;
  })
 }

以上所述就是小编给大家介绍的《vue 每次渲染完页面后div的滚动条保持在最底部的方法》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Introduction to Semi-Supervised Learning

Introduction to Semi-Supervised Learning

Xiaojin Zhu、Andrew B. Goldberg / Morgan and Claypool Publishers / 2009-6-29 / USD 40.00

Semi-supervised learning is a learning paradigm concerned with the study of how computers and natural systems such as humans learn in the presence of both labeled and unlabeled data. Traditionally, le......一起来看看 《Introduction to Semi-Supervised Learning》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

URL 编码/解码
URL 编码/解码

URL 编码/解码

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具