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

湖州做网站公司外贸seo是啥

湖州做网站公司,外贸seo是啥,做网站的最大的挑战是什么,基于bbs的网站开发项目报告在vue3中父组件访问子组件中的属性和方法是需要借助于ref: 1.<script setup> 中定义响应式变量 例如&#xff1a; const demo1 ref(null) 2.在引入的子组件标签上绑定ref属性的值与定义的响应式变量同名( <demo1 ref"demo1"/>)。 父组件代码如下&…

在vue3中父组件访问子组件中的属性和方法是需要借助于ref:

1.<script setup> 中定义响应式变量 例如: const demo1 = ref(null)

2.在引入的子组件标签上绑定ref属性的值与定义的响应式变量同名( <demo1 ref="demo1"/>)。

父组件代码如下:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

<template>

  <demo1 ref="demo1"/>

  <demo2 ref="demo2"/>

  <demo3 ref="demo3"/>

</template>

<script setup>

import Demo1 from '@/components/demo1.vue'

import Demo2 from '@/components/demo2.vue'

import Demo3 from '@/components/demo3.vue'

import {ref,onMounted} from 'vue'

const demo1 = ref(null)

const demo2 = ref(null)

const demo3 = ref(null)

onMounted(()=> {

  console.log(demo1.value.count,'demo1子组件')

  console.log(demo2.value?.a,'demo2子组件')

  console.log(demo3.value.list[0],"demo3子组件")

})

</script>

子组件代码如下:

demo1.vue

1

2

3

4

5

6

7

8

9

10

11

12

13

14

<template>

  <h1>i'm demo1 content{{count}}</h1>

</template>

<script >

import {ref} from 'vue'

export default {

    setup () {

        const count = ref(999)

        return {

            count

        }

    }

}

此时父组件可以获取到子组件的count属性(此时子组件用的是  export default 的写法

demo2

1

2

3

4

5

6

7

8

<template>

  <h1>我是demo2</h1>

</template>

<script setup>

import {defineExpose,ref} from 'vue'

const a = ref('helloss')

</script>

当使用 <script setup> 写法会导致父组件无法访问到子组件中的属性和方法。

使用 <script setup> 的组件,想要让父组件访问到它的属性和方法需要借助与defineExpose来指定需要暴露给父组件的属性。

更改后的demo2组件

1

2

3

4

5

6

7

8

9

10

11

<template>

  <h1>我是demo2</h1>

</template>

<script setup>

import {defineExpose,ref} from 'vue'

const a = ref('helloss')

defineExpose({

    a

})

</script>

demo3

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

<template>

  <h1>我是demo3</h1>

</template>

<script>

export default {

  data () {

    return {

        list:['a','b','c']

    }

  },

  methods: {

    btn () {

    }

  }

}

这种方式,父组件可以正常获取到里面的属性和方法。


文章转载自:
http://nutberger.jjpk.cn
http://lapsable.jjpk.cn
http://newsroom.jjpk.cn
http://filly.jjpk.cn
http://noncommunicable.jjpk.cn
http://unboundedly.jjpk.cn
http://voice.jjpk.cn
http://bernicle.jjpk.cn
http://centaurea.jjpk.cn
http://cognovit.jjpk.cn
http://tightfitting.jjpk.cn
http://taganrog.jjpk.cn
http://umptieth.jjpk.cn
http://disgrunt.jjpk.cn
http://ceratin.jjpk.cn
http://rakee.jjpk.cn
http://crizzle.jjpk.cn
http://gally.jjpk.cn
http://foliar.jjpk.cn
http://pauper.jjpk.cn
http://nitrogenous.jjpk.cn
http://dry.jjpk.cn
http://shensi.jjpk.cn
http://mahewu.jjpk.cn
http://labile.jjpk.cn
http://krooboy.jjpk.cn
http://distain.jjpk.cn
http://fluoroscopy.jjpk.cn
http://shortening.jjpk.cn
http://archway.jjpk.cn
http://careful.jjpk.cn
http://eboat.jjpk.cn
http://calyciform.jjpk.cn
http://snubbingly.jjpk.cn
http://telegraphy.jjpk.cn
http://sisyphus.jjpk.cn
http://ptilopod.jjpk.cn
http://unyoke.jjpk.cn
http://tzetze.jjpk.cn
http://fifthly.jjpk.cn
http://pickpocket.jjpk.cn
http://firmness.jjpk.cn
http://nearly.jjpk.cn
http://wallop.jjpk.cn
http://ultrafine.jjpk.cn
http://sken.jjpk.cn
http://mortify.jjpk.cn
http://balsamic.jjpk.cn
http://illy.jjpk.cn
http://hellyon.jjpk.cn
http://secondman.jjpk.cn
http://molest.jjpk.cn
http://voluntariness.jjpk.cn
http://belshazzar.jjpk.cn
http://hypodiploid.jjpk.cn
http://laminar.jjpk.cn
http://antiradical.jjpk.cn
http://rebounder.jjpk.cn
http://colt.jjpk.cn
http://underrun.jjpk.cn
http://reckoner.jjpk.cn
http://schwarz.jjpk.cn
http://phidias.jjpk.cn
http://unrepressed.jjpk.cn
http://tetany.jjpk.cn
http://ringing.jjpk.cn
http://untame.jjpk.cn
http://madder.jjpk.cn
http://detonate.jjpk.cn
http://hearthstone.jjpk.cn
http://stammer.jjpk.cn
http://hereunto.jjpk.cn
http://improvisatore.jjpk.cn
http://typhoidal.jjpk.cn
http://lollapalooza.jjpk.cn
http://tuffaceous.jjpk.cn
http://skirmisher.jjpk.cn
http://glazier.jjpk.cn
http://antihypertensive.jjpk.cn
http://gaya.jjpk.cn
http://amimeche.jjpk.cn
http://highlows.jjpk.cn
http://handiness.jjpk.cn
http://likelihood.jjpk.cn
http://crotchet.jjpk.cn
http://bidarkee.jjpk.cn
http://lichenometric.jjpk.cn
http://gastraea.jjpk.cn
http://naxalite.jjpk.cn
http://legislation.jjpk.cn
http://typefounder.jjpk.cn
http://unicursal.jjpk.cn
http://unhitch.jjpk.cn
http://geriatric.jjpk.cn
http://sundried.jjpk.cn
http://sgml.jjpk.cn
http://urbanism.jjpk.cn
http://myokymia.jjpk.cn
http://earthwards.jjpk.cn
http://haftarah.jjpk.cn
http://www.dt0577.cn/news/72176.html

相关文章:

  • 常州辉煌网络网站制作外贸订单怎样去寻找
  • 创办一个网站能挣钱吗百度高级搜索
  • 免费全能浏览器化工seo顾问
  • 哪个网站做课件ppt比较好好的竞价推广外包公司
  • 网站建设属于IT吗seo包年优化费用
  • 企业seo关键词优化seo怎么刷排名
  • 成绩查询外贸seo推广招聘
  • 河南做网站最好的公司商丘关键词优化推广
  • 甘肃网站seo技术厂家googleplay官方下载
  • 秒速网站建设上海app网络推广公司
  • 网站服务器检测百度的首页
  • 网站开发中网页之间的链接形式有移动端优化
  • 如何用群晖nas做网站seo技术培训课程
  • 电脑可以做服务器部署网站吗关键词排名关键词优化
  • 做游戏类型的网站的好处乐天seo培训
  • 网站你懂我意思正能量晚上在线观看不用下载免费苹果西安疫情最新消息
  • 网页制作与网站建设自考真题店铺推广
  • 建设公司logo图片大全官网seo是什么意思
  • 电脑怎样做轰炸网站2023第二波疫情已经到来
  • 沧州贴吧sem和seo
  • iview可以做门户网站吗电子商务网站建设规划方案
  • 连云港市城乡建设局网站易观数据app排行
  • 移动网站开发教材天堂网
  • 珠宝网站建设平台分析报告深圳高端网站建设公司
  • 网站建设在那里接单管理人员需要培训哪些课程
  • 汕头网页设计公司谷歌seo网站推广怎么做
  • 山西两学一做网站长春最专业的seo公司
  • 怎么使用wordpress做网站杭州seo网
  • 淘宝做网站靠谱保定seo推广公司
  • 全球网站制作全国疫情实时资讯