Blogger Information
Blog 31
fans 0
comment 0
visits 14265
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
vue常用术语与常用指令
木子木杉
Original
440 people have browsed it

vue常用术语

1.挂载点

  1. <div class="app">
  2. </div>

2.vue实例
const app = Vue.createApp({}).mount(".app")
3.数据注入

  1. const obj = {
  2. $data: {
  3. email: "123456789@qq.com",
  4. },
  5. get email() {
  6. return this.$data.email;
  7. },
  8. }

4.响应式
app.username = "李同学";

vue常用指令

v-text
<p>用户名:<span v-text="username"></span></p>
v-html
<p>用户名:<span v-html="username"></span></p>
app.username = '<span style="color:red">张同学</span>';
v-once
<p>用户名:<span v-once="username"></span></p>
样式绑定:v-bind,简化:冒号
<p v-bind:style="style">嗓子疼</p>
<p :class="['active','bgc']">一会就出去</p>
双向绑定v-model

  1. <div class="app">
  2. <p>
  3. <input type="text" v-model="comment" :value="comment" />
  4. <span>{{comment}}</span>
  5. </p>
  6. </div>
Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:<span v-once>{{username}}</span>
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post