airyland / airyland/vux

[Bug Report] View-box的scrollTo方法不起作用

未關閉
#3,180 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Vue
星號
17.5k
分支
3.6k
PR 合併指標
30 天內沒有已合併 PR

描述

### VUX version
2.9.2

### OS/Browsers version
任何系统

### Vue version
2.5.17

### Code

```html






```

```js
watch: {
remarkLoading() {
if (!this.remarkLoading) {
if (this.showRemarks$.length > 0) {
this.$refs.viewBox && this.$nextTick(() => {
console.log('滚动到', this.$refs.viewBox.getScrollBody().scrollHeight);
let _tmp = setTimeout(() =>{
this.$refs.viewBox.scrollTo(this.$refs.viewBox.getScrollBody().scrollHeight);
console.log('实际滚动到了', this.$refs.viewBox.getScrollTop());
}, 500);
          });
} else {
this.$refs.viewBox && this.$nextTick(() => {
console.log('滚动到', 0);
let _tmp = setTimeout(() =>{
this.$refs.viewBox.scrollTo(0);
console.log('实际滚动到了', this.$refs.viewBox.getScrollTop());
}, 500);
});
}
}
}
},
```

### Steps to reproduce
-> 进入页面
-> fetch数据
-> 将remarkLoading赋值为false
-> 查看页面用于viewBox内部的v-for渲染的showRemarks$是否为空

### What is Expected?
-> showRemarks$为空则跳转到顶部
-> showRemarks$不为空则跳转到页面底部

### What is actually happening?
-> 上述scrollTo均未生效

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。