Commit 2c5faf30f417bc0fafb83714835312fa5d68a2c3

Authored by 梁灏
1 parent 98233573

init Avatar component

examples/app.vue
... ... @@ -54,6 +54,7 @@ li + li { border-left: solid 1px #bbb; padding-left: 10px; margin-left: 10px; }
54 54 <li><router-link to="/modal">Modal</router-link></li>
55 55 <li><router-link to="/message">Message</router-link></li>
56 56 <li><router-link to="/notice">Notice</router-link></li>
  57 + <li><router-link to="/avatar">Avatar</router-link></li>
57 58 </ul>
58 59 </nav>
59 60 <router-view></router-view>
... ...
examples/main.js
... ... @@ -180,6 +180,10 @@ const router = new VueRouter({
180 180 {
181 181 path: '/notice',
182 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 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 10 </Poptip>
15 11 </div>
16 12 </template>
17 13 <script>
18 14 export default {
19   -
  15 + methods: {
  16 + ok () {
  17 + this.$Message.info('点击了确定');
  18 + },
  19 + cancel () {
  20 + this.$Message.info('点击了取消');
  21 + }
  22 + }
20 23 }
21 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 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 3 \ No newline at end of file
... ...
src/index.js
... ... @@ -3,6 +3,7 @@ import &#39;core-js/fn/array/find-index&#39;;
3 3  
4 4 import Affix from './components/affix';
5 5 import Alert from './components/alert';
  6 +import Avatar from './components/avatar';
6 7 import BackTop from './components/back-top';
7 8 import Badge from './components/badge';
8 9 import Breadcrumb from './components/breadcrumb';
... ... @@ -49,6 +50,7 @@ import locale from &#39;./locale&#39;;
49 50 const iview = {
50 51 Affix,
51 52 Alert,
  53 + Avatar,
52 54 BackTop,
53 55 Badge,
54 56 Breadcrumb,
... ...
src/styles/components/avatar.less 0 → 100644
  1 +@avatar-prefix-cls: ~"@{css-prefix}avatar";
  2 +
  3 +.@{avatar-prefix-cls} {
  4 +
  5 +}
0 6 \ No newline at end of file
... ...
src/styles/components/index.less
... ... @@ -38,4 +38,5 @@
38 38 @import "carousel";
39 39 @import "rate";
40 40 @import "upload";
41   -@import "tree";
42 41 \ No newline at end of file
  42 +@import "tree";
  43 +@import "avatar";
43 44 \ No newline at end of file
... ...