mickeyort 发表于 2022-6-29 15:16:44

el-scrollbar使用以及滚动到指定的位置

浏览器默认的滚动条不太美观而且在ie下不能调整样式,在element-ui中有个隐藏的组件,在官网上是没有对应的api的,那就是<el-scrollbar>,这个组件的滚动条比原生的还是好看些的

props: {
native: Boolean,
wrapStyle: {}, // 外层盒子的样式
wrapClass: {}, // 外层盒子的class
viewClass: {}, // 内层盒子的class
viewStyle: {}, // 内层盒子的样式
noresize: Boolean, // 如果 container 尺寸不会发生变化,最好设置它可以优化性能
tag: {
    type: String,
    default: 'div'
}
}

实践定位 : VUE3        在DISCUZ中

this.$refs.map_main.wrap$.scrollTop = this.map_y;//this.map_y=坐标值
this.$refs.map_main.wrap$.scrollLeft = this.map_x;
DZ写法
this.{$_TRC}refs.map_main.wrap{$_TRC}.scrollTop = this.map_y;
this.{$_TRC}refs.map_main.wrap{$_TRC}.scrollLeft = this.map_x;

页: [1]
查看完整版本: el-scrollbar使用以及滚动到指定的位置