Giter Club home page Giter Club logo

Comments (20)

BearJ avatar BearJ commented on May 14, 2024 1

@baiyapeng 那么我们建议你再次调用picker的时候,传入一个随机的id(例子参考文档)。因为同一个id是会有缓存的。

from weui.js.

progrape avatar progrape commented on May 14, 2024

@baiyapeng 你好,我们自测是有效的,可否提供一下调用代码?

from weui.js.

baiyapeng avatar baiyapeng commented on May 14, 2024

谢谢回复~
知道问题所在了,确实跟是否压缩无关,抱歉。
———————————————————————————————————————————————
我的picker实例再次打开时会记住上次关闭时选中项的位置,但是由于我的数据源是动态变化的,所以希望当数据源变化时,组件能监听到并自动切回默认项(如第一项)或者打开时“我”手动切回默认项(需要提供可用API)。
希望关注下,再次感谢!

from weui.js.

progrape avatar progrape commented on May 14, 2024

好的,我们考虑一些这个问题~

from weui.js.

baiyapeng avatar baiyapeng commented on May 14, 2024

@BearJ 明白了,谢谢~

from weui.js.

sushuier avatar sushuier commented on May 14, 2024

传入随机ID 的确可以解决缓存的问题,那么能不能改善呢,每次触发datePicker的时候 重新获取defalutValue 行不行呢,这样 在用的时候,每次 自己存需要的defaultValue

from weui.js.

BearJ avatar BearJ commented on May 14, 2024

@sushuier 这样会有个问题就是:用户选择完了,比如是选2017-01-02,然后用户想再次选择,那么如果我们重新获取了defaultValue,那么第二次打开picker的时候就不是之前用户所选的2017-01-02了,这样用户会懵的~~ T_T

from weui.js.

sushuier avatar sushuier commented on May 14, 2024

我是这样想的: 用 input的click触发 datePicker 每次click的时候 取当前input的date作为defaultValue,然后传入 weui.datePicker, 起初我这么办的时候有缓存,所以只能传入随机id,因为我有其他改变日期的按钮,前一天按钮和后一天按钮,我在外部强行改变了界面input的日期,当触发picker的时候 必须把其他方法改变的日期传进weui picker 才会想到这个 每次都重新取值的方案

from weui.js.

BearJ avatar BearJ commented on May 14, 2024

@sushuier 你那种也是一种情况,所以我们就提供了个id的选项来避免缓存。性能是一样的,因为都是需要构造dom,只是取哪个做初始值的问题。毕竟picker的值被额外因素影响的可能不多,所以我们还是取id的缓存为初始值。

from weui.js.

sushuier avatar sushuier commented on May 14, 2024

@BearJ OK的 ,3Q 挺好,看到你们解决了 那个 result取 label和 value的 问题 我很开心,这个 就比较方便了

from weui.js.

BearJ avatar BearJ commented on May 14, 2024

^_^

from weui.js.

sushuier avatar sushuier commented on May 14, 2024

@BearJ 我有个问题想请教,这个问题很久了,没有找到合适的解决办法。 就是ios上的input框获取焦点时,整个页面会向上滚动,会导致头部被滚到上面去了,ios上的input框 如何能像原生app上的input获取焦点,软键盘弹出时,不让页面整体上滚,只让这个input 框scrollIntoView 呢,你们有没有遇到过这个问题

from weui.js.

BearJ avatar BearJ commented on May 14, 2024

@sushuier 当input聚焦时,如果在非键盘区**的下方,会往上滚(却不会往下滚)。估计目的是为了用户体验。目前也没有什么好的解决方法,这是stackoverflow的,你可以参考一下:http://stackoverflow.com/questions/37287148/ios-safari-chrome-unwanted-scrolling-when-focusing-an-input-inside-the-modal

from weui.js.

sushuier avatar sushuier commented on May 14, 2024

@BearJ 好的 3Q,我想问下 你们是 微信团队的吗,很强大啊

from weui.js.

BearJ avatar BearJ commented on May 14, 2024

@sushuier 是的哈 ^_^

from weui.js.

sushuier avatar sushuier commented on May 14, 2024

@BearJ 请原谅我提一个无力想法: 你们能封装一个 类似于 掌上英雄联盟app的 那种上拉加载 下拉更新的这种组件不,这个功能很常见,但是 我一直没有找到合适的,大都不太好用,weui.js封装的十分平民化,有时间给加一个吧

from weui.js.

BearJ avatar BearJ commented on May 14, 2024

@sushuier 看看这个:https://www.boxfactura.com/pulltorefresh.js/

from weui.js.

sushuier avatar sushuier commented on May 14, 2024

@BearJ 好的,改日研究一下

from weui.js.

refanbanzhang avatar refanbanzhang commented on May 14, 2024

挖,这个id缓存的方式真的是很棒啊,初始默认给一个id,需要重置,就去修改这个id就行了,大爱

from weui.js.

refanbanzhang avatar refanbanzhang commented on May 14, 2024

大佬分享的插件真的太棒了,还有其他分享吗?

from weui.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.