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

南昌营销网站开发广州市网络seo外包

南昌营销网站开发,广州市网络seo外包,网站后台是怎样制作的,企业诚信建设网站上文是对el-table的基本封装&#xff0c;只能满足最简单的应用&#xff0c;本文主要是在上文的基础上增加slot插槽&#xff0c;并且对col插槽进行拓展&#xff0c;增加通用性 // BaseTable.vue <template><el-table><template v-for"name in tableSlots&…

上文是对el-table的基本封装,只能满足最简单的应用,本文主要是在上文的基础上增加slot插槽,并且对col插槽进行拓展,增加通用性

// BaseTable.vue

<template><el-table><template v-for="name in tableSlots" :key="name" #[name]><slot :name="name"></slot></template><el-table-column v-for="(col,index) in $attrs.config" :key="index" v-bind="col"><template v-if="col.slot" #[getColSlot(col)]="scope" ><slot :name="col.slot" v-bind="scope"></slot></template></el-table-column></el-table>
</template>
<script lang="ts" setup>
const slots=useSlots();
const tableSlots=computed(()=>{// 原生el-table插槽只有default,append,empty// 原生el-table-column插槽只有table插槽只有default,header// 这里将header单独处理,认为是col的插槽,从table插槽中排除return Object.keys(slots).filter(name=>name!=='header')
})
const getColSlot=(col)=>{return col.slot==='header'?'header':'default'
}
</script>

//index.vue

<template><BaseTable :config="config" :data="tableData" :style="{width:'800px'}"><template #status="scope"><el-text :type="scope.row.status.type ">{{ scope.row.status.content }}</el-text></template><template #btn="scope"><el-button type="primary">{{ scope.row.btn }}</el-button></template><!-- 如有多个类似slot,也可以用如下方式渲染 --><!-- <template  v-for="(col,index) in config.filter(item=>item.slot && item.slot!=='header')" :key="index" #[col.slot]="scope"><el-button type="primary">{{ scope.row.btn }}</el-button></template> --><template #header="scope"><el-button type="primary">{{ scope.column.label }}</el-button></template></BaseTable>
</template><script lang="ts" setup>
import BaseTable from './BaseTable.vue'
const config=[{type:'selection'},{prop: 'date',label:'日期',width:'180'},{prop: 'name',label:'姓名',},{prop: 'status',label:'状态',slot:'status',width:'180'},{prop: 'btn',label:'操作',slot:'btn',width:'180'},{prop: 'header',label:'按钮header',slot:'header',width:'180'},
];
const tableData = [{date: '2016-05-03',name: '张三',status:{content:'工作',type:'success'},btn: 'confirm',},{date: '2016-05-02',name: '李四',status:{content:'出差',type:'primary'},btn: 'confirm',},{date: '2016-05-04',name: '王五',status:{content:'休假',type:'danger'},btn: 'confirm',},
]
</script>
![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/dad5e7be52c84c12997da0829cdf9178.png)
http://www.wooajung.com/news/21455.html

相关文章:

  • 网站建设app长春网络推广优化
  • 寻找锦州网站建设免费seo技术教程
  • 建设网站技术公司电话广告推广策划方案
  • 网页游戏大全网址网站seo优化培训
  • 武汉官方网站建设广告主资源哪里找
  • 怎么把一个网站的信息都抓取下来中国新闻网发稿
  • 衡阳企业网站好用的网站推荐
  • 做网站推广的方法广州高端网站建设公司
  • 最好科技广州网站建设友情链接查询结果
  • 网站外链数怎么查百度提升排名
  • 做网站时的注册权起到什么作用公众号软文怎么写
  • 开发什么网站凡科建站网站
  • 微信网站改版价格高端网站建设公司排行
  • h5网站怎么做api对接安卓手机游戏优化器
  • 做网站一定要用cms广告文案
  • 个人征信查询网站seo优化检测
  • 大连企业网站建设定制关于seo如何优化
  • 网站开发电脑配置百度关键词价格怎么查询
  • 郑州做网站哪家便宜江苏免费关键词排名外包
  • 建立企业网站的目的和意义搜索引擎推广案例
  • wordpress内容分享微信南昌seo优化公司
  • 北京公司建设网站如何把网站推广
  • 网站建设有什么优点360收录入口
  • 扬州学做网站培训多少钱百度客服平台
  • 英迈思网站做不下去可以退款吗东莞新闻最新消息今天
  • 做网站增加流量全网热搜榜第一名
  • 万户做网站如何国外网站seo免费
  • 网站建设济南搜索关键词排名提升
  • wordpress termmeta青岛seo网站排名
  • 重庆专业做淘宝网站常德网站优化公司