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

网站设计与管理的软件数据分析网站html模板下载

网站设计与管理的软件,数据分析网站html模板下载,本地app怎么推广,朔州seo网站建设记录element-plus 表格的使用。方法、事件、属性的使用。因为是vue3的方式用到了const install getCurrentInstance();才能获取表格的相关信息 没解决怎么获取选中的行的行号,采用自己记的方式实习的。 利用row-class-name"setRowClass"实现样式的简单…

记录element-plus 表格的使用。方法、事件、属性的使用。因为是vue3的方式用到了const install = getCurrentInstance();才能获取表格的相关信息

没解决怎么获取选中的行的行号,采用自己记的方式实习的。

利用row-class-name="setRowClass"实现样式的简单设定

<template><h2>表格的方法、事件、属性的使用</h2><el-button type="primary" @click="setSelected">setSelected 1</el-button><el-button type="primary" @click="clearSelected">clearSelected</el-button><el-table ref="tableRef" :data="tableData" border style="width: 100%" highlight-current-row:row-class-name="setRowClass" @row-click="row_clicked"><el-table-column type="index" label="序号" width="100" /><el-table-column prop="date" label="Date" width="180" /><el-table-column prop="name" label="Name" width="180" /><el-table-column prop="address" label="Address" /></el-table>
</template><script lang="ts">
import { defineComponent, reactive, ref, getCurrentInstance, } from 'vue'export default {setup() {const install = getCurrentInstance();const tableRef = ref();const curIndex = ref(0);const tableData = reactive([{date: '2016-05-03',name: 'Tom',address: 'No. 189, Grove St, Los Angeles',},{date: '2016-05-02',name: 'Tom',address: 'No. 189, Grove St, Los Angeles',},{date: '2016-05-04',name: 'Tom',address: 'No. 189, Grove St, Los Angeles',},{date: '2016-05-01',name: 'Tom',address: 'No. 189, Grove St, Los Angeles',},]);function setSelected() {console.log('setSelected');curIndex.value = 1;install.refs.tableRef.setCurrentRow(tableData[1]);}function clearSelected() {console.log('clearSelected')//清除选中的项 用于单选表格,设定某一行为选中行, 如果调用时不加参数,则会取消目前高亮行的选中状态install.refs.tableRef.setCurrentRow();curIndex.value = -1;}function setRowClass(row) {// 把每一行的索引放进,自己记rowindexrow.row.my_index = row.rowIndex;if (row.rowIndex == curIndex.value) {return "myClass";}}function row_clicked(row, column, event) {//获取行号不行。。。。//利用自己记的my_index实现curIndex.value = row.my_index;console.log('row_clicked', row.my_index, row.date, row.name, row.address);}return { tableData, tableRef, curIndex, setSelected, clearSelected, setRowClass, row_clicked }},}
</script><!-- 
<script lang="ts" setup >
import { getCurrentInstance, reactive, ref } from 'vue'const install = getCurrentInstance();
const tableRef = ref();
const curIndex = ref(0);const tableData = reactive([{date: '2016-05-03',name: 'Tom',address: 'No. 189, Grove St, Los Angeles',},{date: '2016-05-02',name: 'Tom',address: 'No. 189, Grove St, Los Angeles',},{date: '2016-05-04',name: 'Tom',address: 'No. 189, Grove St, Los Angeles',},{date: '2016-05-01',name: 'Tom',address: 'No. 189, Grove St, Los Angeles',},
])function setSelected()
{console.log('setSelected');curIndex.value =  1;install.refs.tableRef.setCurrentRow(tableData[1]);}
function clearSelected()
{console.log('clearSelected')//清除选中的项 用于单选表格,设定某一行为选中行, 如果调用时不加参数,则会取消目前高亮行的选中状态install.refs.tableRef.setCurrentRow(); curIndex.value =  -1;
}function setRowClass(row)
{// 把每一行的索引放进,自己记rowindexrow.row.my_index = row.rowIndex;if (row.rowIndex == curIndex.value){return "myClass";}
}function row_clicked(row, column, event)
{//获取行号不行。。。。//利用自己记的my_index实现curIndex.value =  row.my_index;console.log('row_clicked',row.my_index, row.date,row.name,row.address);
}</script> 
--><style >
.myClass {background-color: rgb(16, 95, 95) !important;color: blueviolet;
}
</style>

http://www.yayakq.cn/news/371051/

相关文章:

  • 海外网站如何做用户实名认证专业的培训行业网站模板
  • 做店铺首页的网站建设工程交易服务中心
  • 舒城做网站西安大雁塔的来历
  • 怎么敲代码做网站在线crm厂商
  • 返利网站做鹊桥推广中国建筑官网采购平台
  • 合肥做网站的公司讯登百度关键词搜索排名多少钱
  • 企业网站建设需要注意什么个人公益网站怎么制作
  • 网站维护的主要工作专业网站建设服务报价
  • 一等一网站手机网站制作报价表
  • 网站 怎么做百度才能搜索出来查询友情链接
  • 怎么推广公司网站个人公众号做电影网站吗
  • 万网做网站给网站源码拓者设计室内设计官网首页
  • 163企业邮箱服务器信息流优化师职业规划
  • 专门做素菜的网站商城网站建设建议
  • 购物网站建设建站石家庄市环保局网站建设项目备案系统
  • c2c网站建设需求分析百度app推广方法
  • 广州手机模板建站高端品牌鞋子有哪些牌子
  • 网站建设 找vx cp5173谷歌可以绑定wordpress
  • 花店网站建设课程设计论文中山百度seo排名优化
  • 中国建设人才服务信息网是不是正规网站上海公司网站
  • 制作网站协议wordpress淘宝客模板下载
  • 一浪网站建设个人注册公司需要多少费用
  • 北京网站优化推广效果商务互联 网站
  • 沧州网站建设cztj电商网站开发公司哪家好
  • 开发网站私活简历制作网站免费
  • 网站怎么做音乐外链电影天堂网站用什么程序做的
  • 旅游电子商务网站规划书重庆有哪些科技骗子公司
  • 做网站创业怎么样网站制作费用价格表
  • 拱墅区做网站建设网站需要的安全设备
  • 门户网站百度百科建设有限公司