当前位置: 首页 > news >正文

网站wap版网络设计用什么软件

网站wap版,网络设计用什么软件,织梦网站如何做seo,中国兰州网官网watch() 一共可以接受三个参数#xff0c;侦听数据源、回调函数和配置选项 作用#xff1a;监视数据的变化#xff08;和Vue2中的watch作用一致#xff09; 特点#xff1a;Vue3中的watch只能监视以下四种数据#xff1a; ref定义的数据。 reactive定义的数据。 函数返…watch() 一共可以接受三个参数侦听数据源、回调函数和配置选项 作用监视数据的变化和Vue2中的watch作用一致 特点Vue3中的watch只能监视以下四种数据 ref定义的数据。 reactive定义的数据。 函数返回一个值getter函数。 一个包含上述内容的数组 ref 定义的数据 templatedivstr{{ str }}/divdivperosn 的name{{ personObj.name }}/divdivPerson 的age{{ personObj.age }}/divdivPerson的Car{{ personObj.car }}/divdivPerson的Car.color{{ personObj.car.color }}/divdivPerson的Car.price{{ personObj.car.price }}/divdivel-button clickeditPerson点击修改部分属性/el-buttonel-button clickeditPersonAll点击修改全部/el-buttonel-button clickeditString修改基本数据类型/el-button/div /templatescript setup langts import { reactive, watch, ref, toRefs, Ref } from vue; interface Person {name: string;age: number;car: {price: number;color: string;}; } // let str: Refstring ref(AAA); // 泛型写法 let str ref(AAA); let personObj refPerson({name: aaa,age: 12,car: {price: 12,color: reds,}, }); const editPerson () {personObj.value.name bbb; }; const editPersonAll () {personObj.value.car {price: 222,color: blue,}; };const editString () {str.value Bbb; }; // 监听基本数据类型变化 watch(() str.value,(newValue, oldValue) {console.log(监听基本数据类型变化newValue);console.log(newValue);console.log(oldValue);} ); // 监听对象类型某个值的变化 watch(() personObj.value.name,(newValue, oldValue) {console.log(personObj.value.name);console.log(newValue newValue);console.log(oldValue oldValue);} );/* 监视情况一监视【ref】定义的【对象类型】数据监视的是对象的地址值若想监视对象内部属性的变化需要手动开启深度监视watch的第一个参数是被监视的数据watch的第二个参数是监视的回调watch的第三个参数是配置对象deep、immediate等等..... */ watch(personObj,(newValue, oldValue) {console.log(修改整个车);console.log(newValue);let { car, name, age } toRefs(newValue);console.log(car, name.value, age.value);console.log(oldValue);// let {car,name,age} toRefs(oldValue)// console.log(car,name,age);},{deep: true,} ); /scriptstyle scoped/style reactive 定义的数据 ref 写法 templatedivperosn 的name{{ personObj.name }}/divdivPerson 的age{{ personObj.age }}/divdivPerson的Car{{ personObj.car }}/divdivPerson的Car.color{{ personObj.car.color }}/divdivPerson的Car.price{{ personObj.car.price }}/divdivel-button clickeditPerson点击修改部分属性/el-buttonel-button clickeditPersonAll点击修改全部/el-button/div /template script setup langts import { reactive, watch, ref } from vue; interface Person {name: string;age: number;car: {price: number;color: string;}; } let personObj reactivePerson({name: aaa,age: 12,car: {price: 12,color: reds,}, }); const editPerson () {personObj.name bbb; }; const editPersonAll () {personObj.car {price: 222,color: blue,}; }; //监听基本数据类型的写法 watch(() personObj.name,(newValue, oldValue) {console.log(newValue newValue);console.log(oldValue oldValue);} ); 监听对象类型的写法 (推荐使用这种方法) // watch( // () personObj.car, // (newValue, oldValue) { // console.log(修改整个车); // console.log(newValue newValue); // console.log(oldValue oldValue); // } // ); 监听对象类型的写法 watch(personObj.car, (newValue, oldValue) {console.log(修改整个车);console.log(newValue newValue);console.log(oldValue oldValue); }); /script监听多个值变化 ref 写法 templatedivperosn 的name{{ personObj.name }}/divdivPerson 的age{{ personObj.age }}/divdivPerson的Car{{ personObj.car }}/divdivPerson的Car.color{{ personObj.car.color }}/divdivPerson的Car.price{{ personObj.car.price }}/divdivel-button clickeditPersonName点击修改name/el-buttonel-button clickeditPersonCarColor点击修改car-color/el-button/div /templatescript setup langts import { tr } from element-plus/es/locales.mjs; import { reactive, watch, ref, toRefs, Ref } from vue; interface Person {name: string;age: number;car: {price: number;color: string;}; } let personObj refPerson({name: aaa,age: 12,car: {price: 12,color: reds,}, }); const editPersonName () {personObj.value.name bbb; }; const editPersonCarColor () {personObj.value.car.color bule; };// 监听对象类型某个值的变化 // 传入的是数组 获取到的newValue 也是数组一一对应的关系 watch([() personObj.value.name, personObj.value.car],(newValue, oldValue) {console.log(personObj.value--watch);console.log(newValue);console.log(oldValue);},{deep: true,} ); /scriptstyle scoped/style reactive 写法 templatedivperosn 的name{{ personObj.name }}/divdivPerson 的age{{ personObj.age }}/divdivPerson的Car{{ personObj.car }}/divdivPerson的Car.color{{ personObj.car.color }}/divdivPerson的Car.price{{ personObj.car.price }}/divdivel-button clickeditPersonName点击修改name/el-buttonel-button clickeditPersonCarColor点击修改car-color/el-button/div /templatescript setup langts import { tr } from element-plus/es/locales.mjs; import { reactive, watch, ref, toRefs, Ref } from vue; interface Person {name: string;age: number;car: {price: number;color: string;}; } let personObj reactivePerson({name: aaa,age: 12,car: {price: 12,color: reds,}, }); const editPersonName () {personObj.name bbb; }; const editPersonCarColor () {personObj.car.color bule; };// 监听对象类型某个值的变化 // 传入的是数组 获取到的newValue 也是数组一一对应的关系 watch([() personObj.name, personObj.car],(newValue, oldValue) {console.log(personObj.value--watch);console.log(newValue);console.log(oldValue);},{deep: true,} ); /scriptstyle scoped/style
http://www.tj-hxxt.cn/news/232685.html

相关文章:

  • 找网站建设企业wordpress mxtheme02
  • 西安网站建设风尚网站设计公司电话
  • 营销型网站建设都具有哪些优势google关键词排名查询
  • 做网站推广的一般都是什么公司html商品页面代码
  • 完整个人网站开发案例网站开发及技术路线
  • 东莞网站的优化河南网络推广培训
  • 沧州网站建设 益志科技长春网站建设网
  • 杭州有哪些做网站的公司好设备技术支持东莞网站建设
  • 手机版网站怎么做的什么网站是做汽车装饰配件的
  • wordpress获取当前页面内容站长工具seo词语排名
  • 网站空间多少钱昆山市建设局网站
  • 企业网站建设立项请示玩具网站建设方案
  • 免费建网站 手机网站沈阳网是什么公司
  • 企业网站系统的设计与开发网站开发与软件开发的异同
  • 告状书放网站上怎么做国外网站有哪些平台
  • 廊坊专业做网站什么是网站名
  • 免费网站建站百度云中卫网站建站设计
  • 网站开发费属于研发支出吗湖北网站设计制作开发
  • 龙华做网站 熊掌号有哪些做场景秀的网站
  • 免费自己做网站手机学做网站制作
  • 无锡网知名网站设计网名的花样符号
  • 网站页面设计模板代码顺德网站建设7starry
  • jsp购物网站开发视频一个静态网站怎么做
  • 移动电商网站开发软件定制开发软件
  • 蓝众建站_专业网站建设专业seo推广
  • 网站建设的常见问题福建专业网站建设公司
  • 北京网站建设 shwl北京商场招商
  • 网站建设技术团队有多重要性招远专业做网站公司
  • 企业vi设计价格整站seo公司
  • 用html5做课程教学网站wordpress鼠标轨迹