⚠️本文为博客园首发文章,未获授权禁止转载
大家好,我是aehyok🎋,一个住在深圳城市的佛系码农🧚🏻♀️,如果你喜欢我的文章📚,可以通过点赞帮我聚集灵力⭐️。
个人github仓库地址: https:github.com/aehyok
本文讲解代码仓库地址 : https:github.com/aehyok/vue-qiankun 目前基于dev分支进行开发和测试
本demo已部署腾讯云 http://vue.tuokecat.com(服务器配置较低,如有访问比较慢,请耐心等待)
{
type:'checkbox',
},
{
type:'index',
},
{
prop: "title",
label: "标题",
align: "center",
},
{
prop: "createTime",
label: "创建时间",
align: "center",
dateFormat: "yyyy-MM-dd HH:mm:ss",
sortable: true
},
{
prop: "state",
label: "状态",
align: "center",
dictionary: [
{ code: 0, name: "待审核"},
{ code: 1, name: "已审核"},
{ code: 2, name: "审核中"},
]
},
{
prop:"custom",
label:"自定义",
align: "center",
html: (row, column) => {
return row.title==="编号3" ? `<span style="color: red;">${ row.remark }</span>`:`未定义`
}
}
最后一个字段 custom 可以通过配置html,自定义展示复杂的组件和样式介入
{
width: 200,
fixed: "right",
list: [
{
id: "1",
label: "查看",
type: "text",
show: true,
disabled: false,
method: (index, row, ss) => {
handleDetail(index, row, ss);
}
},
{
id: "2",
label: "删除",
type: "text",
show: true,
disabled: false,
method: (index, row) => {
handleDel(index, row);
}
}
]
}
其中的handleDetail和handleDel函数通过自定义实现业务对接即可。
```javascript
{
prop: "name",
label: "设施名称",
align: "center",
}
```
```javascript
{
type: "index"
}
```
```javascript
{
type: "checkbox"
}
```
```javascript
{
prop: "recorDate",
label: "返乡日期",
align: "center",
dateFormat: "yyyy-MM-dd"
},
```
```javascript
{
prop: "sex",
label: "性别",
align: "center",
dictionary:[
{
code: 1, name:'男',
},
{
code: 2, name:'女',
}
]
},
```
```javascript
{
prop: "",
label: "自定义",
align: "center",
html: (row, column) => {
return row.name==="集资球场" || row.address ==="22" ? `<span style="color: red;">${ row.address }</span>`:`222`
}
},
```
```javascript
{
prop: "image",
label: "自定义",
align: "center",
image:'image'
},
```
```javascript
{
prop: "image",
label: "自定义",
align: "center",
sortable: true
},
```
```javascript
{
prop: "image",
label: "自定义",
align: "center",
sortable: "custom", // 通过传递的search查询函数中添加了orders排序字段
}
```
......
https://github.com/aehyok/vue-qiankun 本文中不涉及到封装的组件代码,有关代码问题可以访问文章开头的微前端github demo 仓库,github仓库将会保持持续更新,不断优化小demo。
https://github.com/aehyok/2021 最后自己每天工作中的笔记记录仓库,主要以文章链接和问题处理方案为主。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有