Blogger Information
Blog 21
fans 0
comment 0
visits 14735
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
(1112)vue
Yuming
Original
677 people have browsed it

vue

  1. 理解并写 Vue 挂载点是什么意思

挂载点,vue 仅处理挂点下面的内容(dom 节点)。

  1. Vue 实例有什么用, 与 MVVM 模型的关系是什么,处于什么位置

vue 实例可以创建虚拟 DOM 与 MVVM 模型的关系是 处于 vm 层

  1. 实例演示 vue 中的常用属性,如计算属性,过滤器,侦听器等, 并理解它的等价语法与核心本质
  • 计算属性

    适用于多个数据影响一个属性的情况

  1. <div id="app">
  2. <span>总和:{{ total }}</span>
  3. </div>
  1. data() {
  2. return {
  3. bef: 1,
  4. aft: 2,
  5. };
  6. },
  7. // - 计算属性
  8. computed: {
  9. total() {
  10. return this.bef + this.aft;
  11. },
  12. },
  • 过滤器
  1. <div id="app">
  2. <span>总和:{{ total | addOne }}</span>
  3. </div>
  1. filters: {
  2. addOne(val) {
  3. return val + 1;
  4. },
  5. },
  • 侦听器
  1. <div id="app">
  2. <input type="text" v-model="bef" />
  3. <input type="text" v-model="aft" />
  4. </div>
  1. data() {
  2. return {
  3. bef: 1,
  4. aft: 2,
  5. };
  6. },
  7. watch: {
  8. bef: function(val) {
  9. this.aft = val;
  10. },
  11. },

Correcting teacher:天蓬老师天蓬老师

Correction status:qualified

Teacher's comments:还要努力呀
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