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

怎么去投诉做网站的公司广州网站建设方案优化

怎么去投诉做网站的公司,广州网站建设方案优化,站长工具高清吗,企业网站建设报价方案模板滚动表格封装 我们先设定接收的参数 需要表头内容columns,表格数据data,需要currentSlides来控制当前页展示几行 const props defineProps({// 表头内容columns: {type: Array,default: () > [],required: true,},// 表格数据data: {type: Array,d…
滚动表格封装
  1. 我们先设定接收的参数
    需要表头内容columns,表格数据data,需要currentSlides来控制当前页展示几行
const props = defineProps({// 表头内容columns: {type: Array,default: () => [],required: true,},// 表格数据data: {type: Array,default: () => [],},// 当前一页显示几行,超过几行开始滚动currentSlides: {type: Number,default: 5}
});
  1. 写好表格基本样式(这个不通用,可根据需求自行调整)
  2. 表格通常会有操作列,那么我们通过slot来实现,传递当前行的数据item,提供给点击事件
<slot v-if="props.columns[index].slot" :name="props.columns[index].name" :item="item"  />
  1. 封转滚动文字组件,文字超出则滚动显示
    详情可参考另一篇文章戳这里
<HorseRaceLamp:width="props.columns[index].width"font="14px AppleSystemUIFont":text="item[val]":speed="((item[val] && item[val].length) ? item[val].length : 1) * 0.5"
/>

表格完整代码如下:

<template><div class="table"><div class="row thead"><div v-for="item in props.columns" :key="item.name" :style="{ width: `${item.width}px` }">{{ item.label }}</div></div><div class="tbody"><Swiper :modules="modules" :autoplay="swiperOption.autoplay" direction="vertical" :slides-per-view="currentSlides" :space-between="11"><SwiperSlide v-for="(item, ind) in props.data" :key="ind" class="row"><template v-for="(val, index) in columnKeys"><slot v-if="props.columns[index].slot" :name="props.columns[index].name" :item="item"  /><div :title="item[val]" v-else :key="`${index}${val}`" :style="{ width: `${props.columns[index].width}px` }"><HorseRaceLamp:width="props.columns[index].width"font="14px AppleSystemUIFont":text="item[val]":speed="((item[val] && item[val].length) ? item[val].length : 1) * 0.5"/></div></template></SwiperSlide></Swiper></div></div>
</template><script setup>
import { ref, reactive } from 'vue';
import { Swiper, SwiperSlide } from "swiper/vue";
import { Autoplay } from "swiper";
import "swiper/css";
import HorseRaceLamp from '@/components/HorseRaceLamp.vue';const modules = [Autoplay];
const swiperOption = reactive({autoplay: {delay: 3000,disableOnInteraction: false,pauseOnMouseEnter: true,},
});const props = defineProps({// 表头内容columns: {type: Array,default: () => [],required: true,},// 表格数据data: {type: Array,default: () => [],},// 当前一页显示几行,超过几行开始滚动currentSlides: {type: Number,default: 5}
});
const columnKeys = ref([]);columnKeys.value = props.columns.map((item) => item.name);
</script><style lang="scss" scoped>
.table {width: 100%;height: 100%;color: #fff;font-size: 14PX;font-family: AppleSystemUIFont;.thead {background-color: rgb(21 77 160 / 20%);&.row {color: rgba(212, 237, 253, 1);font-size: 12PX;}}.row {display: flex;align-items: center;height: 28PX;padding: 0 30PX;> div {overflow: hidden;width: 100%;margin-right: 10PX;text-align: center;text-overflow: ellipsis;white-space: nowrap;&:nth-last-of-type(1) {margin-right: 0;}}}.swiper {width: 100%;height: 100%;}.tbody {box-sizing: border-box;width: 100%;height: calc(100% - 28PX);padding-top: 11PX;.row {position: relative;display: flex;align-items: center;cursor: pointer;}}
}
</style>

使用方式:

  • 需要给Table组件包裹一个父元素,自定义设置其宽高
<div class="content"><Table :columns="columns" :data="tableData" :currentSlides="6"><template #handler="{ item }"><div class="btn" @click="close(item)">关闭</div></template></Table></div>
// 需要传递的参数
const tableData = ref([])
const columns = [{ name: 'redRank', label: '红榜', width: 148 },{ name: 'blackRank', label: '黑榜', width: 148 },{ name: 'handler', label: '操作', slot: true },
];
// 自定义slot插槽操作事件
const close = (item) => {console.log(item)
}
  • 设置其宽高
.content {width: 446px;height: 250px;
}
http://www.hkea.cn/news/643031/

相关文章:

  • 建网站的专业公司推广网站多少钱
  • 网站不去公安局备案自己怎么搭建网站
  • 外贸网站建设入门深圳网络推广哪家
  • 网站模板资源公司网站推广
  • 广东省建设教育协会官方网站首页html简单网页代码
  • 个人网站意义阿里指数官网最新版本
  • 网站开发方式有哪四种搜索引擎优化课程总结
  • 申请做网站、论坛版主app推广接单
  • 青海网站建设广州seo优化推广
  • 物流公司网站制作模板上海网站关键词排名
  • 广西建设人才网搜索引擎优化的目标
  • 比汉斯设计网站素材图片搜索识图入口
  • php网站架设教程英雄联盟韩国
  • 做毕设好的网站百度客服电话24小时
  • 上海手机网站建设电话咨询seo综合查询系统
  • wordpress 4.6 中文版沈阳seo
  • 文件管理软件天津搜索引擎优化
  • 九亭网站建设全国疫情高峰时间表最新
  • 青岛网站建设公司武汉seo收费
  • mvc网站建设的实验报告怎么做优化
  • 有官网建手机网站千锋教育培训多少钱费用
  • b2c交易模式的网站有哪些百度营销客户端
  • flash 学习网站重庆网站seo多少钱
  • 年终总结ppt模板免费下载网站小红书seo排名规则
  • 自己架设网站口碑营销的产品有哪些
  • 湖北省网站备案最快几天天津百度推广排名优化
  • app在线开发制作平台seo网络优化前景怎么样
  • 商务网站的基本情况网站建设工作总结
  • 山西建设厅网站网络销售怎么聊客户
  • 软装素材网站有哪些seo网络排名优化哪家好