uview1.x关于u-message-input组件文档的踩的坑 Skip to end of metadata

63 阅读1分钟

因项目需要,需使用验证码的输入组件,正好uview有提供

u-message-input

image.png

根据文档的例子,在页面写了如下的代码:

<u-message-input
  maxlength="6"
  :dot-fill="true"
  :focus="true"
  active-color="#aaa"
  inactive-color="#ccc"
/>

但页面呈现的结果却不是6个盒子

image.png

对比文档给的例子,所以并没有怀疑maxlength的问题,而且参数表也明说了可以使用数字或字符串类型

image.png

最后发现,maxlength必须得用数字类型的才可以:

<u-message-input
  :maxlength="6"
  :dot-fill="true"
  :focus="true"
  active-color="#aaa"
  inactive-color="#ccc"
/>

image.png