20200629 - 前端业务项目的日常记录
程序员文章站
2024-03-25 13:17:40
...
1. 在el-select上绑定点击函数
<el-select v-model="name" @click.native="show=true">
</el-select>
必须加.native才会生效
2. 点击el-select不出现下拉框
<el-select ref="select" v-model="name" @click.native="clickSelect">
clickSelect () {
this.$refs.select.blur()
},
其自带的方法blur()可以使input隐藏下拉框
3. input校验:不允许输入负数
<input v-model="scope.row.number" oninput="value=value.replace(/[^0-9.]/g, '')"/>
Smile and let everyone know that today you’re a lot stronger than you were yesterday.
用微笑告诉世人,今天的你比昨天更加强大。