Skip to content

Commit 571ba78

Browse files
committed
feat: 优化模态框样式
1 parent 191375e commit 571ba78

File tree

6 files changed

+49
-14
lines changed

6 files changed

+49
-14
lines changed

src/assets/styles/base.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
@import "vars";
2+
23
body {
34
color: #515a6e;
45
}
6+
57
.search-form {
68
padding: 10px;
79
background-color: $gray;
@@ -28,6 +30,8 @@ body {
2830
color: #1f2d3d;
2931
}
3032
}
33+
34+
// 菜单收缩后展示养生师
3135
.el-menu--popup {
3236
z-index: 10002;
3337
.el-menu-item,
@@ -36,3 +40,11 @@ body {
3640
line-height: 42px;
3741
}
3842
}
43+
44+
.el-dialog {
45+
.el-dialog__body {
46+
min-height: 100px;
47+
max-height: 60vh;
48+
overflow: auto;
49+
}
50+
}

src/components/editTable/analyze.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/components/editTable/colRender.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
render (h, ctx) {
1515
const { row, index, column, render } = ctx.props;
16-
return render(h, { row, index, column });
16+
return render({ row, index, column });
1717
}
1818
};
1919
</script>

src/components/editTable/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
const editColumns = this.columns.map(col => {
7676
if ('editable' in col) {
7777
const { widget, trigger, ...rest } = col.editable;
78-
const render = (h, { row, column, index }) => {
78+
const render = ({ row, column, index }) => {
7979
const isEditing = this.editIds.includes(`${column.prop}_${index}`);
8080
return (
8181
<el-row type="flex" align="middle" gutter={16} class="edit-col">

src/mock/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ const tableTemplate = {
1212
id: '@id',
1313
name: '@cname',
1414
'age|1-100': 100,
15-
email: '@email'
15+
email: '@email',
16+
address: '@county(true)'
1617
}
1718
]
1819
};

src/views/editTable/index.vue

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,28 @@
11
<template>
2-
<edit-table
3-
:columns="columns"
4-
:tableData="tableData"
5-
>
6-
</edit-table>
2+
<div class="admin-table">
3+
<el-button
4+
class="json-button"
5+
type="primary"
6+
@click="dialogVisible=true"
7+
>
8+
查看当前表格数据
9+
</el-button>
10+
<edit-table
11+
:columns="columns"
12+
:tableData="tableData"
13+
>
14+
</edit-table>
15+
<el-dialog
16+
title="表格数据"
17+
:visible.sync="dialogVisible"
18+
@close="dialogVisible=false"
19+
>
20+
<el-card>
21+
<pre><code>{{tableData}}</code></pre>
22+
</el-card>
23+
</el-dialog>
24+
</div>
25+
726
</template>
827

928
<script>
@@ -34,17 +53,21 @@
3453
style: { width: '100px' }
3554
}
3655
},
37-
{ prop: 'email', label: '邮箱' }
56+
{ prop: 'email', label: '邮箱', width: '220' },
57+
{ prop: 'address', label: '地址' },
3858
],
39-
tableData: data.dataSource
59+
tableData: data.dataSource,
60+
dialogVisible: false
4061
};
4162
},
63+
computed: {}
4264
};
4365
</script>
4466

4567
<style lang="scss" scoped>
46-
.el-menu-vertical-demo:not(.el-menu--collapse) {
47-
width: 200px;
48-
min-height: 400px;
68+
.admin-table {
69+
.json-button {
70+
margin-bottom: 20px;
71+
}
4972
}
5073
</style>

0 commit comments

Comments
 (0)