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

设计网站专业汕头模板做网站

设计网站专业,汕头模板做网站,wordpress app 读者,博客营销后端接口传回的数据格式如下图 需要依靠后端传回的数据控制表格样式 实现代码 <!-- 可视化配置-表格 --> <template><div class"tabulation_main" ref"myDiv"><!-- 尝试过在mounted中使用this.$refs.myDiv.offsetHeight,获取父元素…

后端接口传回的数据格式如下图
在这里插入图片描述需要依靠后端传回的数据控制表格样式

实现代码

<!-- 可视化配置-表格 -->
<template><div class="tabulation_main" ref="myDiv"><!-- 尝试过在mounted中使用this.$refs.myDiv.offsetHeight,获取父元素高度赋值给height的方法,发现该值只能在created之前确定,且不为动态 --><el-table:data="tableData":stripe="tableStyleObj.tableStyle.stripe == 'true' ? true : false":row-style="rowStyleHandle":row-class-name="tableRowClassName":border="tableStyleObj.tableStyle.border == 'true' ? true : false"v-model:align="tableStyleObj.tableStyle.bodyTextAlign":show-header="tableStyleObj.tableStyle.showHeader == 'true' ? true : false":header-cell-style="{color: tableStyleObj.tableStyle.headerColor,'font-size': tableStyleObj.tableStyle.headerFontSize + 'px','text-align': tableStyleObj.tableStyle.headerTextAlign,}":header-row-class-name="headerRowClassName":height="tableStyleObj.tableStyle.tableHeight + ''"style="width: 100%"><!-- 固定序号列 --><el-table-columnv-if="tableStyleObj.tableStyle.isShowTableIndex == 'true' ? true : false":fixed="tableStyleObj.tableStyle.isTableIndexFixed == 'true' ? true : false"type="index":width="tableStyleObj.tableStyle.tableIndexWidth + ''"></el-table-column><el-table-columnv-for="(tableItem, tableIndex) in tableStyleObj.tableColStyle":key="tableIndex":prop="tableItem.prop":label="tableItem.label":width="tableItem.width + ''"></el-table-column></el-table></div>
</template><script>
export default {data() {return {tableStyleObj: {// 表格整体样式tableStyle: {},// 表格列配置tableColStyle: [],},tableData: [],};},props: {flatteningCurrentItemForm: {type: Object,default: () => {return {};},},},computed: {nthColor() {return this.tableStyleObj.tableStyle.nthColor;},othColor() {return this.tableStyleObj.tableStyle.othColor;},headerBackground() {return this.tableStyleObj.tableStyle.headerBackground;},},created() {// 获取表格配置this.tableStyleObj.tableStyle = this.flatteningCurrentItemForm.attributeCaseMap;this.tableStyleObj.tableColStyle = JSON.parse(this.flatteningCurrentItemForm.attributeCaseMap.tableColstyle);// 获取表格数据tableDataSource({dataSource: this.flatteningCurrentItemForm.dataSource,}).then((res) => {this.tableData = res.data;});},methods: {headerRowClassName({ row, rowIndex }) {return "head-row";},rowStyleHandle({ row, rowIndex }) {// rowIndex从0开始if (rowIndex % 2 == 0) {// 奇数行var obj = {"text-align": this.tableStyleObj.tableStyle.bodyTextAlign,color: this.tableStyleObj.tableStyle.bodyColor,"font-size": this.tableStyleObj.tableStyle.bodyFontSize + "px",};return obj;} else {// 偶数行var obj = {"text-align": this.tableStyleObj.tableStyle.bodyTextAlign,color: this.tableStyleObj.tableStyle.bodyColor,"font-size": this.tableStyleObj.tableStyle.bodyFontSize + "px",};return obj;}},tableRowClassName({ row, rowIndex }) {if (rowIndex % 2 == 0) {return "even-row";} else {return "odd-row";}},},
};
</script><style scoped lang="scss">
.tabulation_main {// 表格表头::v-deep(.el-table .el-table__header-wrapper th),::v-deep(.el-table .el-table__fixed-header-wrapper th) {background-color: v-bind("headerBackground") !important;}// 表格斑马纹::v-deep(.even-row td) {background-color: v-bind("nthColor") !important;}::v-deep(.odd-row td) {background-color: v-bind("othColor") !important;}::v-deep(.el-table) {background-color: v-bind("nthColor") !important;}
}
</style>
http://www.yayakq.cn/news/373543/

相关文章:

  • 网站信息化建设建议大理建设局网站
  • 营销网站建设企划案例定制网站收费
  • docker可以做网站吗共享备案网站
  • 阿里云搭建企业网站做视频网站视频存放在哪里
  • 广告策划活动公司海淀区seo搜索优化
  • 查看网站注册信息为该网站做自适应
  • 网站开发前端库长沙市建设工程集团有限公司
  • 的广州建网站的公司网站项目建设管理
  • 微网站建设的现状wordpress伤感主页
  • 在哪买网站链接怎么用电脑做网站服务器吗
  • 西安网站建设网络公司熊掌号网站改了title 删除百度就的收录
  • 建设银行网站不能登录密码错误怎么查网站的备案号
  • 做网站需要给设计提供可以自己做网站的网址
  • 河南新乡做网站公司哪家好做网站就上凡科建设
  • 长春网站建设同信搜索引擎优化包括( )方面的优化
  • ppt做书模板下载网站上海百度公司总部地址
  • 商务网站设计报告管理咨询有限公司
  • 网站运营岗位职责描述企业的网站建设文章
  • 合肥制作网站企业点开图片跳到网站怎么做的
  • 九江专业制作网站小程序软件开发需要学什么专业好
  • 深圳凡科网站建设wordpress副标题字数
  • 电子商务网站建设与管理第二版答案如何做logo标志
  • 建站宝盒是什么wordpress选项下拉
  • 做网站的图片尺寸怎么设定100M家用宽带可做网站服务器吗
  • 网站开发可行性研究报告浙江华企 做网站怎么样
  • 全国住房城乡建设厅网站wordpress添加作者名字
  • 做翻糖的网站wordpress新增标题
  • 展示型网站建设多少钱从网站下载壁纸做海报涉及
  • 有哪些可以免费推广的网站毕业设计网站做几个
  • 网站代运营性价比高哪里有网站建设定制