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

XInput组件v-model=0时的清除按钮消失bug #2482

Closed
chenshuhong opened this issue Feb 7, 2018 · 0 comments
Closed

XInput组件v-model=0时的清除按钮消失bug #2482

chenshuhong opened this issue Feb 7, 2018 · 0 comments

Comments

@chenshuhong
Copy link

version: 2.7.9

<x-input
    v-model="zeroNumber"
    title="穿入数字为0"
    placeholder-align="right"
    text-align="right"></x-input>

我这样使用xinput,初始值为0,发现清除按钮不见了,如下图,上面为初始为非0,就有清除按钮
zero
目前我是这样解决的,修改xinput源码,在watch里修改currentValue为字符串‘0’

watch: {
      ...
      currentValue (newVal) {
        if (newVal === 0){
          this.currentValue = '0'
          return
        }
        if (!this.equalWith && newVal) {
          this.validateEqual()
        }
       ...
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant