Commit 2c5faf30f417bc0fafb83714835312fa5d68a2c3

Authored by 梁灏
1 parent 98233573

init Avatar component

@@ -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>
@@ -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/avatar.vue 0 → 100644
  1 +<template>
  2 + <Avatar></Avatar>
  3 +</template>
  4 +<script>
  5 + export default {
  6 +
  7 + }
  8 +</script>
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>
src/components/avatar/avatar.vue 0 → 100644
  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/components/avatar/index.js 0 → 100644
  1 +import Avatar from './avatar.vue';
  2 +export default Avatar;
0 \ No newline at end of file 3 \ No newline at end of file
@@ -3,6 +3,7 @@ import &#39;core-js/fn/array/find-index&#39;; @@ -3,6 +3,7 @@ import &#39;core-js/fn/array/find-index&#39;;
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 &#39;./locale&#39;; @@ -49,6 +50,7 @@ import locale from &#39;./locale&#39;;
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/avatar.less 0 → 100644
  1 +@avatar-prefix-cls: ~"@{css-prefix}avatar";
  2 +
  3 +.@{avatar-prefix-cls} {
  4 +
  5 +}
0 \ No newline at end of file 6 \ No newline at end of file
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