-
Notifications
You must be signed in to change notification settings - Fork 771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
basic Dialog lock-scroll #308
Comments
如果直接引用组件,请手动将preventScroll置为true。 |
@supergaojian 参考element-ui vant 等vue UI库 Dailog lockScroll 都是默认true, 所以在文档没有体现lock-scroll属性大部分默认为true,况且我不清楚默认为false的优势在哪里? |
首先,单例和组件两种使用方式面向的是两种场景,前者用于约定场景,因此可控制基本行为,就像是锁定滚动。而后者用于复杂的自定义场景,这种场景下不做任何行为预设,保持底层组件的默认行为,由用户自定义。前者本就是后者的特殊使用方式,即预设部分属性,故不存在一致性问题。 其次,prevent-scroll设为true后还需设置prevent-scroll-exclude,否则无法触发任何touchmove事件,这样会给第二种场景带来很大的复杂度。 Ps: 在2.x中prevent-scroll不再被建议使用。 |
@xxyan0205 实际情况是,在极大部分的业务场景,是不需要dialog scroll, 我理解的默认值是指它默认那种场景最被频繁使用的,大多数组件都是这样去设置的,然道不是吗?只有特殊情况,在去设置具体值,以避免漏写相关属性导致的问题。 |
应该是极大部分业务场景不需要滚动穿透,但内部滚动还是需要的。如果连内部滚动都不需要的话,我们会建议直接使用单例模式。 |
@xxyan0205 我理解错了prevent-scroll 的含义 ,我需要的是一个lock-scroll默认为true的Dialog |
单纯的要屏蔽滚动穿透的话,目前只有在dialog内部嵌套scrollview,其他的方式目前都无法真正的屏蔽滚动穿透 |
只能重写Dialog单例了吗 |
Mand Mobile Version
OS Version & Browser Version
Node Version, Package Management Tool
Recurring Links
Recurring Steps
Expectant Behaviors
#286
Actual Behaviors
Dialog 组件的 preventScroll 默认为 false 只有Dialog单例模式默认为 true
The text was updated successfully, but these errors were encountered: