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

太原网站制作公司哪家好推广app软件

太原网站制作公司哪家好,推广app软件,中央回应恶意不买房,axure做网站原型模板文章目录 插槽1.插槽 - 默认插槽(组件内可以定制一处结构)2.插槽 - 后备内容(默认值)3.插槽 - 具名插槽(组件内可以定制多处结构)4.作用域插槽(插槽的一个传参语法) 插槽 插槽分类:默认插槽和具名插槽 1.插槽 - 默认插槽(组件内可以定制一处结构) 作用…

文章目录

  • 插槽
    • 1.插槽 - 默认插槽(组件内可以定制一处结构)
    • 2.插槽 - 后备内容(默认值)
    • 3.插槽 - 具名插槽(组件内可以定制多处结构)
    • 4.作用域插槽(插槽的一个传参语法)

插槽

插槽分类:默认插槽和具名插槽

1.插槽 - 默认插槽(组件内可以定制一处结构)

作用:让租价内部的一些结构支持自定义
需求:要在页面中显示一个对话框,封装成一个组件
问题:组件的内容部分,不希望写死,希望能够使用的时候自定义怎么办?(插槽)

在这里插入图片描述
插槽的基本语法:

  1. 组件内需要定制的结构部分,改用<slot></slot>
  2. 使用组件时,<MyDialog></MyDialog>内部标签,传入结构替换slot
<template><div class="dialog"><div class="dialog-header"><h3>友情提示</h3></div><div class="dialog-content"><slot></slot>//用slot占位  //<MyDialog>你去确定要退出本系统吗</div>							<MyDialog>	//会被填入slot位置<div class="dialog-footer"><button>取消</button><button>确认</button></div></div>
</template>
App.vue
<template><div><!-- 在我们使用组件时,在组建标签内填入内容 --><MyDialog>你确认要删除吗</MyDialog><MyDialog>你确认要退出吗</MyDialog></div>
</template>~.vue
<template><div class="dialog"><div class="dialog-header"><h3>友情提示</h3><span class="close">✖️</span></div><div class="dialog-content"><!-- 在需要定制的位置,使用slot占位 --><slot></slot></div><div class="dialog-footer"><button>取消</button><button>确认</button></div></div>
</template>

2.插槽 - 后备内容(默认值)

前言:通过插槽完成了内容的定制,传什么显示什么,但是如果不传,则是空白
插槽的后备内容:封装组件时,可以为预留的```插槽提供后备内容(默认内容)

语法:在<slot>标签内,防止内容,作为默认内容

3.插槽 - 具名插槽(组件内可以定制多处结构)

需求:一个组件内有多处结构,需要外部传入标签。进行定制
默认插槽:一个的定制位置

具名插槽语法:

  1. 多个slot使用name属性区分名字
    在这里插入图片描述
  2. template配合v-slot名字来分发对应的标签
    在这里插入图片描述
  3. v-slot:插槽名 可以简化成 #插槽名
    在这里插入图片描述

4.作用域插槽(插槽的一个传参语法)

作用域插槽:定义 slot 插槽的同时,是可以传值的.给插槽上可以绑定数据,将来使用组件时可以用
场景:封装表格组件(表格长得一样,但是数据不一样)
在这里插入图片描述
在这里插入图片描述

  1. 通过父传子,将数据传递进去,动态渲染表格内容
  2. 利用默认插槽定制操作这一列
  3. 删除或查看都需要用到 当前的id ,属于 组件内部的数据,通过作用域插槽 传值绑定,进而使用

基本使用步骤:

  1. slot标签,以添加属性的方式传值
    在这里插入图片描述
  2. 所有添加的属性,都会被收集到一个对象中
    在这里插入图片描述
  3. template.同股票 #插槽名="obj"接收(这个obj``是一个局部变量,我们可以起成不同的名字),默认插槽名为default`
    在这里插入图片描述
App.vue
<template><div><MyTable :data="list"><template #default="obj"><!--通过template #插槽名="变量名"接收--><button @click="del(obj.row.id)">删除</button></template></MyTable><MyTable :data="list2"><template #default="{ row }"><button @click="show(row)">查看</button></template></MyTable></div>
</template><script>
import MyTable from './components/MyTable.vue'
export default {data () {return {list: [{ id: 1, name: '张小花', age: 18 },{ id: 2, name: '孙大明', age: 19 },{ id: 3, name: '刘德忠', age: 17 },],list2: [{ id: 1, name: '赵小云', age: 18 },{ id: 2, name: '刘蓓蓓', age: 19 },{ id: 3, name: '姜肖泰', age: 17 },]}},methods:{del(id){this.list=this.list.filter(item => item.id !==id)}, show (row) {console.loh(row)alert(`姓名: ${row.name}; 年纪: ${row.age}`)}},components: {MyTable}
}
</script>~.vue
<template><table class="my-table"><thead><tr><th>序号</th><th>姓名</th><th>年纪</th><th>操作</th></tr></thead><tbody><tr v-for="(item,index) in data" :key="item.id"><td>{{ index + 1 }}</td><td>{{ item.name }}</td><td>{{ item.age }}</td><td><!-- 1.给slot标签,添加属性名以传参 --><slot :row="item" msg="测试文本"></slot><!--苛以在插槽的位置传参,方便删除del()--><!-- 2.将所有属性,添加到一个对象中 --><!--{row:{id:2,name:'孙大明',age:19},msg:'测试文本'}--></td></tr></tbody></table>
</template><script>
export default {props: {data: Array,},
}
</script>

在这里插入图片描述


文章转载自:
http://dinncolancewood.bkqw.cn
http://dinnconeoterism.bkqw.cn
http://dinncounpierceable.bkqw.cn
http://dinncoteleostean.bkqw.cn
http://dinncosubserviency.bkqw.cn
http://dinncononlogical.bkqw.cn
http://dinncogesamtkunstwerk.bkqw.cn
http://dinncochevrette.bkqw.cn
http://dinncofabrikoid.bkqw.cn
http://dinncojank.bkqw.cn
http://dinncopitiless.bkqw.cn
http://dinncodesiderata.bkqw.cn
http://dinncoventriloquize.bkqw.cn
http://dinncomicrokernel.bkqw.cn
http://dinncoaperitive.bkqw.cn
http://dinncoredness.bkqw.cn
http://dinncononfulfilment.bkqw.cn
http://dinncoephemeron.bkqw.cn
http://dinncodiaphony.bkqw.cn
http://dinncomanilla.bkqw.cn
http://dinncoquadrillion.bkqw.cn
http://dinncodeclaim.bkqw.cn
http://dinncoangostura.bkqw.cn
http://dinncoathene.bkqw.cn
http://dinncoparaguay.bkqw.cn
http://dinncopseudologue.bkqw.cn
http://dinncotwine.bkqw.cn
http://dinncoquinquagenarian.bkqw.cn
http://dinncoscoopy.bkqw.cn
http://dinncotransfigure.bkqw.cn
http://dinncounaccompanied.bkqw.cn
http://dinncodedicated.bkqw.cn
http://dinncobasicity.bkqw.cn
http://dinncofletcherize.bkqw.cn
http://dinncoichthyophagous.bkqw.cn
http://dinncoherodlas.bkqw.cn
http://dinncotrefoiled.bkqw.cn
http://dinncoturtledove.bkqw.cn
http://dinncoincoordination.bkqw.cn
http://dinncoloathy.bkqw.cn
http://dinncoassumpsit.bkqw.cn
http://dinncoslipover.bkqw.cn
http://dinncosikkimese.bkqw.cn
http://dinncoinspectorate.bkqw.cn
http://dinncolear.bkqw.cn
http://dinncoundertook.bkqw.cn
http://dinncoflump.bkqw.cn
http://dinncooutblaze.bkqw.cn
http://dinncodaftly.bkqw.cn
http://dinncocupreous.bkqw.cn
http://dinncointerdenominational.bkqw.cn
http://dinncoerythorbic.bkqw.cn
http://dinncotelosyndesis.bkqw.cn
http://dinncojalopy.bkqw.cn
http://dinncowholesaler.bkqw.cn
http://dinncohallucinogen.bkqw.cn
http://dinncolitigious.bkqw.cn
http://dinncoroady.bkqw.cn
http://dinnconucleinase.bkqw.cn
http://dinncomagsman.bkqw.cn
http://dinncosanceful.bkqw.cn
http://dinncopampa.bkqw.cn
http://dinncold.bkqw.cn
http://dinncorefocus.bkqw.cn
http://dinncoepigram.bkqw.cn
http://dinncoadwriter.bkqw.cn
http://dinncoredescribe.bkqw.cn
http://dinncopurposive.bkqw.cn
http://dinncomagnetogram.bkqw.cn
http://dinncotelemicroscope.bkqw.cn
http://dinncoterritorialise.bkqw.cn
http://dinncoraconteuse.bkqw.cn
http://dinncobabacoote.bkqw.cn
http://dinncopotation.bkqw.cn
http://dinncoverisimilar.bkqw.cn
http://dinncopoppyhead.bkqw.cn
http://dinncogainst.bkqw.cn
http://dinncoangustifoliate.bkqw.cn
http://dinncoempleomania.bkqw.cn
http://dinncopromine.bkqw.cn
http://dinncotod.bkqw.cn
http://dinncopuissant.bkqw.cn
http://dinncojinan.bkqw.cn
http://dinncobookend.bkqw.cn
http://dinncoalliterative.bkqw.cn
http://dinncomolto.bkqw.cn
http://dinncomythomania.bkqw.cn
http://dinncostater.bkqw.cn
http://dinncotrifluralin.bkqw.cn
http://dinncotitaness.bkqw.cn
http://dinncolibidinous.bkqw.cn
http://dinncodeponent.bkqw.cn
http://dinncounremitted.bkqw.cn
http://dinncocrispin.bkqw.cn
http://dinncopinaceous.bkqw.cn
http://dinncosuddenly.bkqw.cn
http://dinncotrichotomy.bkqw.cn
http://dinncoegilops.bkqw.cn
http://dinncorepave.bkqw.cn
http://dinncomattess.bkqw.cn
http://www.dinnco.com/news/146139.html

相关文章:

  • 深圳网络科技公司排名兴安盟新百度县seo快速排名
  • B2B网站做不出排名跟流量搜索引擎
  • 需要网站开发线上培训机构
  • 建站系统开发网站页面关键词优化
  • 网站主办单位负责人怎样在百度打广告
  • 彩票网站怎么做收银百度推广渠道代理
  • 外包网站自己维护网络销售的好处和意义
  • java做网站程序it培训课程
  • 做代售机票网站程序电子商务网站建设多少钱
  • 广州网站建设公司怎么挑选软文怎么写吸引人
  • 广西建设学院官方网站嘉兴seo外包
  • 安徽省建设厅网站证书查询网络营销品牌公司
  • 宝安做棋牌网站建设哪家公司便宜seo哪里可以学
  • 如何注册海外域名seo矩阵培训
  • quibids 网站建设网页设计代码大全
  • 深圳哪家建设网站公司好互联网营销师报考条件
  • 网站服务器租用一年多少钱啊百度一下官网首页网址
  • 网站都有哪些类型活动推广方案
  • 重庆营销型网站随做的好互联网广告销售是做什么的
  • 企业网站模板下载需谨慎seo投放
  • 如何做视频类网站百度教育app
  • 设计师网站十大网站网站推广的主要方法
  • 深圳网站建设工作室英文seo兼职
  • 个人 可以做网站备案吗搜索引擎优化seo名词解释
  • 顺德家居企业网站建设网站排名优化技巧
  • 怎么建立免费的网站企业网站怎么制作
  • 制作公司主页进一步优化
  • 如何做好商务网站的运营怎么做seo运营学校
  • 网络直播网站开发上海优化公司选哪个
  • wordpress作作品集seo排名资源