el-input
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
[[Vue]]
&color(red){※前提条件:本文基于 Vue 2.0 创作};
#contents
* 输入限制 [#h794d2c3]
只可以输入数值
#codeprettify{{
<el-input v-model.number="form.age"/>
或者
<el-input
v-model="form.age"
oninput="value=value.replace(/[^\d]/g,'')"
/>
}}
对输入的字符串去掉前后空格
#codeprettify{{
<el-input v-model.trim="xxxx">
}}
* 动态Style [#ef8a0df2]
html
#codeprettify{{
<el-table-column prop="note" label="备注">
<template slot-scope="scope">
<el-input
type="textarea"
:autosize="{ minRows: 1, maxRows: 5 }"
placeholder="无"
v-model="scope.row.note"
:class="textareaNote"
readonly
>
</el-input>
</template>
</el-table-column>
}}
javascript
#codeprettify{{
data(){
return {
textareaNote:'textareaNote',
}
}
}}
css
#codeprettify{{
<style>
.textareaNote > textarea {
border: none !important;
font-size: 12;
font-family: 'Microsoft YaHei';
}
</style>
}}
* 监听是否有修改 [#hbf09978]
使用 input 事件
#codeprettify{{
<el-input v-model="scope.row.number" @input="handlerNgcou...
}}
#hr();
コメント:
#comment_kcaptcha
終了行:
[[Vue]]
&color(red){※前提条件:本文基于 Vue 2.0 创作};
#contents
* 输入限制 [#h794d2c3]
只可以输入数值
#codeprettify{{
<el-input v-model.number="form.age"/>
或者
<el-input
v-model="form.age"
oninput="value=value.replace(/[^\d]/g,'')"
/>
}}
对输入的字符串去掉前后空格
#codeprettify{{
<el-input v-model.trim="xxxx">
}}
* 动态Style [#ef8a0df2]
html
#codeprettify{{
<el-table-column prop="note" label="备注">
<template slot-scope="scope">
<el-input
type="textarea"
:autosize="{ minRows: 1, maxRows: 5 }"
placeholder="无"
v-model="scope.row.note"
:class="textareaNote"
readonly
>
</el-input>
</template>
</el-table-column>
}}
javascript
#codeprettify{{
data(){
return {
textareaNote:'textareaNote',
}
}
}}
css
#codeprettify{{
<style>
.textareaNote > textarea {
border: none !important;
font-size: 12;
font-family: 'Microsoft YaHei';
}
</style>
}}
* 监听是否有修改 [#hbf09978]
使用 input 事件
#codeprettify{{
<el-input v-model="scope.row.number" @input="handlerNgcou...
}}
#hr();
コメント:
#comment_kcaptcha
ページ名: