<el-form-item prop="tel" class="topform"> <el-input maxlength="11" v-model.number="ReginForm.tel" @focus="blurSearchFor()" @blur="blurSear" :placeholder="placeholder"></el-input> </el-form-item>
data{ return{ placeholder:'请您输入手机号' } }
methods:{ //获取焦点时触发 blurSearchFor(){ console.log(this.placeholder) if(this.placeholder=='请您输入手机号'){ this.placeholder=''; } }, //失去焦点时触发 blurSear(){ this.placeholder='请您输入手机号'; } }