Vant: [Bug Report] van-field 设置error为false,输入内容或placeholder依然标红

Created on 26 May 2020  ·  3Comments  ·  Source: youzan/vant

设备 / 浏览器

win 10/chrome 83

Vant 版本

2.5.8

Vue 版本

2.6.10

重现链接

https://codesandbox.io/s/vant-issue-moban-h85gu?file=/src/form.vue

描述问题

van-field 设置error为false,输入内容或placeholder依然标红

  <van-field
      v-model="username"
      name="用户名"
      label="用户名"
      placeholder="用户名"
      required
      :error="false"
      :rules="[{ required: true, message: '请填写用户名' }]"
    />

image

🐞 bug

Most helpful comment

嗯,是这个意思。已经在 2.8.4 版本调整

All 3 comments

目前在 Form 内不支持禁用单个 Field 的 error 提示,可以通过 Form 的 show-error 属性禁用所有 Field 的 error 提示。

下个版本会调整下,支持禁用单个 Field 的 error 提示

@chenjiahan 我们不是希望禁用rules的校验提示信息,是希望输入内容和placeholder不要标红

嗯,是这个意思。已经在 2.8.4 版本调整

Was this page helpful?
0 / 5 - 0 ratings