<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>自定义分页表格案例</title>
<!-- <link rel="stylesheet" href="element-ui/element-ui-index.css">-->
<link rel="stylesheet" href="https://unpkg.com/element-ui@2.9.2/lib/theme-chalk/index.css">
</head>
<body>
<div id="app">
<table-page ref="table" multiple url="http://localhost:7593/data/dict/type/queryPage"
@cell-db-click="cellDbClick" @row-click="rowClick">
<template #column>
<el-table-column prop="createTime" label="日期" width="180"></el-table-column>
<el-table-column prop="typeName" label="姓名" width="180"></el-table-column>
<el-table-column prop="remark" label="地址"></el-table-column>
</template>
</table-page>
<el-button @click="getSelectedData" type="primary">获取多选表格选择数据</el-button>
<table-page ref="table2" multiple :data="data" @row-click="rowClick">
<template #column>
<el-table-column prop="date" label="日期" width="180"></el-table-column>
<el-table-column prop="name" label="姓名" width="180"></el-table-column>
<el-table-column prop="address" label="地址"></el-table-column>
</template>
</table-page>
<el-button @click="updateData" type="primary">更新表格数据</el-button>
</div>
<!--<script src="element-ui/jquery.js"></script>-->
<!--<script src="element-ui/vue2.6.14.js"></script>-->
<!--<script src="element-ui/element-ui-index.js"></script>-->
<script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.14/vue.min.js"></script>
<script src="https://unpkg.com/element-ui@2.9.2/lib/index.js"></script>
<script src="table-page.js"></script>
<script>
// Vue3 创建对象的写法
const app = new Vue({
el: '#app',
data() {
return {
data: [{
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
},{
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
},{
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
},{
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}]
}
},
methods: {
updateData() {
this.data = [{
date: '2023-05-02',
name: '赵云',
address: '北京市'
},{
date: '2023-05-02',
name: '赵云',
address: '北京市'
},{
date: '2023-05-02',
name: '赵云',
address: '北京市'
}]
},
cellDbClick(row, column, cell, event) {
console.log('当前列是:', row, column, cell, event)
},
rowClick(row) {
console.log('当前行是:',row);
},
getSelectedData() {
console.log('获取多选表格选择数据: ',this.$refs['table'].getSelectedData());
}
}
});
</script>
</body>
</html>
Mr.小朱同学
- 粉丝: 3w+
- 资源: 42
最新资源
- (源码)基于 JavaFX 和 MySQL 的影院管理系统.zip
- (源码)基于EAV模型的动态广告位系统.zip
- (源码)基于Qt的长沙地铁换乘系统.zip
- (源码)基于ESP32和DM02A模块的智能照明系统.zip
- (源码)基于.NET Core和Entity Framework Core的学校管理系统.zip
- (源码)基于C#的WiFi签到管理系统.zip
- (源码)基于WPF和MVVM框架的LikeYou.WAWA管理系统.zip
- (源码)基于C#的邮件管理系统.zip
- 【yan照门】chen冠希(1323张) [2月25日凌晨新增容祖儿全94张].rar.torrent
- (源码)基于C++的员工管理系统.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈