Skip to content

Commit b836281

Browse files
author
sosout
committed
用户管理
1 parent bed22cd commit b836281

File tree

5 files changed

+101
-8
lines changed

5 files changed

+101
-8
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,6 @@ yarn test
8080
### 访问
8181
在浏览器地址栏输入[http://localhost:8080/](http://localhost:8080/)
8282

83-
# vuex简单应用
83+
## vuex简单应用
84+
85+
## vue自定义组件

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
},
1515
"dependencies": {
1616
"element-ui": "^1.4.1",
17+
"loading-vue": "^0.0.2",
1718
"store": "^2.0.12",
1819
"three": "^0.86.0",
1920
"vue": "^2.3.3",

src/components/layout/consoleNavbar.vue

-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ export default {
8888
},
8989
computed: {
9090
defaultActive: function() {
91-
console.log(this.$route.path);
9291
return this.$route.path;
9392
}
9493
}

src/page/user/user.vue

+71-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,81 @@
11
<template>
2-
<div class="hello">用户管理</div>
2+
<el-table
3+
:data="tableData"
4+
border
5+
style="width: 100%">
6+
<el-table-column
7+
label="日期"
8+
width="180">
9+
<template scope="scope">
10+
<el-icon name="time"></el-icon>
11+
<span style="margin-left: 10px">{{ scope.row.date }}</span>
12+
</template>
13+
</el-table-column>
14+
<el-table-column
15+
label="姓名"
16+
width="180">
17+
<template scope="scope">
18+
<el-popover trigger="hover" placement="top">
19+
<p>姓名: {{ scope.row.name }}</p>
20+
<p>住址: {{ scope.row.address }}</p>
21+
<div slot="reference" class="name-wrapper">
22+
<el-tag>{{ scope.row.name }}</el-tag>
23+
</div>
24+
</el-popover>
25+
</template>
26+
</el-table-column>
27+
<el-table-column label="操作">
28+
<template scope="scope">
29+
<el-button
30+
size="small"
31+
@click="handleEdit(scope.$index, scope.row)">编辑</el-button>
32+
<el-button
33+
size="small"
34+
type="danger"
35+
@click="handleDelete(scope.$index, scope.row)">删除</el-button>
36+
</template>
37+
</el-table-column>
38+
</el-table>
339
</template>
440

541
<script>
42+
import { Table, TableColumn, Icon, Popover, Tag, Button } from 'element-ui';
643
export default {
7-
name: 'User',
44+
components: {
45+
ElTable: Table,
46+
ElTableColumn: TableColumn,
47+
ElIcon: Icon,
48+
ElPopover: Popover,
49+
ElTag: Tag,
50+
ElButton: Button
51+
},
852
data () {
953
return {
10-
54+
tableData: [{
55+
date: '2017-08-06',
56+
name: 'sosout',
57+
address: '浙江省杭州市滨江区'
58+
}, {
59+
date: '2017-08-06',
60+
name: 'sosout',
61+
address: '浙江省杭州市滨江区'
62+
}, {
63+
date: '2017-08-06',
64+
name: 'sosout',
65+
address: '浙江省杭州市滨江区'
66+
}, {
67+
date: '2017-08-06',
68+
name: 'sosout',
69+
address: '浙江省杭州市滨江区'
70+
}]
71+
}
72+
},
73+
methods: {
74+
handleEdit(index, row) {
75+
console.log(index, row);
76+
},
77+
handleDelete(index, row) {
78+
console.log(index, row);
1179
}
1280
}
1381
}

yarn.lock

+26-3
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,12 @@ [email protected]:
200200
version "1.6.9"
201201
resolved "https://registry.yarnpkg.com/async-validator/-/async-validator-1.6.9.tgz#a8309daa8b83421cdbd4628e026d6abb25192d34"
202202

203+
async-validator@^1.7.1:
204+
version "1.7.1"
205+
resolved "https://registry.yarnpkg.com/async-validator/-/async-validator-1.7.1.tgz#89d3d7a384ca5d05e0f07bf51754d591e2cfec61"
206+
dependencies:
207+
babel-runtime "6.x"
208+
203209
[email protected], async@^1.4.0:
204210
version "1.5.2"
205211
resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a"
@@ -782,7 +788,7 @@ babel-register@^6.22.0, babel-register@^6.24.1:
782788
mkdirp "^0.5.1"
783789
source-map-support "^0.4.2"
784790

785-
babel-runtime@^6.18.0, babel-runtime@^6.22.0:
791+
babel-runtime@6.x, babel-runtime@^6.18.0, babel-runtime@^6.22.0:
786792
version "6.23.0"
787793
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b"
788794
dependencies:
@@ -1393,7 +1399,7 @@ copy-webpack-plugin@^4.0.1:
13931399
minimatch "^3.0.0"
13941400
node-dir "^0.1.10"
13951401

1396-
core-js@^2.2.0, core-js@^2.4.0:
1402+
core-js@^2.2.0, core-js@^2.4.0, core-js@^2.4.1:
13971403
version "2.4.1"
13981404
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e"
13991405

@@ -1655,7 +1661,7 @@ deep-is@~0.1.3:
16551661
version "0.1.3"
16561662
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
16571663

1658-
deepmerge@^1.2.0:
1664+
deepmerge@^1.2.0, deepmerge@^1.5.0:
16591665
version "1.5.0"
16601666
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-1.5.0.tgz#00bc5b88fd23b8130f9f5049071c3420e07a5465"
16611667

@@ -3178,6 +3184,10 @@ loader-utils@^1.0.2, loader-utils@^1.1.0:
31783184
emojis-list "^2.0.0"
31793185
json5 "^0.5.0"
31803186

3187+
loading-vue@^0.0.2:
3188+
version "0.0.2"
3189+
resolved "https://registry.yarnpkg.com/loading-vue/-/loading-vue-0.0.2.tgz#34029a6d08ed3e98bfdf1d52dac436da3e200754"
3190+
31813191
locate-path@^2.0.0:
31823192
version "2.0.0"
31833193
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e"
@@ -4020,6 +4030,10 @@ pkg-dir@^2.0.0:
40204030
dependencies:
40214031
find-up "^2.1.0"
40224032

4033+
popper.js@^0.6.4:
4034+
version "0.6.4"
4035+
resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-0.6.4.tgz#1837c4760af54d2bb20b66f9c09b92993d84c629"
4036+
40234037
postcss-calc@^5.2.0:
40244038
version "5.3.1"
40254039
resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-5.3.1.tgz#77bae7ca928ad85716e2fda42f261bf7c1d65b5e"
@@ -5458,6 +5472,15 @@ vuex@^2.3.1:
54585472
version "2.3.1"
54595473
resolved "https://registry.yarnpkg.com/vuex/-/vuex-2.3.1.tgz#cde8e997c1f9957719bc7dea154f9aa691d981a6"
54605474

5475+
vuui@^1.0.5:
5476+
version "1.0.5"
5477+
resolved "https://registry.yarnpkg.com/vuui/-/vuui-1.0.5.tgz#09c8345160d46329ea5d851d558f5f9132814152"
5478+
dependencies:
5479+
async-validator "^1.7.1"
5480+
core-js "^2.4.1"
5481+
deepmerge "^1.5.0"
5482+
popper.js "^0.6.4"
5483+
54615484
watchpack@^1.3.1:
54625485
version "1.4.0"
54635486
resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.4.0.tgz#4a1472bcbb952bd0a9bb4036801f954dfb39faac"

0 commit comments

Comments
 (0)