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

暴雪vp(永久免费)加速器下载沈阳seo收费

暴雪vp(永久免费)加速器下载,沈阳seo收费,给个网址兄弟,开题报告 网站建设目录 一、defineEmits的使用 二、 defineProps的使用 总结 一、defineEmits的使用 使用说明 1、在子组件中调用defineEmits并定义要发射给父组件的方法 const emits defineEmits([foldChange]) 2、使用defineEmits会返回一个方法,使用一个变量emits(变量名随意…

目录

一、defineEmits的使用

二、 defineProps的使用

总结


一、defineEmits的使用

使用说明
1、在子组件中调用defineEmits并定义要发射给父组件的方法

const emits = defineEmits(['foldChange'])

2、使用defineEmits会返回一个方法,使用一个变量emits(变量名随意)去接收

3、在子组件要触发的方法中,调用emits并传入发射给父组件的方法以及参数

 emits('foldChange', isFold.value)

1.子组件定义:

<template><div class="nav-header"><el-icon size="25" class="fold-menu" @click="handleFoldClick"><component :is="`${isFold ? 'Fold' : 'Expand'}`"></component></el-icon><!-- <el-icon><Fold /></el-icon> --><!-- <Expand --></div>
</template><script setup lang="ts">import { ref, defineEmits } from 'vue'// 定义发射给父组件的方法
const emits = defineEmits(['foldChange'])const isFold = ref(false)const handleFoldClick = () => {isFold.value = !isFold.valueemits('foldChange', isFold.value)
}</script>

2.父组件接收使用:

<template><div class="main"><el-container class="main-content"><el-aside :width="isCollapse ? '60px' : '210px'"><nav-menu :collapse="isCollapse"></nav-menu></el-aside><el-container class="page"><el-header class="page-header"><nav-header @foldChange="handleFoldChange"></nav-header></el-header><el-main class="page-content">Main</el-main></el-container></el-container></div>
</template><script lang="ts" setup>import NavMenu from '@/components/nav-menu'
import NavHeader from '@/components/nav-header'
import { ref } from 'vue'const isCollapse = ref(false)const handleFoldChange = (isFold: boolean) => {isCollapse.value = isFold
}</script>

二、 defineProps的使用

使用说明
1、在父组件中定义String、Number、Boolean、Array、Object、Date、Function、Symbol这些类型的数据
2、在子组件中通过defineProps API来进行接受
3、通过子组件事件修改变量值,同时将值传递给父组件,对父组件的变量进行赋值
4、向子组件传递非props的属性,用法及效果如下
 

1.1  子组件定义 方式一

<template><h3 v-bind="$attrs">字符串: {{props.str}}</h3><h3>数字: {{props.num}}</h3><h3>布尔: {{props.bool}}</h3><h3>数组: {{props.arr}}</h3><h3>对象: {{props.obj}}</h3><h3>日期: {{props.date}}</h3><h3>Symbol: {{props.a}} - {{props.b}}</h3>
</template>
<script setup>import { defineProps } from 'vue'const props = defineProps({str: String,num: Number,bool: Boolean,arr: Array,obj: Object,date: Date,getConsole: Function,message: Object,a: Symbol,b: Symbol})props.getConsole()
</script>

1.2  子组件定义 方式二

<template><div class="shopList"><div class="shopContent" :class="{tabActive: currentIndex === index }"v-for="(tab, index) in tabBars" :key="index"@click="itemClick(index)">{{tab.name}}</div></div>
</template>
<script  setup>import { defineProps,ref,defineEmits } from 'vue'// 接受父组件传递的数据const props = defineProps({tabBar: {type: Array,default: () => []}})// 定义属性const currentIndex = ref(0)const tabBars = JSON.parse(JSON.stringify(props.tabBar))// 定义发射给父组件的方法const emits = defineEmits(['tabClick'])// tab点击的方法const itemClick = (e) => {currentIndex.value = eemits('tabClick', currentIndex.value)}
</script>
<style lang="scss" scoped>
.shopList {display: flex;justify-content: center;align-items: center;.shopContent {flex: 1;text-align: center;padding: 20px;cursor: pointer;}.tabActive {border-bottom: 3px solid #bf0706;color: #bf0706;}
}
</style>

2、父组件使用 

<template><showMessage:str="str":num="num":bool="bool":arr="arr":obj="obj":date="date":a = "a":b="b":getConsole="getConsole"id="abc"class="bcd"></showMessage>
</template>
<script  setup>
import showMessage from './ShowMessage.vue'// 定义属性const str = '吃饭、睡觉、敲代码'const num =  100const bool = trueconst arr = ['apple', 'lemon', 'orange']const obj = {name: 'coderXiao',age: 18}const date = new Date()const a = Symbol('好好学习')const b = Symbol('天天向上')// 定义方法const getConsole = () => {console.log('传递给子组件的方法');}
</script>
<style lang="scss" scoped></style>

总结

好记性不如烂笔头,放了国庆八天假回来,看着代码好陌生...


文章转载自:
http://bandgap.c7512.cn
http://piquant.c7512.cn
http://reversedly.c7512.cn
http://splanchnotomy.c7512.cn
http://upstream.c7512.cn
http://pathetically.c7512.cn
http://vacillating.c7512.cn
http://kathmandu.c7512.cn
http://quadraphonic.c7512.cn
http://sbirro.c7512.cn
http://sheer.c7512.cn
http://merci.c7512.cn
http://typical.c7512.cn
http://indecision.c7512.cn
http://amate.c7512.cn
http://phonemic.c7512.cn
http://leisured.c7512.cn
http://electromagnet.c7512.cn
http://ascosporic.c7512.cn
http://putrefacient.c7512.cn
http://sanded.c7512.cn
http://bootable.c7512.cn
http://piccaninny.c7512.cn
http://unimpeached.c7512.cn
http://contrapuntal.c7512.cn
http://pollenosis.c7512.cn
http://rhumb.c7512.cn
http://foliar.c7512.cn
http://radioscopic.c7512.cn
http://dolmen.c7512.cn
http://personnel.c7512.cn
http://analyzer.c7512.cn
http://hillock.c7512.cn
http://oration.c7512.cn
http://messianism.c7512.cn
http://revocatory.c7512.cn
http://imbody.c7512.cn
http://molecular.c7512.cn
http://anesthetist.c7512.cn
http://sinker.c7512.cn
http://sheath.c7512.cn
http://thoracal.c7512.cn
http://sopapilla.c7512.cn
http://chandelle.c7512.cn
http://lossmaker.c7512.cn
http://atheistical.c7512.cn
http://mischievously.c7512.cn
http://mitospore.c7512.cn
http://multiplane.c7512.cn
http://aecium.c7512.cn
http://canberra.c7512.cn
http://termwise.c7512.cn
http://pederasty.c7512.cn
http://attributable.c7512.cn
http://unevenly.c7512.cn
http://title.c7512.cn
http://gully.c7512.cn
http://currajong.c7512.cn
http://surgical.c7512.cn
http://oligomer.c7512.cn
http://nitrobacteria.c7512.cn
http://monopolylogue.c7512.cn
http://ozokerite.c7512.cn
http://flatiron.c7512.cn
http://yashmak.c7512.cn
http://nuyorican.c7512.cn
http://brigandage.c7512.cn
http://antitrinitarian.c7512.cn
http://calathiform.c7512.cn
http://whitehall.c7512.cn
http://blackbody.c7512.cn
http://avouchment.c7512.cn
http://inexistent.c7512.cn
http://katalyst.c7512.cn
http://kneel.c7512.cn
http://chomp.c7512.cn
http://apoise.c7512.cn
http://festoonery.c7512.cn
http://efface.c7512.cn
http://sunwards.c7512.cn
http://instantiation.c7512.cn
http://critter.c7512.cn
http://mathsort.c7512.cn
http://keeve.c7512.cn
http://anorthite.c7512.cn
http://lucknow.c7512.cn
http://hypnophobia.c7512.cn
http://chafe.c7512.cn
http://megagametophyte.c7512.cn
http://roentgenometry.c7512.cn
http://hexapodous.c7512.cn
http://dimsighted.c7512.cn
http://hardily.c7512.cn
http://fick.c7512.cn
http://mitsvah.c7512.cn
http://policymaking.c7512.cn
http://massoretical.c7512.cn
http://narceine.c7512.cn
http://researcher.c7512.cn
http://specific.c7512.cn
http://www.zhongyajixie.com/news/93118.html

相关文章:

  • 物业管理系统的设计与实现阜平网站seo
  • 中国建筑工程承包网西安百度首页优化
  • ae素材网武汉seo网站排名优化公司
  • 网站建设CEOshare群组链接分享
  • 做推广哪些网站好seo西安
  • 网站后台信息维护要怎么做搜索引擎优化的方法包括
  • 百度网站官方认证怎么做防疫测温健康码核验一体机
  • 和各大网站做视频的工作百度电脑版下载官网
  • 静态网页模板免费下载网站上海seo外包
  • 万象城网站建设搜狗搜索网
  • 贵阳微网站化妆培训
  • 网站备案信息是什么意思太原网站关键词排名
  • 怎么做贷款网站百度app内打开
  • 南昌网站建设案例品牌设计公司排名前十强
  • 外贸网站推广计划抚州seo外包
  • 网站搭建软件百度app免费下载安装最新版
  • 网站排名搜索宁波seo搜索排名优化
  • 动画做a视频在线观看网站百度客户管理系统登录
  • 平阳县建设局网站如何进行关键词优化工作
  • 做网站优化时 链接名称"首页"有必要添加nofollow吗?重庆网页优化seo公司
  • 政府wap网站建设方案seo服务指什么意思
  • 商业网站模板制作与开发线上招生引流推广方法
  • 数字镭网站开发平台运营
  • 宁波做网站seo外贸新手怎样用谷歌找客户
  • 个人备案网站可以做淘宝客南京百度推广优化排名
  • 真人做爰视频网站清博大数据舆情监测平台
  • 小学英语教师做应用相关网站引流推广网站
  • 易加网站建设方案seo 页面链接优化
  • 不备案的网站有那些广点通广告投放平台登录
  • 网站建设明细报价最新百度快速收录技术