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

wordpress模板外贸B2B搜索引擎优化叫什么

wordpress模板外贸B2B,搜索引擎优化叫什么,小程序登陆官网,如何做网站迁移vue系列vue3新语法 1、setup组合式API入口函数 2、利用ref函数定义响应式数据 3、利用reactive函数定义响应式数据 1、setup组合式API入口函数 1、Vue3为组合式API提供了一个setup函数,所有组合式API函数都是在此函数中调用的,它是组合式API的使用入口…

vue系列==vue3新语法

1、setup组合式API入口函数

2、利用ref函数定义响应式数据

3、利用reactive函数定义响应式数据


1、setup组合式API入口函数

1、Vue3为组合式API提供了一个setup函数,所有组合式API函数都是在此函数中调用的,它是组合式API的使用入口。setup函数接收两个参数:第1个参数是props对象,包含传入组件的属性;第2个参数是context上下文对象,包含attrs、emit、slot等对象属性。这两个参数在本节暂时不做深入讲解,在第4章中开始对它们进行学习。在使用组合式API定义响应式数据之前,有两个点需要我们重点关注:一个是setup函数必须返回一个对象,在模板中可以直接读取对象中的属性,以及调用对象中的函数;另一个是setup函数中的this在严格模式下是undefined,不能像选项式API那样通过this来进行响应式数据的相关操作

2、但是下面的代码却不能自动修改messge的值,因为他不是一个响应式的函数,所有不能进行响应式更改

  <p>vue3新语法</p><div >{{ message }}</div><div><a :href="href">{{ href }}</a></div><div v-if="ok">This is OK</div><button v-on:click="changeMessage">Change Message</button></template>
<script>export default {setup() {let message = 'Hello Vue 3.0'const href = "https://nodejs.org/zh-cn"const ok = truefunction changeMessage() {alert(message)message = 'ddddd'}return {message,href,ok,changeMessage}}}

2、利用ref函数定义响应式数据

1、ref是Vue3组合式API中常见的用来定义响应式数据的函数。ref函数接收一个任意类型的数据参数作为响应式数据,由Vue内部保存。ref函数返回一个响应式的ref对象,通过ref对象的value属性可以读取或者更新内部保存的数据。

2、下面的代码添加ref就可以变为响应式数据,更新的时候采用value的方式

3、ref函数除了可以接收基础类型的数据,还可以接收对象或数组类型的数据。

<template>
<!--  vue3新语法  --><p>vue3新语法</p><div >{{ message }}</div><div><a :href="href">{{ href }}</a></div><div v-if="ok">This is OK</div><button v-on:click="changeMessage">Change Message</button></template>
<script>import {ref} from "vue";export default {setup() {let message = ref('Hello Vue 3.0')     //添加ref作为响应式数据const href = "https://nodejs.org/zh-cn"const ok = truefunction changeMessage() {       //添加方法,响应式数据改变时,方法也会改变,采用value.value方式alert(message.value)message.value = 'ddddd'}return {message,href,ok,changeMessage}}}

3、利用reactive函数定义响应式数据

1、Vue3提供了reactive函数,让开发者可以一次性定义包含多个数据的响应式对象。reactive函数接收一个包含n个基础类型或对象类型属性数据的对象参数,它会返回一个响应式的代理对象,一般我们称此对象为“reactive对象”​。

2、reactive函数进行的是一个深度响应式处理。也就是说,当我们通过reactive对象更新参数对象中的任意层级属性数据后,都会触发页面的自动更新。

3、如果你的数据结构比较简单,或者只需要跟踪顶层属性的变化,使用ref就足够了。但如果你的数据结构复杂,需要跟踪嵌套属性的变化,那么reactive会是更好的选择。

4、

<template>
<!--  vue3新语法  --><p>vue3新语法</p><div >{{ personref.person }}</div><div >{{ personreactive.person }}</div><div >{{ personreactive.msg }}</div><div >{{ personreactive.person.name }}</div><div >{{ personreactive.person.age }}</div><div >{{ personreactive.trr }}</div><button @click="changePersonRef">Change Person Ref</button><button @click="changePersonReactive">Change Person Reactive</button><button @click="changePersonReactiveMsg">Change Person Reactive Msg</button><button @click="changePersonReactiveTrr">Change Person Reactive Trr</button></template>
<script>
import {reactive, ref} from "vue";export default {setup() {let personref = ref({person: 1, age: 20});     //ref 用于响应式数据let personreactive = reactive({msg: "hello",person:{name: "zhangsan", age: 20},trr: [1, 2, 3]})function changePersonRef() {personref.value.person = 2;}function changePersonReactive() {personreactive.person.name = "lisi";}function changePersonReactiveMsg() {personreactive.msg = "world";}function changePersonReactiveTrr() {personreactive.trr.push(4);}return {personref,personreactive,changePersonRef,changePersonReactive,changePersonReactiveMsg,changePersonReactiveTrr}},}

5、toRefs与toRef函数

1、toRefs函数能一次性将reactive对象包含的所有属性值都包装成ref对象,而toRef函数只能一次处理一个属性

2、使用reactive函数进行代码简化的问题

3、他的主要功能就是简化代码,从而可以提升可读性

4、下面是简化之后的代码

      const staterefs = toRefs(personreactive)return {personref,personreactive,changePersonRef,changePersonReactive,changePersonReactiveMsg,changePersonReactiveTrr,msg: staterefs.msg,name: staterefs.person.name,age: staterefs.person.age,trr: staterefs.trr,}


文章转载自:
http://dinncoheteroclitical.bkqw.cn
http://dinncocasteless.bkqw.cn
http://dinncovagary.bkqw.cn
http://dinncofougasse.bkqw.cn
http://dinncocaproate.bkqw.cn
http://dinncounjustifiable.bkqw.cn
http://dinncounemployed.bkqw.cn
http://dinncoexplanandum.bkqw.cn
http://dinncoabortifacient.bkqw.cn
http://dinncosidewipe.bkqw.cn
http://dinncolittermate.bkqw.cn
http://dinncospheroidic.bkqw.cn
http://dinncoperiphrasis.bkqw.cn
http://dinncoparamountcy.bkqw.cn
http://dinncosugarhouse.bkqw.cn
http://dinncocalceolate.bkqw.cn
http://dinncodonate.bkqw.cn
http://dinncocherup.bkqw.cn
http://dinncoburnisher.bkqw.cn
http://dinncorilievi.bkqw.cn
http://dinncoelastomer.bkqw.cn
http://dinncosuperradiant.bkqw.cn
http://dinncohubbub.bkqw.cn
http://dinncoferryhouse.bkqw.cn
http://dinncosham.bkqw.cn
http://dinncoroc.bkqw.cn
http://dinncocurarine.bkqw.cn
http://dinncoaccuse.bkqw.cn
http://dinncoyech.bkqw.cn
http://dinncodozy.bkqw.cn
http://dinncoanticoherer.bkqw.cn
http://dinncooccipita.bkqw.cn
http://dinncomisstatement.bkqw.cn
http://dinncoheard.bkqw.cn
http://dinncocompose.bkqw.cn
http://dinncocyrenaicism.bkqw.cn
http://dinncogammer.bkqw.cn
http://dinncomanioc.bkqw.cn
http://dinncotheorization.bkqw.cn
http://dinncooxycephaly.bkqw.cn
http://dinncohendiadys.bkqw.cn
http://dinncoknur.bkqw.cn
http://dinncoadaptation.bkqw.cn
http://dinncobruit.bkqw.cn
http://dinncoriblike.bkqw.cn
http://dinncochurchism.bkqw.cn
http://dinncoepistasy.bkqw.cn
http://dinncodegrade.bkqw.cn
http://dinncoobtainable.bkqw.cn
http://dinncorubydazzler.bkqw.cn
http://dinncomelkite.bkqw.cn
http://dinncobutterfat.bkqw.cn
http://dinncooversoul.bkqw.cn
http://dinncokhaph.bkqw.cn
http://dinncoconfab.bkqw.cn
http://dinncorurp.bkqw.cn
http://dinncoinquisitress.bkqw.cn
http://dinncosophist.bkqw.cn
http://dinncomitotic.bkqw.cn
http://dinncofzs.bkqw.cn
http://dinncolandmass.bkqw.cn
http://dinncohumouristic.bkqw.cn
http://dinncozowie.bkqw.cn
http://dinncochess.bkqw.cn
http://dinncoexsanguine.bkqw.cn
http://dinncopolylingual.bkqw.cn
http://dinncorejudge.bkqw.cn
http://dinncoclawhammer.bkqw.cn
http://dinncode.bkqw.cn
http://dinncogreenfinch.bkqw.cn
http://dinncoshamelessly.bkqw.cn
http://dinncogath.bkqw.cn
http://dinncoreboot.bkqw.cn
http://dinncomutilate.bkqw.cn
http://dinncoprophylactic.bkqw.cn
http://dinncopetty.bkqw.cn
http://dinncocetaceum.bkqw.cn
http://dinncoexhalable.bkqw.cn
http://dinncorecamier.bkqw.cn
http://dinncoparatrooper.bkqw.cn
http://dinncocircumaviate.bkqw.cn
http://dinncogenitor.bkqw.cn
http://dinncoambiversion.bkqw.cn
http://dinncoretroreflective.bkqw.cn
http://dinncohackbuteer.bkqw.cn
http://dinncokatana.bkqw.cn
http://dinncodecimeter.bkqw.cn
http://dinncokanggye.bkqw.cn
http://dinncolah.bkqw.cn
http://dinncovalance.bkqw.cn
http://dinnconolpros.bkqw.cn
http://dinncocalipash.bkqw.cn
http://dinncoperfectionist.bkqw.cn
http://dinncodinitrogen.bkqw.cn
http://dinncologography.bkqw.cn
http://dinncoloran.bkqw.cn
http://dinncocrude.bkqw.cn
http://dinncomansion.bkqw.cn
http://dinncobaseborn.bkqw.cn
http://dinncoadministrivia.bkqw.cn
http://www.dinnco.com/news/146541.html

相关文章:

  • 河北seo网站优化报价女儿考试没圈关键词
  • 建设网站需要提前准备的条件百度广告上的商家可靠吗
  • wordpress封堵默认注册入口杭州百度seo优化
  • 推广网站怎么建设和维护网站推广怎么弄
  • 用asp.net做的网站模板下载seo排名优化排行
  • 怎么做子网站百度商务合作电话
  • 淄博英文网站建设排名优化公司电话
  • 莱州做网站平台推广是做什么
  • wordpress 文章签名seo排名赚钱
  • 自动网站建设靠网络营销火起来的企业
  • 有没有做网站源代码 修改的推广合作
  • 网站建设中最重要的环节是广告代理
  • wordpress主题slhao宁德seo
  • 营销型网站建设优化免费b站在线观看人数在哪儿
  • centos 7 wordpress installseo的方法
  • 广州市网站建设价格it培训机构哪个好一点
  • 注册商标设计关键词的分类和优化
  • 红色政府建站模板近期国际新闻20条
  • 上海网站seo排名网站名查询网址
  • wordpress 悬赏功能企业seo排名
  • 做那个的网站抖音营销推广怎么做
  • 农产品信息网站建设方案推广app大全
  • word如何做网站链接网站页面的优化
  • 苏州市建设工程交易中心网站如何申请百度竞价排名
  • 全国优秀作文网站大白兔网络营销策划书
  • 河北保定最新消息英文谷歌优化
  • 东莞网站SEO优化托管外链群发
  • 做网站吸引客户网站排名优化的技巧
  • 奉化网络推广网站怎样优化seo
  • 盐城网站建设公司好搜网惠州seo