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

建立一个属于自己的网站seo排名哪家有名

建立一个属于自己的网站,seo排名哪家有名,浙江短视频seo优化网站,中英文网站建设公司最近ui有个设计稿#xff0c;表格要求如图#xff1a; 由于本地antd table列宽column没有设置最小宽度minWidth属性#xff0c;只有width属性#xff0c;所以开发时我考虑按照列宽等比例计算后去设置width属性#xff1b; 一、实现#xff1a; 1.表头数组中设置minWidth…最近ui有个设计稿表格要求如图 由于本地antd table列宽column没有设置最小宽度minWidth属性只有width属性所以开发时我考虑按照列宽等比例计算后去设置width属性 一、实现 1.表头数组中设置minWidth属性固定列操作栏直接写width属性即可 this.headerArr [{dataIndex: indexShortName,title: 指标名称,minWidth: 320,},{dataIndex: dataValue,title: 最新值,minWidth: 120,align: right,},{ dataIndex: unit, title: 单位, minWidth: 80 },{dataIndex: changePrice,title: 涨跌,minWidth: 100,scopedSlots: { customRender: changePrice },align: right,},{dataIndex: chgPercent,title: 涨跌幅,minWidth: 100,scopedSlots: { customRender: chgPercent },align: right,},{ dataIndex: dataDate, title: 数据日期, minWidth: 100 },{dataIndex: action,title: 操作,align: center,fixed: right,scopedSlots: { customRender: action },width: 118,},] 二、创建完表头数据后执行等比例列宽计算获取每列width 1.headerArr:表头数组 2.allwidth:表格所占宽度 3.fixedWidth:所有固定列总宽度 4.excludeList:不用计算的数组一般保留一列不去设置width,让它自适应即可 //headerArr:要处理的表头allWidth表格宽度fixedWidth固定列宽度excludeList排除不需要设置的序列autoHeader(headerArr, allWidth, fixedWidth, excludeList) {let autoWidth allWidth - fixedWidthlet bili headerArr.map((e) (e.minWidth ? e.minWidth : 0)).reduce((a, b) a b)headerArr.forEach((e, index) {if (!e.fixed) {if (excludeList excludeList.length 0) {if (!excludeList.includes(index)) {e.width autoWidth * (e.minWidth / bili)}} else {e.width autoWidth * (e.minWidth / bili)}}})return headerArr}, 三、执行完成后还需添加监听事件让表格列宽能够自适应并且动态显示滚动条 1.elementResizeDetectorMaker是监听组件此处监听表格父容器的宽度变化当宽度938时执行计算列宽等比函数当宽度938时表格显示横向滚动条表头数组直接写上width //响应页面宽度变化动态设置表头列宽this.erd elementResizeDetectorMaker()this.erd.listenTo(document.querySelector(.wrap), (element) {console.log(element, element.clientWidth)if (element.clientWidth 938) {this.headerArr this.autoHeader(this.headerArr,document.querySelector(.wrap).clientWidth,118,[0],)this.ScrollOBJ {}} else {this.ScrollOBJ { x: 938 }this.headerArr [{dataIndex: indexShortName,title: 指标名称,minWidth: 320,},{dataIndex: dataValue,title: 最新值,width: 120,minWidth: 120,align: right,},{ dataIndex: unit, title: 单位, width: 80, minWidth: 80 },{dataIndex: changePrice,title: 涨跌,width: 100,minWidth: 100,scopedSlots: { customRender: changePrice },align: right,},{dataIndex: chgPercent,title: 涨跌幅,width: 100,minWidth: 100,scopedSlots: { customRender: chgPercent },align: right,},{dataIndex: dataDate,title: 数据日期,width: 100,minWidth: 100,},{dataIndex: action,title: 操作,align: center,fixed: right,scopedSlots: { customRender: action },width: 118,},]}}) 四、全部代码如下 templatediv classwrapa-tableclassmyTable:class{ empty-table: !tableArr.length }iddefine-table:columnsheaderArr:data-sourcetableArr:localetablenodata:loadingloading:scrollScrollOBJ:paginationfalsev-iftableReashtemplate slotchangePrice slot-scopetext, recordspan:style{color:record.changePrice 0? #E25454: record.changePrice 0? #12A96E: }{{ record.changePrice }}/span/templatetemplate slotchgPercent slot-scopetext, recordspan:style{color:record.chgPercent 0? #E25454: record.chgPercent 0? #12A96E: }{{record.chgPercent 0? record.chgPercent %: record.chgPercent %}}/span/templatetemplate slotaction slot-scopetext, recordspan classadd-code clickaddCode(record)span classadd-code-img/span添加指标/span/template/a-table/div /template script import { Table } from ant-design-vue; import noResult from /components/no-result.vue; import elementResizeDetectorMaker from element-resize-detector; export default {components: {ATable: Table,no-result: noResult},data() {return {loading: false,headerArr: [],tableArr: [],ScrollOBJ: {},tradingDay: ,updateTime: ,commonHeight: ,tablenodata: {emptyText: no-result title暂无数据 sizesmall/no-result},tableReash: true,marginTopPx: 90};},mounted() {this.ScrollOBJ document.querySelector(.wrap).clientWidth 938 ? {} : { x: 938 };this.setHeader();//this.setScrollY()//响应页面宽度变化动态设置表头列宽this.erd elementResizeDetectorMaker();this.erd.listenTo(document.querySelector(.wrap), element {console.log(element, element.clientWidth);if (element.clientWidth 938) {this.headerArr this.autoHeader(this.headerArr,document.querySelector(.wrap).clientWidth,118,[0]);this.ScrollOBJ {};} else {this.ScrollOBJ { x: 938 };this.headerArr [{dataIndex: indexShortName,title: 指标名称,minWidth: 320},{dataIndex: dataValue,title: 最新值,width: 120,minWidth: 120,align: right},{ dataIndex: unit, title: 单位, width: 80, minWidth: 80 },{dataIndex: changePrice,title: 涨跌,width: 100,minWidth: 100,scopedSlots: { customRender: changePrice },align: right},{dataIndex: chgPercent,title: 涨跌幅,width: 100,minWidth: 100,scopedSlots: { customRender: chgPercent },align: right},{dataIndex: dataDate,title: 数据日期,width: 100,minWidth: 100},{dataIndex: action,title: 操作,align: center,fixed: right,scopedSlots: { customRender: action },width: 118}];}this.tableReash false;console.log(this.ScrollOBJ, this.ScrollOBJ);this.$nextTick(() {this.tableReash true;});});},methods: {//上游价格指数--设置表头setHeader() {this.headerArr [{dataIndex: indexShortName,title: 指标名称,minWidth: 320},{dataIndex: dataValue,title: 最新值,minWidth: 120,align: right},{ dataIndex: unit, title: 单位, minWidth: 80 },{dataIndex: changePrice,title: 涨跌,minWidth: 100,scopedSlots: { customRender: changePrice },align: right},{dataIndex: chgPercent,title: 涨跌幅,minWidth: 100,scopedSlots: { customRender: chgPercent },align: right},{ dataIndex: dataDate, title: 数据日期, minWidth: 100 },{dataIndex: action,title: 操作,align: center,fixed: right,scopedSlots: { customRender: action },width: 118}];this.tableArr [{indexShortName: Mysteel普钢价格指,dataValue: 3590.14,unit: 元/吨,changePrice: 5.87,chgPercent: 0.16,dataDate: 2024/10/28,indexCode: ID20128188},{indexShortName: Mysteel普钢价格指,dataValue: 3590.14,unit: 元/吨,changePrice: 5.87,chgPercent: 0.16,dataDate: 2024/10/28,indexCode: ID20128188},{indexShortName: Mysteel普钢价格指,dataValue: 3590.14,unit: 元/吨,changePrice: -5.87,chgPercent: -0.16,dataDate: 2024/10/28,indexCode: ID20128188},{indexShortName: Mysteel普钢价格指,dataValue: 3590.14,unit: 元/吨,changePrice: -5.87,chgPercent: -0.16,dataDate: 2024/10/28,indexCode: ID20128188},{indexShortName: Mysteel普钢价格指,dataValue: 3590.14,unit: 元/吨,changePrice: 5.87,chgPercent: 0.16,dataDate: 2024/10/28,indexCode: ID20128188},{indexShortName: Mysteel普钢价格指,dataValue: 3590.14,unit: 元/吨,changePrice: 5.87,chgPercent: 0.16,dataDate: 2024/10/28,indexCode: ID20128188}];this.tableArr [...this.tableArr, ...this.tableArr];//表头按比例设置宽度this.headerArr this.autoHeader(this.headerArr,document.querySelector(.wrap).clientWidth,118,[0]);},//headerArr:要处理的表头allWidth表格宽度fixedWidth固定列宽度excludeList排除不需要设置的序列autoHeader(headerArr, allWidth, fixedWidth, excludeList) {let autoWidth allWidth - fixedWidth;let bili headerArr.map(e (e.minWidth ? e.minWidth : 0)).reduce((a, b) a b);headerArr.forEach((e, index) {if (!e.fixed) {if (excludeList excludeList.length 0) {if (!excludeList.includes(index)) {e.width autoWidth * (e.minWidth / bili);}} else {e.width autoWidth * (e.minWidth / bili);}}});return headerArr;}} }; /script style langless scoped/style
http://www.pierceye.com/news/154307/

相关文章:

  • 教育类网站 前置审批重庆网站建设首选卓光
  • 宁波做网站哪家好个人做论坛网站怎么做
  • 公司网站建设北京电子设计工程期刊
  • 网站前端建设都需要什么c 网站开发案例详解
  • 无锡网站无忧网站建设
  • 最火高端网站设计厂家宁波新亚建设内部网站
  • 娱乐网站建设宁波网站建设多少钱一年
  • app制作器手机版下载网站关键词优化排名怎么做
  • 网站站外优化推广方式网站建设网站需要什么软件有哪些
  • 重庆建设厂招聘信息网站做坑网站需要
  • 光谷 网站建设公司海珠区住房和水务建设局网站
  • 公司做网站还是做appwordpress多文件传递变量
  • 网站教学苏州优化网站
  • 扁平化网站下载网站设计公司深圳
  • flash网站用什么做网站建设免费软件有哪些
  • 卖车网站投资网站建设
  • 网站开发过程 文档合肥婚恋网站建设
  • 网站自助建设目录更新 wordpress
  • 百度给做网站吗flash网站制作教程 下载
  • 化工销售怎么做网站wordpress 论坛功能
  • 网上做平面设计兼职不错的网站网站 seo优化
  • seo做的最好的网站设计专业
  • 顾家家居网站是哪个公司做的东莞软件有限公司
  • 云南做网站哪家好wordpress文章内多页效果
  • 上海做网站公司哪家好建筑公司有哪些部门和职位
  • 用front page2003做网站的导航条网站的站点建设分为
  • 开封网站建设zducmwordpress评论ajax
  • 电脑如何做网站空间西安网站建设sxyun
  • 济南历城区网站建设2022年没封网站直接进入
  • 平面设计和网站建设哪个好icp备案可以自己搞吗