Commit 6c9acb08fa34d9db51fdc661fd782926debcb728

Authored by Rijn
1 parent 6831b361

initialize carousel

src/components/carousel/carousel-item.vue 0 → 100644
  1 +<template>
  2 + <div :class="prefixCls"><slot></slot></div>
  3 +</template>
  4 +<script>
  5 + const prefixCls = 'ivu-carousel-item';
  6 +
  7 + export default {
  8 + name: 'CarouselItem'
  9 + };
  10 +</script>
... ...
src/components/carousel/carousel.vue 0 → 100644
  1 +<template>
  2 + <div :class="prefixCls">
  3 + </div>
  4 +</template>
  5 +<script>
  6 + const prefixCls = 'ivu-cascader';
  7 +
  8 + export default {
  9 + name: 'Carousel'
  10 + };
  11 +</script>
... ...
src/components/carousel/index.js 0 → 100644
  1 +import Carousel from './carousel.vue';
  2 +import CarouselItem from './carousel-item.vue';
  3 +
  4 +Carousel.Item = CarouselItem;
  5 +export default Carousel;
0 6 \ No newline at end of file
... ...
src/index.js
... ... @@ -8,6 +8,7 @@ import Badge from &#39;./components/badge&#39;;
8 8 import Breadcrumb from './components/breadcrumb';
9 9 import Button from './components/button';
10 10 import Card from './components/card';
  11 +import Carousel from './components/carousel';
11 12 import Cascader from './components/cascader';
12 13 import Checkbox from './components/checkbox';
13 14 import Circle from './components/circle';
... ... @@ -52,6 +53,8 @@ const iview = {
52 53 iButton: Button,
53 54 ButtonGroup: Button.Group,
54 55 Card,
  56 + Carousel,
  57 + CarouselItem: Carousel.Item,
55 58 Cascader,
56 59 Checkbox,
57 60 CheckboxGroup: Checkbox.Group,
... ...
src/styles/components/carousel.less 0 → 100644
  1 +@carousel-prefix-cls: ~"@{css-prefix}carousel";
  2 +@carousel-item-prefix-cls: ~"@{css-prefix}carousel-item";
  3 +
  4 +.@{carousel-prefix-cls} {
  5 +
  6 +}
... ...
test/app.vue
... ... @@ -47,6 +47,7 @@ li + li {
47 47 <li><a v-link="'/menu'">Menu</a></li>
48 48 <li><a v-link="'/date'">Date</a></li>
49 49 <li><a v-link="'/form'">Form</a></li>
  50 + <li><a v-link="'/carousel'">Carousel</a></li>
50 51 </ul>
51 52 </nav>
52 53 <router-view></router-view>
... ...
test/main.js
... ... @@ -134,6 +134,11 @@ router.map({
134 134 require(['./routers/form.vue'], resolve);
135 135 }
136 136 },
  137 + '/carousel': {
  138 + component: function (resolve) {
  139 + require(['./routers/carousel.vue'], resolve);
  140 + }
  141 + },
137 142 });
138 143  
139 144 router.beforeEach(function () {
... ...
test/routers/carousel.vue 0 → 100644
  1 +<template>
  2 + <Carousel>
  3 + <Carousel-item></Carousel-item>
  4 + </Carousel>
  5 +</template>
  6 +<script>
  7 + export default {
  8 + }
  9 +</script>
... ...