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

网络宣传网站建设咨询前程无忧官网

网络宣传网站建设咨询,前程无忧官网,烟台小学网站建设,现在用什么软件做网站往期内容#xff1a; 《Vue零基础入门教程》合集#xff08;完结#xff09; 《Vue进阶教程》第一课#xff1a;什么是组合式API 《Vue进阶教程》第二课#xff1a;为什么提出组合式API 《Vue进阶教程》第三课#xff1a;Vue响应式原理 《Vue进阶教程》第四课#…   往期内容 《Vue零基础入门教程》合集完结 《Vue进阶教程》第一课什么是组合式API 《Vue进阶教程》第二课为什么提出组合式API 《Vue进阶教程》第三课Vue响应式原理 《Vue进阶教程》第四课reactive()函数详解 《Vue进阶教程》第五课ref()函数详解(重点) 1) 基本使用 计算属性computed()函数 1参数: 函数/对象 2作用: 创建一个计算属性 3返回: 计算属性对象 示例1 接收函数作为参数 const state reactive({firstname: xiao, lastname: ming}) // 接收一个副作用函数做为参数, 返回一个ref类型对象 const fullname computed(() {return state.firstname state.lastname }) // 通过.value操作 console.log(fullname.value) 示例2 接收一个对象作为参数, 但是这种方式用的不多. 接收对象作为参数 const state reactive({firstname: xiao, lastname: ming}) // 接收一个副作用函数做为参数, 返回一个ref类型对象 const fullname computed({get() {return state.firstname state.lastname},set(newValue) {[state.firstname, state.lastname] newValue.split( )} }) // 通过.value操作 console.log(fullname.value) 2) 计算属性的特点 懒执行 示例 !DOCTYPE html html langenheadmeta charsetUTF-8 /meta http-equivX-UA-Compatible contentIEedge /meta nameviewport contentwidthdevice-width, initial-scale1.0 /titleDocument/titlescript src../node_modules/vue/dist/vue.global.js/script/headbodyscriptconst { reactive, computed } Vueconst state reactive({ firstname: xiao, lastname: ming })const fullname computed(() {console.log(默认不执行, 只有当访问fullName.value时执行)return state.firstname state.lastname})setTimeout(() {fullname.value}, 1000)/script/body /html 缓存   !DOCTYPE html html langenheadmeta charsetUTF-8 /meta http-equivX-UA-Compatible contentIEedge /meta nameviewport contentwidthdevice-width, initial-scale1.0 /titleDocument/title/headbodyscript src../node_modules/vue/dist/vue.global.js/scriptscriptconst { reactive, computed } Vueconst state reactive({ firstname: xiao, lastname: ming })const fullname computed(() {console.log(computed)return state.firstname state.lastname})console.log(fullname.value) // 初次访问时, 执行1次, 保存到缓存console.log(fullname.value) // 再次访问, 直接返回缓存中的数据/script/body /html3) effect的高级用法 effect函数的高级用法 1lazy: 懒执行 2scheduler: 自定义更新 lazy选项 示例 懒执行 !DOCTYPE html html langenheadmeta charsetUTF-8 /meta http-equivX-UA-Compatible contentIEedge /meta nameviewport contentwidthdevice-width, initial-scale1.0 /titleDocument/titlescript src../node_modules/vue/dist/vue.global.js/script/headbodyscriptconst { ref, effect } Vueconst count ref(0)// effect 返回 run() 函数,// 1. 加入lazy:true选项后, 不会自动调用副作用函数// 2. 手动执行run()函数, 才会调用副作用函数, 建立依赖关系const run effect(() {console.log(一开始不执行, 调用run才会执行, count.value)},{ lazy: true })console.log(run)/script/body /htmlscheduler选项 示例 !DOCTYPE html html langenheadmeta charsetUTF-8 /meta http-equivX-UA-Compatible contentIEedge /meta nameviewport contentwidthdevice-width, initial-scale1.0 /titleDocument/titlescript src../node_modules/vue/dist/vue.global.js/script/headbodyscriptconst { ref, effect } Vueconst count ref(0)effect(() {console.log(第一次执行这里, count.value)},{scheduler: () {console.log(更新时, 执行这里...)},})/script/body /html
http://www.pierceye.com/news/593849/

相关文章:

  • 襄阳定制型网站开发昆明网站开发推广公司
  • 做视频怎样传到网站ip域名查询
  • 天台建设局网站恒一信息深圳网站建设公司2
  • 珠海网站怎样建设网页设计相关网站
  • 网站推广服务好公司排名山西网站建设免费
  • 金乡县网站建设曲靖建设局网站
  • 唐山制作网站的公司深圳市做网站知名公司
  • 深圳方维网站建设公司全面启动门户网站建设
  • 住房和城乡建设部网站证书查询企业推广产品有什么平台好
  • 建立企业网站的目的手机排行榜软件
  • 自己做网络棋牌网站流程wordpress 自定义数据库
  • 北京网站建设厂家个人养老保险
  • 办公室门户网站建设和管理工作360排名优化工具
  • 楚天网站建设合同蜘蛛云建网站怎样
  • 建设一个小说网站企业网站 数据库设计
  • 最简单的网站开发软件有哪些ui设计外包
  • 网站主页排版重庆装修公司排名前十名
  • 网站建设得花多钱设计网站的软件
  • 辽阳企业网站建设团队网络营销与直播电商课程
  • 枣庄网站建设电话临沂广润网站建设
  • 长春市制作网站费用郑州网站专业制作
  • 婚恋网站排名前十名淘宝客网站开发一个
  • 泰国网站的域名物流公司哪家便宜又好
  • 找工作的平台seo第三方点击软件
  • 青岛市建设监理协会网站网站开发工作量评估
  • 深圳网站设计与制作公司德州万企互联网站制作
  • 制作一个链接网站400电话网站模板
  • 网站建设网站网站建设网站濮阳网站建设网站
  • 追天网站建设 优帮云网页设计基础入门
  • 北京网站的建立的wordpress mofile