vue-waterfall-easy icon indicating copy to clipboard operation
vue-waterfall-easy copied to clipboard

界面返回时控件回到顶部

Open wzhsh90 opened this issue 6 years ago • 8 comments

A界面跳转到B界面后,再B界面返回时,怎么让瀑布流不回到初始状态

例如:我已经滑动到第10个数据了,点了明细,再返回就回到第1个数据了

wzhsh90 avatar Jul 02 '19 09:07 wzhsh90

你解决了吗?我也是

1131446340aa avatar May 29 '20 13:05 1131446340aa

解决了的

---原始邮件--- 发件人: "1131446340aa"<[email protected]> 发送时间: 2020年5月29日(周五) 晚上9:20 收件人: "lfyfly/vue-waterfall-easy"<[email protected]>; 抄送: "wzhsh90"<[email protected]>;"Author"<[email protected]>; 主题: Re: [lfyfly/vue-waterfall-easy] 界面返回时控件回到顶部 (#83)

你解决了吗?我也是

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

wzhsh90 avatar May 29 '20 15:05 wzhsh90

能说一下怎么解决的吗?

---原始邮件--- 发件人: "wzhsh90"<[email protected]> 发送时间: 2020年5月29日(周五) 晚上11:00 收件人: "lfyfly/vue-waterfall-easy"<[email protected]>; 抄送: "1131446340aa"<[email protected]>;"Comment"<[email protected]>; 主题: Re: [lfyfly/vue-waterfall-easy] 界面返回时控件回到顶部 (#83)

解决了的

---原始邮件--- 发件人: "1131446340aa"<[email protected]&gt; 发送时间: 2020年5月29日(周五) 晚上9:20 收件人: "lfyfly/vue-waterfall-easy"<[email protected]&gt;; 抄送: "wzhsh90"<[email protected]&gt;;"Author"<[email protected]&gt;; 主题: Re: [lfyfly/vue-waterfall-easy] 界面返回时控件回到顶部 (#83)

你解决了吗?我也是

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

1131446340aa avatar May 29 '20 15:05 1131446340aa

activated() { if (this.scroll > 0) { this.getEasyScroll().scrollTo(0, this.scroll); this.scroll = 0; } //重新做一次排列 if (this.players.length >= 1) { let orgCom = this.$refs["waterfall"]; if (orgCom != null) { orgCom.beginIndex = 0; orgCom.waterfall(); } } },mounted() { this.getEasyScroll().addEventListener('scroll', this.handleScroll);

},handleScroll() { this.scroll = this.getEasyScroll().scrollTop; }getEasyScroll() { let item = document.querySelector('.vue-waterfall-easy-scroll'); return item == null ? window : item; } 处理逻辑:自己记录历史滚动位置,然后再调用一次waterfall方法,我也处理这个问题处理了很久。

------------------ 原始邮件 ------------------ 发件人: "notifications"<[email protected]>; 发送时间: 2020年5月29日(星期五) 晚上11:38 收件人: "lfyfly/vue-waterfall-easy"<[email protected]>; 抄送: "@"小万"^^$"<[email protected]>;"Author"<[email protected]>; 主题: Re: [lfyfly/vue-waterfall-easy] 界面返回时控件回到顶部 (#83)

能说一下怎么解决的吗?

---原始邮件--- 发件人: &quot;wzhsh90&quot;<[email protected]&gt; 发送时间: 2020年5月29日(周五) 晚上11:00 收件人: &quot;lfyfly/vue-waterfall-easy&quot;<[email protected]&gt;; 抄送: &quot;1131446340aa&quot;<[email protected]&gt;;&quot;Comment&quot;<[email protected]&gt;; 主题: Re: [lfyfly/vue-waterfall-easy] 界面返回时控件回到顶部 (#83)

解决了的

---原始邮件---
发件人: &quot;1131446340aa&quot;<[email protected]&amp;gt;
发送时间: 2020年5月29日(周五) 晚上9:20
收件人: &quot;lfyfly/vue-waterfall-easy&quot;<[email protected]&amp;gt;;
抄送: &quot;wzhsh90&quot;<[email protected]&amp;gt;;&quot;Author&quot;<[email protected]&amp;gt;;
主题: Re: [lfyfly/vue-waterfall-easy] 界面返回时控件回到顶部 (#83)

你解决了吗?我也是


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
&mdash; You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

wzhsh90 avatar May 31 '20 11:05 wzhsh90

谢谢啊。我第一反应也是监听原位置,但是我试了监听scroll事件不会触发。原来是要调用this.getEasyScroll()啊

---原始邮件--- 发件人: "wzhsh90"<[email protected]> 发送时间: 2020年5月31日(周日) 晚上7:09 收件人: "lfyfly/vue-waterfall-easy"<[email protected]>; 抄送: "1131446340aa"<[email protected]>;"Comment"<[email protected]>; 主题: Re: [lfyfly/vue-waterfall-easy] 界面返回时控件回到顶部 (#83)

activated() { if (this.scroll &gt; 0) { this.getEasyScroll().scrollTo(0, this.scroll); this.scroll = 0; } //重新做一次排列 if (this.players.length &gt;= 1) { let orgCom = this.$refs["waterfall"]; if (orgCom != null) { orgCom.beginIndex = 0; orgCom.waterfall(); } } },mounted() { this.getEasyScroll().addEventListener('scroll', this.handleScroll);

},handleScroll() { this.scroll = this.getEasyScroll().scrollTop; }getEasyScroll() { let item = document.querySelector('.vue-waterfall-easy-scroll'); return item == null ? window : item; } 处理逻辑:自己记录历史滚动位置,然后再调用一次waterfall方法,我也处理这个问题处理了很久。

------------------&nbsp;原始邮件&nbsp;------------------ 发件人:&nbsp;"notifications"<[email protected]&gt;; 发送时间:&nbsp;2020年5月29日(星期五) 晚上11:38 收件人:&nbsp;"lfyfly/vue-waterfall-easy"<[email protected]&gt;; 抄送:&nbsp;"@"小万"^^$"<[email protected]&gt;;"Author"<[email protected]&gt;; 主题:&nbsp;Re: [lfyfly/vue-waterfall-easy] 界面返回时控件回到顶部 (#83)

能说一下怎么解决的吗?

---原始邮件---
发件人: &amp;quot;wzhsh90&amp;quot;<[email protected]&amp;gt;
发送时间: 2020年5月29日(周五) 晚上11:00
收件人: &amp;quot;lfyfly/vue-waterfall-easy&amp;quot;<[email protected]&amp;gt;;
抄送: &amp;quot;1131446340aa&amp;quot;<[email protected]&amp;gt;;&amp;quot;Comment&amp;quot;<[email protected]&amp;gt;;
主题: Re: [lfyfly/vue-waterfall-easy] 界面返回时控件回到顶部 (#83)

解决了的

---原始邮件---
发件人: &amp;quot;1131446340aa&amp;quot;<[email protected]&amp;amp;gt;
发送时间: 2020年5月29日(周五) 晚上9:20
收件人: &amp;quot;lfyfly/vue-waterfall-easy&amp;quot;<[email protected]&amp;amp;gt;;
抄送: &amp;quot;wzhsh90&amp;quot;<[email protected]&amp;amp;gt;;&amp;quot;Author&amp;quot;<[email protected]&amp;amp;gt;;
主题: Re: [lfyfly/vue-waterfall-easy] 界面返回时控件回到顶部 (#83)

你解决了吗?我也是


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
&amp;mdash;
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

1131446340aa avatar May 31 '20 11:05 1131446340aa

我也解决了,谢谢啦。开始监听window事件不会触发,然后就监听你给的dom元素就行

---原始邮件--- 发件人: "wzhsh90"<[email protected]> 发送时间: 2020年5月31日(周日) 晚上7:09 收件人: "lfyfly/vue-waterfall-easy"<[email protected]>; 抄送: "1131446340aa"<[email protected]>;"Comment"<[email protected]>; 主题: Re: [lfyfly/vue-waterfall-easy] 界面返回时控件回到顶部 (#83)

activated() { if (this.scroll &gt; 0) { this.getEasyScroll().scrollTo(0, this.scroll); this.scroll = 0; } //重新做一次排列 if (this.players.length &gt;= 1) { let orgCom = this.$refs["waterfall"]; if (orgCom != null) { orgCom.beginIndex = 0; orgCom.waterfall(); } } },mounted() { this.getEasyScroll().addEventListener('scroll', this.handleScroll);

},handleScroll() { this.scroll = this.getEasyScroll().scrollTop; }getEasyScroll() { let item = document.querySelector('.vue-waterfall-easy-scroll'); return item == null ? window : item; } 处理逻辑:自己记录历史滚动位置,然后再调用一次waterfall方法,我也处理这个问题处理了很久。

------------------&nbsp;原始邮件&nbsp;------------------ 发件人:&nbsp;"notifications"<[email protected]&gt;; 发送时间:&nbsp;2020年5月29日(星期五) 晚上11:38 收件人:&nbsp;"lfyfly/vue-waterfall-easy"<[email protected]&gt;; 抄送:&nbsp;"@"小万"^^$"<[email protected]&gt;;"Author"<[email protected]&gt;; 主题:&nbsp;Re: [lfyfly/vue-waterfall-easy] 界面返回时控件回到顶部 (#83)

能说一下怎么解决的吗?

---原始邮件---
发件人: &amp;quot;wzhsh90&amp;quot;<[email protected]&amp;gt;
发送时间: 2020年5月29日(周五) 晚上11:00
收件人: &amp;quot;lfyfly/vue-waterfall-easy&amp;quot;<[email protected]&amp;gt;;
抄送: &amp;quot;1131446340aa&amp;quot;<[email protected]&amp;gt;;&amp;quot;Comment&amp;quot;<[email protected]&amp;gt;;
主题: Re: [lfyfly/vue-waterfall-easy] 界面返回时控件回到顶部 (#83)

解决了的

---原始邮件---
发件人: &amp;quot;1131446340aa&amp;quot;<[email protected]&amp;amp;gt;
发送时间: 2020年5月29日(周五) 晚上9:20
收件人: &amp;quot;lfyfly/vue-waterfall-easy&amp;quot;<[email protected]&amp;amp;gt;;
抄送: &amp;quot;wzhsh90&amp;quot;<[email protected]&amp;amp;gt;;&amp;quot;Author&amp;quot;<[email protected]&amp;amp;gt;;
主题: Re: [lfyfly/vue-waterfall-easy] 界面返回时控件回到顶部 (#83)

你解决了吗?我也是


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
&amp;mdash;
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

1131446340aa avatar May 31 '20 12:05 1131446340aa

不用谢,这个官方解决的话更好

---原始邮件--- 发件人: "1131446340aa"<[email protected]> 发送时间: 2020年5月31日(周日) 晚上8:01 收件人: "lfyfly/vue-waterfall-easy"<[email protected]>; 抄送: "wzhsh90"<[email protected]>;"Author"<[email protected]>; 主题: Re: [lfyfly/vue-waterfall-easy] 界面返回时控件回到顶部 (#83)

我也解决了,谢谢啦。开始监听window事件不会触发,然后就监听你给的dom元素就行

---原始邮件--- 发件人: "wzhsh90"<[email protected]&gt; 发送时间: 2020年5月31日(周日) 晚上7:09 收件人: "lfyfly/vue-waterfall-easy"<[email protected]&gt;; 抄送: "1131446340aa"<[email protected]&gt;;"Comment"<[email protected]&gt;; 主题: Re: [lfyfly/vue-waterfall-easy] 界面返回时控件回到顶部 (#83)

activated() {
if (this.scroll &amp;gt; 0) {
this.getEasyScroll().scrollTo(0, this.scroll);
this.scroll = 0;
}
//重新做一次排列
if (this.players.length &amp;gt;= 1) {
let orgCom = this.$refs["waterfall"];
if (orgCom != null) {
orgCom.beginIndex = 0;
orgCom.waterfall();
}
}
},mounted() {
this.getEasyScroll().addEventListener('scroll', this.handleScroll);

},handleScroll() {
this.scroll = this.getEasyScroll().scrollTop;
}getEasyScroll() {
let item = document.querySelector('.vue-waterfall-easy-scroll');
return item == null ? window : item;
}
处理逻辑:自己记录历史滚动位置,然后再调用一次waterfall方法,我也处理这个问题处理了很久。

------------------&amp;nbsp;原始邮件&amp;nbsp;------------------
发件人:&amp;nbsp;"notifications"<[email protected]&amp;gt;;
发送时间:&amp;nbsp;2020年5月29日(星期五) 晚上11:38
收件人:&amp;nbsp;"lfyfly/vue-waterfall-easy"<[email protected]&amp;gt;;
抄送:&amp;nbsp;"@"小万"^^$"<[email protected]&amp;gt;;"Author"<[email protected]&amp;gt;;
主题:&amp;nbsp;Re: [lfyfly/vue-waterfall-easy] 界面返回时控件回到顶部 (#83)

能说一下怎么解决的吗?

---原始邮件---
发件人: &amp;amp;quot;wzhsh90&amp;amp;quot;<[email protected]&amp;amp;gt;
发送时间: 2020年5月29日(周五) 晚上11:00
收件人: &amp;amp;quot;lfyfly/vue-waterfall-easy&amp;amp;quot;<[email protected]&amp;amp;gt;;
抄送: &amp;amp;quot;1131446340aa&amp;amp;quot;<[email protected]&amp;amp;gt;;&amp;amp;quot;Comment&amp;amp;quot;<[email protected]&amp;amp;gt;;
主题: Re: [lfyfly/vue-waterfall-easy] 界面返回时控件回到顶部 (#83)

解决了的    
   
   
   
---原始邮件---    
发件人: &amp;amp;amp;quot;1131446340aa&amp;amp;amp;quot;<[email protected]&amp;amp;amp;amp;gt;    
发送时间: 2020年5月29日(周五) 晚上9:20    
收件人: &amp;amp;amp;quot;lfyfly/vue-waterfall-easy&amp;amp;amp;quot;<[email protected]&amp;amp;amp;amp;gt;;    
抄送: &amp;amp;amp;quot;wzhsh90&amp;amp;amp;quot;<[email protected]&amp;amp;amp;amp;gt;;&amp;amp;amp;quot;Author&amp;amp;amp;quot;<[email protected]&amp;amp;amp;amp;gt;;    
主题: Re: [lfyfly/vue-waterfall-easy] 界面返回时控件回到顶部 (#83)    
   
   
   
   
     
你解决了吗?我也是    
     
—    
You are receiving this because you authored the thread.    
Reply to this email directly, view it on GitHub, or unsubscribe.    

&amp;amp;mdash;
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

wzhsh90 avatar May 31 '20 12:05 wzhsh90

不用谢,这个官方解决的话更好

---原始邮件--- 发件人: "1131446340aa"<[email protected]> 发送时间: 2020年5月31日(周日) 晚上8:01 收件人: "lfyfly/vue-waterfall-easy"<[email protected]>; 抄送: "wzhsh90"<[email protected]>;"Author"<[email protected]>; 主题: Re: [lfyfly/vue-waterfall-easy] 界面返回时控件回到顶部 (#83)

我也解决了,谢谢啦。开始监听window事件不会触发,然后就监听你给的dom元素就行

---原始邮件--- 发件人: "wzhsh90"<[email protected]&gt; 发送时间: 2020年5月31日(周日) 晚上7:09 收件人: "lfyfly/vue-waterfall-easy"<[email protected]&gt;; 抄送: "1131446340aa"<[email protected]&gt;;"Comment"<[email protected]&gt;; 主题: Re: [lfyfly/vue-waterfall-easy] 界面返回时控件回到顶部 (#83)

activated() {
if (this.scroll &amp;gt; 0) {
this.getEasyScroll().scrollTo(0, this.scroll);
this.scroll = 0;
}
//重新做一次排列
if (this.players.length &amp;gt;= 1) {
let orgCom = this.$refs["waterfall"];
if (orgCom != null) {
orgCom.beginIndex = 0;
orgCom.waterfall();
}
}
},mounted() {
this.getEasyScroll().addEventListener('scroll', this.handleScroll);

},handleScroll() {
this.scroll = this.getEasyScroll().scrollTop;
}getEasyScroll() {
let item = document.querySelector('.vue-waterfall-easy-scroll');
return item == null ? window : item;
}
处理逻辑:自己记录历史滚动位置,然后再调用一次waterfall方法,我也处理这个问题处理了很久。

------------------&amp;nbsp;原始邮件&amp;nbsp;------------------
发件人:&amp;nbsp;"notifications"<[email protected]&amp;gt;;
发送时间:&amp;nbsp;2020年5月29日(星期五) 晚上11:38
收件人:&amp;nbsp;"lfyfly/vue-waterfall-easy"<[email protected]&amp;gt;;
抄送:&amp;nbsp;"@"小万"^^$"<[email protected]&amp;gt;;"Author"<[email protected]&amp;gt;;
主题:&amp;nbsp;Re: [lfyfly/vue-waterfall-easy] 界面返回时控件回到顶部 (#83)

能说一下怎么解决的吗?

---原始邮件---
发件人: &amp;amp;quot;wzhsh90&amp;amp;quot;<[email protected]&amp;amp;gt;
发送时间: 2020年5月29日(周五) 晚上11:00
收件人: &amp;amp;quot;lfyfly/vue-waterfall-easy&amp;amp;quot;<[email protected]&amp;amp;gt;;
抄送: &amp;amp;quot;1131446340aa&amp;amp;quot;<[email protected]&amp;amp;gt;;&amp;amp;quot;Comment&amp;amp;quot;<[email protected]&amp;amp;gt;;
主题: Re: [lfyfly/vue-waterfall-easy] 界面返回时控件回到顶部 (#83)

解决了的    
   
   
   
---原始邮件---    
发件人: &amp;amp;amp;quot;1131446340aa&amp;amp;amp;quot;<[email protected]&amp;amp;amp;amp;gt;    
发送时间: 2020年5月29日(周五) 晚上9:20    
收件人: &amp;amp;amp;quot;lfyfly/vue-waterfall-easy&amp;amp;amp;quot;<[email protected]&amp;amp;amp;amp;gt;;    
抄送: &amp;amp;amp;quot;wzhsh90&amp;amp;amp;quot;<[email protected]&amp;amp;amp;amp;gt;;&amp;amp;amp;quot;Author&amp;amp;amp;quot;<[email protected]&amp;amp;amp;amp;gt;;    
主题: Re: [lfyfly/vue-waterfall-easy] 界面返回时控件回到顶部 (#83)    
   
   
   
   
     
你解决了吗?我也是    
     
—    
You are receiving this because you authored the thread.    
Reply to this email directly, view it on GitHub, or unsubscribe.    

&amp;amp;mdash;
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

wzhsh90 avatar Feb 03 '21 13:02 wzhsh90