Bug Type: Component
Environment
- Vue Version:
3.2.47
- Element Plus Version:
2.3.4
- Browser / OS:
chrome Version 113.0.5672.92 (Official Build) (arm64)
- Build Tool:
Vite
Reproduction
Related Component
el-input
Reproduction Link
Element Plus Playground
Steps to reproduce
el-input type 等于 number 时在 chrome 和 safari 表现不一致
What is Expected?
el-input type 等于 number 时在 chrome 和 safari 表现一致
What is actually happening?
el-input type 等于 number 时在 chrome 和 safari 表现不一致
Additional comments
(empty)
6条答案
按热度按时间o2g1uqev1#
这是因为el-input内置的原生input元素,可能你说的是右侧按钮的不同,这跟浏览器自身实现input元素相关,如果你希望统一的样式,可以手动实现右侧按钮和相关特性
k3bvogb12#
type 等于 number safari 浏览器还是可以输入其他内容
nue99wik3#
这也是由于各浏览器对input元素的实现细节不同,这方面或许你可以通过检测input事件来实现
fcipmucu4#
很久远的问题 https://bugzilla.mozilla.org/show_bug.cgi?id=1398528
可以参考这里 https://stackoverflow.com/questions/45096670/input-type-number-not-working-on-ipad
rqcrx0a65#
https://element-plus.run/#eyJBcHAudnVlIjoiPHNjcmlwdCBzZXR1cCBsYW5nPVwidHNcIj5cbmltcG9ydCB7IHJlZiwgdmVyc2lvbiBhcyB2dWVWZXJzaW9uIH0gZnJvbSAndnVlJ1xuaW1wb3J0IHsgdmVyc2lvbiBhcyBFcFZlcnNpb24gfSBmcm9tICdlbGVtZW50LXBsdXMnXG5pbXBvcnQgeyBFbGVtZW50UGx1cyB9IGZyb20gJ0BlbGVtZW50LXBsdXMvaWNvbnMtdnVlJ1xuXG5jb25zdCBtc2cgPSByZWYoKVxuY29uc3Qgb25JbnB1dCA9ICh2KSA9PiB7XG4gIGFsZXJ0KHYucmVwbGFjZSgvW14wLTldL2csICcnKSlcbiAgbXNnLnZhbHVlID0gdi5yZXBsYWNlKC9bXjAtOV0vZywgJycpO1xufVxuPC9zY3JpcHQ+XG5cbjx0ZW1wbGF0ZT5cbiAgPGgxPnt7IG1zZyB9fTwvaDE+XG4gIDxlbC1pbnB1dC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