Commit 2c5faf30f417bc0fafb83714835312fa5d68a2c3
1 parent
98233573
init Avatar component
Showing
9 changed files
with
66 additions
and
14 deletions
Show diff stats
examples/app.vue
@@ -54,6 +54,7 @@ li + li { border-left: solid 1px #bbb; padding-left: 10px; margin-left: 10px; } | @@ -54,6 +54,7 @@ li + li { border-left: solid 1px #bbb; padding-left: 10px; margin-left: 10px; } | ||
54 | <li><router-link to="/modal">Modal</router-link></li> | 54 | <li><router-link to="/modal">Modal</router-link></li> |
55 | <li><router-link to="/message">Message</router-link></li> | 55 | <li><router-link to="/message">Message</router-link></li> |
56 | <li><router-link to="/notice">Notice</router-link></li> | 56 | <li><router-link to="/notice">Notice</router-link></li> |
57 | + <li><router-link to="/avatar">Avatar</router-link></li> | ||
57 | </ul> | 58 | </ul> |
58 | </nav> | 59 | </nav> |
59 | <router-view></router-view> | 60 | <router-view></router-view> |
examples/main.js
@@ -180,6 +180,10 @@ const router = new VueRouter({ | @@ -180,6 +180,10 @@ const router = new VueRouter({ | ||
180 | { | 180 | { |
181 | path: '/notice', | 181 | path: '/notice', |
182 | component: require('./routers/notice.vue') | 182 | component: require('./routers/notice.vue') |
183 | + }, | ||
184 | + { | ||
185 | + path: '/avatar', | ||
186 | + component: require('./routers/avatar.vue') | ||
183 | } | 187 | } |
184 | ] | 188 | ] |
185 | }); | 189 | }); |
examples/routers/poptip.vue
1 | <template> | 1 | <template> |
2 | - <div> | ||
3 | - <Poptip trigger="hover" title="提示标题" content="提示内容"> | ||
4 | - <Button>hover 激活</Button> | ||
5 | - </Poptip> | ||
6 | - <Poptip transfer title="提示标题" content="提示内容"> | ||
7 | - <Button>click 激活</Button> | ||
8 | - </Poptip> | ||
9 | - <Poptip trigger="focus" title="提示标题" content="提示内容"> | ||
10 | - <Button>focus 激活</Button> | ||
11 | - </Poptip> | ||
12 | - <Poptip trigger="focus" title="提示标题" content="提示内容"> | ||
13 | - <i-input placeholder="输入框的 focus"></i-input> | 2 | + <div style="margin: 100px;"> |
3 | + <Poptip | ||
4 | + confirm | ||
5 | + transfer | ||
6 | + title="您确认删除这条内容吗?" | ||
7 | + @on-ok="ok" | ||
8 | + @on-cancel="cancel"> | ||
9 | + <Button>删除</Button> | ||
14 | </Poptip> | 10 | </Poptip> |
15 | </div> | 11 | </div> |
16 | </template> | 12 | </template> |
17 | <script> | 13 | <script> |
18 | export default { | 14 | export default { |
19 | - | 15 | + methods: { |
16 | + ok () { | ||
17 | + this.$Message.info('点击了确定'); | ||
18 | + }, | ||
19 | + cancel () { | ||
20 | + this.$Message.info('点击了取消'); | ||
21 | + } | ||
22 | + } | ||
20 | } | 23 | } |
21 | </script> | 24 | </script> |
1 | +<template> | ||
2 | + <span> | ||
3 | + | ||
4 | + </span> | ||
5 | +</template> | ||
6 | +<script> | ||
7 | + const prefixCls = 'ivu-avatar'; | ||
8 | + | ||
9 | + export default { | ||
10 | + name: 'Avatar', | ||
11 | + props: { | ||
12 | + | ||
13 | + }, | ||
14 | + data () { | ||
15 | + return { | ||
16 | + | ||
17 | + }; | ||
18 | + }, | ||
19 | + computed: { | ||
20 | + | ||
21 | + }, | ||
22 | + methods: { | ||
23 | + | ||
24 | + } | ||
25 | + }; | ||
26 | +</script> | ||
0 | \ No newline at end of file | 27 | \ No newline at end of file |
src/index.js
@@ -3,6 +3,7 @@ import 'core-js/fn/array/find-index'; | @@ -3,6 +3,7 @@ import 'core-js/fn/array/find-index'; | ||
3 | 3 | ||
4 | import Affix from './components/affix'; | 4 | import Affix from './components/affix'; |
5 | import Alert from './components/alert'; | 5 | import Alert from './components/alert'; |
6 | +import Avatar from './components/avatar'; | ||
6 | import BackTop from './components/back-top'; | 7 | import BackTop from './components/back-top'; |
7 | import Badge from './components/badge'; | 8 | import Badge from './components/badge'; |
8 | import Breadcrumb from './components/breadcrumb'; | 9 | import Breadcrumb from './components/breadcrumb'; |
@@ -49,6 +50,7 @@ import locale from './locale'; | @@ -49,6 +50,7 @@ import locale from './locale'; | ||
49 | const iview = { | 50 | const iview = { |
50 | Affix, | 51 | Affix, |
51 | Alert, | 52 | Alert, |
53 | + Avatar, | ||
52 | BackTop, | 54 | BackTop, |
53 | Badge, | 55 | Badge, |
54 | Breadcrumb, | 56 | Breadcrumb, |
src/styles/components/index.less
@@ -38,4 +38,5 @@ | @@ -38,4 +38,5 @@ | ||
38 | @import "carousel"; | 38 | @import "carousel"; |
39 | @import "rate"; | 39 | @import "rate"; |
40 | @import "upload"; | 40 | @import "upload"; |
41 | -@import "tree"; | ||
42 | \ No newline at end of file | 41 | \ No newline at end of file |
42 | +@import "tree"; | ||
43 | +@import "avatar"; | ||
43 | \ No newline at end of file | 44 | \ No newline at end of file |