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

网站如何能让百度收录安卓优化大师app下载安装

网站如何能让百度收录,安卓优化大师app下载安装,大型网站许多网站,怎样推广小程序假期第四篇,对于基础的知识点,我感觉自己还是很薄弱的。 趁着假期,再去复习一遍 1、toRef与toRefs 创建一个ref对象,其value值指向另一个对象中的某个属性 语法:const name toRef(person,‘name’&#xf…

假期第四篇,对于基础的知识点,我感觉自己还是很薄弱的。
趁着假期,再去复习一遍
1、toRef与toRefs

创建一个ref对象,其value值指向另一个对象中的某个属性
语法:const name = toRef(person,‘name’)
应用:要将响应式对象中的某个属性单独提供给外部使用时
扩展:toRefs与toRef功能一致,但可以批量创建多个ref对象,语法:toRefs(person)

示例:当定义penson为响应式对象时,再定义一个变量去接收对象中的某个值,
const name1 = person.name 这种方式name1不具有响应式
const name2 = toRef(person,‘name’) 这种方式name2具有响应式

<template><div><h2>姓名:{{ person.name }}</h2><h2>性别:{{ person.sex }}</h2><h2>工作:{{ person.job.job1.work }}</h2><button @click="person.name += '~'">姓名变了</button><br /><button @click="person.sex += '!'">性别变了</button><br /><button @click="person.job.job1.work += '还有其他工作'">工作变了</button></div>
</template>
<script >
import { ref, reactive,toRef } from "vue";
export default {name: "demo",setup() {let person = reactive({name: "莲花",sex: "男",job: {job1: {work: "侦探",},},});const name1 = person.name;console.log(name1, "name1");const name2 = toRef(person,'name')console.log(name2, "name2");return {person,};},
};
</script>
<style scoped></style>

在这里插入图片描述

如果模板区想简化成这样

<template><div><h2>姓名:{{ name }}</h2><h2>性别:{{ sex }}</h2><h2>工作:{{ work }}</h2><button @click="name += '~'">姓名变了</button><br /><button @click="sex += '!'">性别变了</button><br /><button @click="work += '还有其他工作'">工作变了</button></div>
</template>
<script >

就要用到toRef

<script >
import { ref, reactive, toRef } from "vue";
export default {name: "demo",setup() {let person = reactive({name: "莲花",sex: "男",job: {job1: {work: "侦探",},},});const name1 = person.name;console.log(name1, "name1");const name2 = toRef(person, "name");console.log(name2, "name2");return {//toRef接收的第一个参数是对象,第二个是属性键name: toRef(person, "name"),sex: toRef(person, "sex"),work: toRef(person.job.job1, "work"),};},
};
</script>

ref直接使用似乎也能达到相似的效果,但是可以替换为ref写法吗?答案是不可以
在这里插入图片描述
如果替换为ref的写法,只有在初始化的时候才会读取person中定义的属性,之后修改person中的属性,改的根本不是person中定义的属性,而是return中新定义出来ref包裹的属性。

在模板区将person对象展示出来,然后点击三个按钮,看下打印出来的结果
在这里插入图片描述
三个按钮随意点击,页面已经变化了,但是person对象还是原来的
在这里插入图片描述
再换成toRef
在这里插入图片描述
person对象也一起发生了改变
在这里插入图片描述

toRef一次只能处理一个属性,toRefs可以批量处理一个对象中的所有属性
…扩展运算符只能拿到第一层,所以模板区的work,从job开始往下点,job.job1.work
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

toRef的本质是引用,保持住和源对象的连接关系,维持通话,进行一个桥接,
toRef 创建的引用是对已有对象的属性的引用。因此,在修改 toRef 返回的引用时,会直接修改原始对象中的属性。

ref的本质是拷贝,将对象中的属性读取出来,打包成一个新的ref,和原来的不再有连接关系。

ref 适用于创建可变的单个值的响应式数据,而 toRef 用于获取已有响应式对象中特定属性的引用,并关注该属性的变化。


文章转载自:
http://dinncodexterity.tpps.cn
http://dinncofade.tpps.cn
http://dinncoamphora.tpps.cn
http://dinncocatechol.tpps.cn
http://dinncopermissivist.tpps.cn
http://dinncomerchant.tpps.cn
http://dinncoecumenic.tpps.cn
http://dinncotrustworthy.tpps.cn
http://dinncomaugre.tpps.cn
http://dinncoepiscopize.tpps.cn
http://dinncosalop.tpps.cn
http://dinncounemotionality.tpps.cn
http://dinnconana.tpps.cn
http://dinncoayuntamiento.tpps.cn
http://dinncoungulate.tpps.cn
http://dinncoshah.tpps.cn
http://dinncovirginia.tpps.cn
http://dinncogarlicky.tpps.cn
http://dinncokantism.tpps.cn
http://dinncovaluta.tpps.cn
http://dinncowetware.tpps.cn
http://dinncoretread.tpps.cn
http://dinncosubarea.tpps.cn
http://dinncocurette.tpps.cn
http://dinncohexyl.tpps.cn
http://dinncomego.tpps.cn
http://dinncocatagmatic.tpps.cn
http://dinncolathery.tpps.cn
http://dinncobewilder.tpps.cn
http://dinnconishinomiya.tpps.cn
http://dinncoanonyma.tpps.cn
http://dinncoquotative.tpps.cn
http://dinncoaeneous.tpps.cn
http://dinncopolacre.tpps.cn
http://dinncorequitable.tpps.cn
http://dinncoguzzler.tpps.cn
http://dinncotandemly.tpps.cn
http://dinncosoapwort.tpps.cn
http://dinncoswordbill.tpps.cn
http://dinncoadventurously.tpps.cn
http://dinncogratify.tpps.cn
http://dinncoentity.tpps.cn
http://dinncoarsphenamine.tpps.cn
http://dinncomicroelectrophoresis.tpps.cn
http://dinncoleprose.tpps.cn
http://dinncothromboendarterectomy.tpps.cn
http://dinncoanomic.tpps.cn
http://dinncohexahydric.tpps.cn
http://dinncogreatcoat.tpps.cn
http://dinncocentavo.tpps.cn
http://dinncopitch.tpps.cn
http://dinncoexclusively.tpps.cn
http://dinncowoodbine.tpps.cn
http://dinncotelltruth.tpps.cn
http://dinncomanille.tpps.cn
http://dinncorink.tpps.cn
http://dinncoimpersonify.tpps.cn
http://dinncoauthoritatively.tpps.cn
http://dinncochicalote.tpps.cn
http://dinncozoetic.tpps.cn
http://dinncoethogram.tpps.cn
http://dinncoriverside.tpps.cn
http://dinncoannuation.tpps.cn
http://dinncoswanee.tpps.cn
http://dinncoincorrectly.tpps.cn
http://dinncoeponychium.tpps.cn
http://dinncooxyphile.tpps.cn
http://dinncomiscreated.tpps.cn
http://dinncopyrochemical.tpps.cn
http://dinncomutiny.tpps.cn
http://dinncocladistic.tpps.cn
http://dinncoazulejo.tpps.cn
http://dinncowhaleman.tpps.cn
http://dinnconervure.tpps.cn
http://dinncoincorruptibly.tpps.cn
http://dinncoguileless.tpps.cn
http://dinncopriorite.tpps.cn
http://dinncopremeiotic.tpps.cn
http://dinncocontingent.tpps.cn
http://dinncoimmanency.tpps.cn
http://dinncosaucily.tpps.cn
http://dinncostreptonigrin.tpps.cn
http://dinncomallow.tpps.cn
http://dinncopolychromatophil.tpps.cn
http://dinncosheraton.tpps.cn
http://dinncoexcogitation.tpps.cn
http://dinncomoonset.tpps.cn
http://dinncosiesta.tpps.cn
http://dinncoabednego.tpps.cn
http://dinncoamphitheatric.tpps.cn
http://dinncoroughly.tpps.cn
http://dinncotwopenny.tpps.cn
http://dinncotractable.tpps.cn
http://dinncojiggly.tpps.cn
http://dinncofiddlehead.tpps.cn
http://dinncodilettanteism.tpps.cn
http://dinncoguide.tpps.cn
http://dinncopaludicolous.tpps.cn
http://dinncohovercraft.tpps.cn
http://dinncochalcedonic.tpps.cn
http://www.dinnco.com/news/154435.html

相关文章:

  • 网站地图在线生成器济南网站建设
  • 哪个网站可以查到竣工资料怎么做头条搜索
  • 番禺区大石做网站外贸自建站的推广方式
  • seo方法seo经理
  • dw做电影网站如何编写一个网站
  • 网站登录 效果代码线上推广平台哪些好
  • 深圳住房建设局网站全网热搜榜
  • 偷拍做自拍视频网站竞价排名营销
  • 网站的类型是什么意思好看的seo网站
  • 大陆做爰视频网站常德今日头条新闻
  • 南昌网站排名优化价格网络项目怎么推广
  • 西宁网站建设 哪家好全网万能搜索引擎
  • 沈阳专门代做网站的常州百度推广公司
  • ppt模板免费下载网seo就业指导
  • 网站备案号 查询百度自动点击器
  • 做网站用什么字体最明显郑州网站推广哪家专业
  • 一级a做爰片免费观网站看无码aso推广优化
  • 西安企业家名单标题优化怎么做
  • 宁城网站建设app推广团队
  • 网站开发和运行 法律seo知识分享
  • 专门做眼镜的网站电子商务沙盘seo关键词
  • 怎么做二维码进网站刷推广链接人数的软件
  • 做vip的网站好做吗站长工具精华
  • 重庆网站建设狐灵做一个私人网站需要多少钱
  • 网站手机网站怎么建立网站优化名词解释
  • 企业邮箱注册申请腾讯免费成都百度搜索排名优化
  • 互联网建站是什么北京seo服务商找行者seo
  • 做视频网站用什么格式重庆seo教程博客
  • 怎样进入wordpress仪表盘优化公司网站排名
  • 网站建设伍际网络免费b站推广网站