Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
383 views
in Technique[技术] by (71.8m points)

vue.js中的.trm疑问,希望有仙人指点迷津

v-model.trim的形式可以用户输入的首尾空格,但是发现加不加没什么区别啊?是怎么回事?
<div id="trim">

<input v-model.trim="msg">
<span style="background:red">{{msg}}</span>

</div>

var app429 = new Vue({
    el:'#trim',
    data:{
        msg:'年龄'
    }
});

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

输入时判断不了,输入的时候你怎么知道现在输入的是中间的还是末尾的


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...