Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
Koma 4ec0f0378f | 6 years ago | |
---|---|---|
.. | ||
README.md | 6 years ago | |
index.html | 7 years ago |
用户输入内容时不做绑定数据的更新处理,在控件的onchange事件中更新绑定的变量。
用户名:<input v-model.lazy="username">
将用户输入的内容转换为数值类型,如果用户输入非数值的时候,则返回NaN。
年龄:<input v-model.number="age" type="number">
自动去掉用户输入内容两端的空格。
意见:<input v-model.trim="content">
<div id="myApp">
<h1>用户注册</h1>
<div>
<label for="username">用户:</label>
<input type="text" id="username" v-model.lazy="username" @change="checkUsername">
<span v-if="checkUsernameOK">可注册</span>
</div>
<div>
<label for="age">年龄:</label>
<input type="number" id="age" v-model.number="age">
</div>
<div>
<label for="content">个人简介:</label><br/>
<textarea id="content" v-model.trim="content" cols="55" rows="8"></textarea>
</div>
<h4>信息区</h4>
<p>{{username}}</p>
<p>{{age}}</p>
<p><pre>{{content}}</pre></p>
</div>
<script>
var myApp = new Vue({
el: '#myApp',
data: {
username: "",
checkUsernameOK: false,
age: "",
content: "",
},
methods: {
checkUsername: function(){
if (this.username.length > 0) this.checkUsernameOK = true;
else this.checkUsernameOK = false;
},
},
});
</script>
Vue.js学习工程
HTML CSS Markdown
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》