Skip to content
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

动态修改 xy-input 组件的 min 属性不生效 #30

Open
WangShuXian6 opened this issue Aug 1, 2019 · 1 comment
Open

动态修改 xy-input 组件的 min 属性不生效 #30

WangShuXian6 opened this issue Aug 1, 2019 · 1 comment

Comments

@WangShuXian6
Copy link

WangShuXian6 commented Aug 1, 2019

错误描述

<xy-input name="totalNumber" label="" required errordir="right" errortips="请输入" 
               type="number" min="10" step="1"></xy-input>

input.setAttribute('min', 10)

查看 xy-input 的 dom min 属性已经修改,但是输入小于10的数字不会验证失败

期望

由于 xy-input 的 min 属性可能由父组件初始化,会在父组件挂载的时候更新自己的 min 属性
可以动态修改 xy-input 的 min 属性

替代方案

暂时通过重新插入新的 完整 xy-input 标签解决


版本 1.3.2

@XboxYan
Copy link
Owner

XboxYan commented Aug 5, 2019

部分不常修改属性暂时没有设计成动态修改。

attributeChangedCallback中添加监听即可。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants