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

input组件的spellcheck属性设置问题 #1707

Closed
1 task
mkanako opened this issue Jan 11, 2020 · 3 comments
Closed
1 task

input组件的spellcheck属性设置问题 #1707

mkanako opened this issue Jan 11, 2020 · 3 comments
Labels

Comments

@mkanako
Copy link

mkanako commented Jan 11, 2020

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.4.10

Environment

Chrome79

Reproduction link

https://www.antdv.com/components/input-cn/

Steps to reproduce

我看https://github.com/vueComponent/ant-design-vue/blob/master/components/input/inputProps.js 定义了spellcheck

但是<a-input :spell-check="false">渲染出来结果是<input />并没有spellcheck,预期应该是<input spellcheck="false" />

只有<a-input :spell-check="true">才能渲染<input spellcheck="true" />这个预期结果

<a-input spellcheck="false">或者<a-input :spellcheck="false">这样可以渲染出<input spellcheck="false" />

但控制台会有警告:Prop "spellcheck" is passed to component , but the declared prop name is "spellCheck". Note that HTML attributes are case-insensitive and camelCased props need to use their kebab-case equivalents when using in-DOM templates. You should probably use "spell-check" instead of "spellCheck"

What is expected?

spellcheck属性设置false/true都能符合预期

What is actually happening?

:spell-check="false"的时候不符合预期

@wangxueliang
Copy link
Member

@mkanako
Copy link
Author

mkanako commented Jan 12, 2020

@wangxueliang
问题好像不在这啊,a-input定义了spellCheck,那么我在单文件模板中
<a-input :spellCheck="false" /><a-input :spell-check="false" />这两种写法是等价的都是把值传给spellCheck这个prop,可是值为false的时候并未渲染出预期结果

无奈,于是我忽略这个prop,直接<a-input spellcheck="false" />这样把spellcheck作为attr传给组件,是渲染出结果了,可控制台有警告

[Vue tip]: Prop "spellcheck" is passed to component , but the declared prop name is "spellCheck". Note that HTML attributes are case-insensitive and camelCased props need to use their kebab-case equivalents when using in-DOM templates. You should probably use "spell-check" instead of "spellCheck".

看着一堆警告,有点烦

对其他组件这样例如<a-row spellcheck="false" />没有警告,能符合预期结果

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants