Skip to content

vue-the-mask and element ui input slot 2 value error #174

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

Open
anson-GH opened this issue Jun 9, 2021 · 2 comments
Open

vue-the-mask and element ui input slot 2 value error #174

anson-GH opened this issue Jun 9, 2021 · 2 comments

Comments

@anson-GH
Copy link

anson-GH commented Jun 9, 2021

anyone have the solution for below case ?
<el-input v-model="contactNo" v-mask="'## ### #####'" masked="true" /> // this is valid
I got the error, because v-mask directive requires 1 input, found 2

  <el-input placeholder="enter phone number" v-model="contactNo" class="input-with-select"> 
    <el-select v-model="select" slot="prepend" placeholder="select">
      <el-option label="restaurant phone" value="1"></el-option>
      <el-option label="order phone" value="2"></el-option>
      <el-option label="personal phone" value="3"></el-option>
    </el-select>

Please help

@anson-GH anson-GH changed the title vue-the-mask and element ui input slot vue-the-mask and element ui input slot 2 value error Jun 9, 2021
@ytlibin
Copy link

ytlibin commented Jun 12, 2025

解决了吗 我也遇到了同样的问题

@anson-GH
Copy link
Author

anson-GH commented Jun 12, 2025

没用了,自己手动改成自己的format

 <el-input id="phone-input" v-model="ruleForm.contactNo"></el-input>

  watch: {
    'ruleForm.contactNo': function(newV, oldV) {
      if (newV !== oldV) {
        this.ruleForm.contactNo = phoneNumberFormat(newV)
      }
    }
  },

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

2 participants