博主网站(未完善)
博主首页

目录

01图标库
02插件安装

01条件渲染
02列表渲染
03模板渲染
04计算属性
05侦听器
06样式绑定
07样式
08事件
09表单输入绑定
10生命周期
11组件
12脚手架
13vue-router
14vuex
15拖拽
16组件间传递

01HTML元素
02CSS样式

01filter、find……
02匿名函数……
03动态拼接地址
04vh、vm
05vue中ref
06js类型判断
07插槽
08富文本编辑器
09javaScript
10watch监听
11依赖注入
12ES6运算符
13flex-direction
14本地存储
15随机颜色
16中间延申
17多次触发问题
18nvm安装
19表单数据动态
20持久化存储
21$nextTick
22::v-deep
23tab失灵
25封装表单验证
26电梯导航栏
27页面滚动渐入动画

css3基础01

01bs列表
02bs栅格
03bs表单
更新中......

其他---10watch监听

01.this.$watch

    // 用法一:  
  this.$watch("要监听的值",(oldVal,newVal)=>{ })
this.$watch("name", (newValue, oldValue) => { console.log(newValue + "_新值"); console.log(oldValue + "_旧值"); });
//这样监听不到对象的变化的 this.$watch("obj", (newval, oldval) => { console.log(newval); console.log(oldval); });

02.watch

  watch: {
    age: (newValue, oldValue) => {
      console.log(newValue);
      console.log(oldValue);
    },
// 监听对象中的某个属性的变化 "obj.id":(newVal,oldVal)=>{ console.log(newVal); console.log(oldVal);   }
  }

03.深度监听

   //深度监听
    obj:{
      handler(newVal,oldVal){
        console.log(newVal);
        console.log(oldVal);
        
      },

 

posted @ 2022-01-06 16:56  !ment  阅读(30)  评论(0编辑  收藏  举报