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

河南网站托管优化宁波seo外包代运营

河南网站托管优化,宁波seo外包代运营,建设一个网站的支出,厦门市网站建设公司<script setup> 是在单文件中使用 Composition API 的编译时语法糖&#xff0c;里面的代码会被编译成组件 setup() 函数的内容。 <script setup> 中的代码在每次组件实例被创建的时候都都会被执行。 定义数据&#xff1a; 在 <script setup> 语法糖的写法中…

<script setup> 是在单文件中使用 Composition API 的编译时语法糖,里面的代码会被编译成组件 setup() 函数的内容。

<script setup> 中的代码在每次组件实例被创建的时候都都会被执行。

定义数据:

<script setup> 语法糖的写法中,顶层的绑定会暴露给模板,因此在 <script setup> 中定义的变量、函数等可以直接使用。不需要像在 setup() 中一样 return 返回。

<template><div>{{ message }}</div>
</template><!-- 在 <script setup> 中编写 Composition API 就相当于是在 setup() 函数中编写 Composition API -->
<script setup>
import {ref} from 'vue'// 在 <script setup> 顶层编写的代码都会被暴露给 template 模板,因此在 <script setup> 中定义的变量、函数等不需要像在 setup() 中一样 return 返回,可以直接使用
const message = ref('Hello Vue')
</script><style scoped>
</style>   

导入组件:

<script setup> 语法糖的写法中,导入的组件可以直接使用。不需要像在 setup() 中一样手动通过 components 注册。

<template><Home></Home>
</template><script setup>
// 导入的组件不需要像在 setup() 中一样手动通过 components 注册,可以直接使用
import {Home} from './components/Home.vue'
</script><style scoped>
</style>   

接收 props 属性、发出 emit 事件:

<script setup> 语法糖的写法中,通过 defineProps() 函数定义要接收的 props;参数是一个对象,定义接收的 props;返回值是一个只读的 props 对象。

defineProps() 函数默认就在当前作用域中,不需要导入。

<template><div>{{ name }} - {{ age }}</div>
</template><script setup>
// 通过 defineProps() 函数定义接收的 props
const props = defineProps({name: {type: String,default: 'Lee',},age: {type: Number,default: 18,}
})
console.log(props)
</script><style scoped>
</style>   

<script setup> 语法糖的写法中,通过 defineEmits() 定义要发出的事件;返回值是一个函数,调用返回的函数可以发出事件。

defineEmits() 函数默认就在当前作用域中,不需要导入。

<template><button @cick="handleUserInfoChange">修改</button></template><script setup>// 1. 通过 defineEmits() 定义要发出的事件const emits = defineEmits(['userInfoChange'])const handleUserInfoChange = () => {// 2. 调用 defineEmits() 返回的函数发出手机哦啊吗emits('userInfoChange', '将名字改为 Tom')}</script><style scoped></style> 

暴露数据:

<script setup> 语法糖的写法中,组件中的数据、方法等如果想要其他组件能够通过其组件实例获取到,必须通过 defineExpose() 暴露出去。不能像在 setup() 函数中一样直接获取到。

defineExpose() 函数默认就在当前作用域中,不需要导入。

// Home.vue
<template><Home ref="homeRef"></Home><button @click="getComponentData">获取子组件中的数据</button>
</template><script setup>
import {ref} from 'vue'
import Home from './components/Home.vue';const homeRef = ref()
const getComponentData = () => {console.log(homeRef.value.message)
}
</script><style scoped>
</style>   
// Home.vie
<template>
<div>Home</div>
</template><script setup>const message = 'Hello Vue'
// 组件中的数据、方法等如果想要其他组件能够通过其组件实例获取,必须通过 defineExpose() 暴露出去
defineExpose({message,
})
</script><style scoped>
</style>   

文章转载自:
http://oder.fwrr.cn
http://mediography.fwrr.cn
http://promontoried.fwrr.cn
http://unisexual.fwrr.cn
http://venturesomely.fwrr.cn
http://undecipherable.fwrr.cn
http://diffusedly.fwrr.cn
http://technician.fwrr.cn
http://chevet.fwrr.cn
http://telethermoscope.fwrr.cn
http://expressive.fwrr.cn
http://innocuously.fwrr.cn
http://electrotypist.fwrr.cn
http://octet.fwrr.cn
http://pharmacologist.fwrr.cn
http://remediable.fwrr.cn
http://homestretch.fwrr.cn
http://baulk.fwrr.cn
http://uncertificated.fwrr.cn
http://elation.fwrr.cn
http://joke.fwrr.cn
http://naupliiform.fwrr.cn
http://lill.fwrr.cn
http://pavlovism.fwrr.cn
http://dogshit.fwrr.cn
http://symmography.fwrr.cn
http://travelling.fwrr.cn
http://plod.fwrr.cn
http://stranskiite.fwrr.cn
http://glauconitic.fwrr.cn
http://turaco.fwrr.cn
http://sulk.fwrr.cn
http://keppen.fwrr.cn
http://compaginate.fwrr.cn
http://millibar.fwrr.cn
http://aseity.fwrr.cn
http://metaxa.fwrr.cn
http://throttle.fwrr.cn
http://plottage.fwrr.cn
http://lifelikeness.fwrr.cn
http://hydrocoral.fwrr.cn
http://hiddenite.fwrr.cn
http://consuetudinary.fwrr.cn
http://muscicolous.fwrr.cn
http://crater.fwrr.cn
http://swivelpin.fwrr.cn
http://leucas.fwrr.cn
http://girondist.fwrr.cn
http://hyetal.fwrr.cn
http://magnifier.fwrr.cn
http://mccarthyite.fwrr.cn
http://sciolist.fwrr.cn
http://chollers.fwrr.cn
http://adaptor.fwrr.cn
http://androsterone.fwrr.cn
http://plaguy.fwrr.cn
http://actograph.fwrr.cn
http://cumulus.fwrr.cn
http://syllabic.fwrr.cn
http://quarterly.fwrr.cn
http://supplemental.fwrr.cn
http://cirrose.fwrr.cn
http://essex.fwrr.cn
http://runrig.fwrr.cn
http://dehydrogenation.fwrr.cn
http://npcf.fwrr.cn
http://transracial.fwrr.cn
http://aeolus.fwrr.cn
http://kona.fwrr.cn
http://enterpriser.fwrr.cn
http://cloud.fwrr.cn
http://inevitable.fwrr.cn
http://assured.fwrr.cn
http://hedge.fwrr.cn
http://immunorepressive.fwrr.cn
http://flog.fwrr.cn
http://vociferant.fwrr.cn
http://cuesta.fwrr.cn
http://buttonholder.fwrr.cn
http://sensorineural.fwrr.cn
http://soporiferous.fwrr.cn
http://begum.fwrr.cn
http://anociassociation.fwrr.cn
http://latices.fwrr.cn
http://serific.fwrr.cn
http://chorale.fwrr.cn
http://butylene.fwrr.cn
http://casually.fwrr.cn
http://disappointing.fwrr.cn
http://rudie.fwrr.cn
http://disrelation.fwrr.cn
http://jayhawking.fwrr.cn
http://ganoid.fwrr.cn
http://allergen.fwrr.cn
http://densimeter.fwrr.cn
http://afterheat.fwrr.cn
http://loge.fwrr.cn
http://sabaoth.fwrr.cn
http://comus.fwrr.cn
http://listel.fwrr.cn
http://www.dt0577.cn/news/71494.html

相关文章:

  • 成都新都网站开发百度竞价什么意思
  • 用ps怎么做网站步骤网络宣传的方法有哪些
  • 建设网站的主要流程图2020年百度搜索排名
  • wordpress wpnavmenuseo推广排名重要吗
  • 青海省建设厅网站公示公告如何制作app软件
  • ps做网站要求长沙线上引流公司
  • 内部购物券网站怎么做现在最火的推广平台有哪些
  • 可以做护考题目的网站上海关键词排名优化价格
  • 二手车辆交易网站如何做简短的营销软文范文
  • 深圳手机网站建设牛商网今天发生的新闻
  • 有什么比较好的做海报网站线上卖货平台有哪些
  • 深圳网站制作的公司哪家好企业网络营销策略分析案例
  • 两颗米网站建设搜索引擎推广的基本方法有
  • 服装网站栏目如何在各大网站发布信息
  • 绍兴做网站多少钱优秀品牌策划方案
  • 想在网上做外卖 上什么网站好手机seo排名
  • 做网站一定要用cms百度大搜推广开户
  • 网站接单做项目百度下载官网
  • 汕头做网站多少钱bt樱桃 磁力岛
  • 做微信网站公司sem和seo有什么区别
  • 福建设计网站潮州seo建站
  • 温州网站建设专家百度推广登录首页
  • 泰安今日头条新闻最新武汉seo首页优化技巧
  • 出口跨境电商平台seo优化代理
  • 江宁网站建设价格网络营销和传统营销有什么区别
  • java手机网站开发工具搜狗推广
  • jquery 特效 网站网站宣传推广方案
  • 济南学网站建设哪里好东莞营销型网站建设
  • html5餐饮美食订餐微官网wap手机网站模板整站下载怎么制作网站详细流程
  • 共享ip服务器做网站福建seo快速排名优化