Skip to content

1.5.5版本a-input组件v-model绑定computed数据异常 #2225

@xing1994

Description

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

Version

1.5.5

Environment

mac10.14.4、谷歌79.0.3945.88、2.6.10

Reproduction link

http://ant-design-vue

Steps to reproduce

<template>
  <a-input v-model="UserName"></a-input>
</template>
<script>
export default {
  data () {
    return { username: '' }
  },
  computed: {
    UserName: {
      get () { return this.username },
      set (val) { this.username = val.replace(/[^0-9a-zA-Z]/g) }
    }
  }
}
</script>

上述代码在运行的时候 输入框 可以输入并显示 中文等非正则要求字符

What is expected?

上述代码a-input不能显示中文。在1.4.5是正常的,但我升级到1.5.5就失效了。

What is actually happening?

上述代码显示了中文,

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions