diff --git a/src/components/card/card.vue b/src/components/card/card.vue index d336ca9a..bfb973a1 100644 --- a/src/components/card/card.vue +++ b/src/components/card/card.vue @@ -1,7 +1,7 @@ @@ -50,9 +50,13 @@ return `${prefixCls}-body`; } }, - compiled () { - this.showHead = this.$els.head.innerHTML != ''; - this.showExtra = this.$els.extra.innerHTML != ''; + mounted () { + if (this.$refs.head) { + this.showHead = this.$refs.head.innerHTML != ''; + } + if (this.$refs.extra) { + this.showExtra = this.$refs.extra.innerHTML != ''; + } } }; diff --git a/src/index.js b/src/index.js index 183da3e4..02ef210e 100644 --- a/src/index.js +++ b/src/index.js @@ -7,7 +7,7 @@ import Alert from './components/alert'; import Badge from './components/badge'; // import Breadcrumb from './components/breadcrumb'; import Button from './components/button'; -// import Card from './components/card'; +import Card from './components/card'; import Carousel from './components/carousel'; // import Cascader from './components/cascader'; import Checkbox from './components/checkbox'; @@ -56,7 +56,7 @@ const iview = { // iButton: Button, Button, ButtonGroup: Button.Group, - // Card, + Card, Carousel, CarouselItem: Carousel.Item, // Cascader, diff --git a/test/app.vue b/test/app.vue index 0e41a137..27f85781 100644 --- a/test/app.vue +++ b/test/app.vue @@ -30,6 +30,7 @@ li + li { border-left: solid 1px #bbb; padding-left: 10px; margin-left: 10px; }
  • Upload
  • Collapse
  • Carousel
  • +
  • Card
  • Tree
  • diff --git a/test/main.js b/test/main.js index f5dc1bfb..e1fd6507 100644 --- a/test/main.js +++ b/test/main.js @@ -85,6 +85,10 @@ const router = new VueRouter({ path: '/carousel', component: require('./routers/carousel.vue') }, + { + path: '/card', + component: require('./routers/card.vue') + }, { path: '/tree', component: require('./routers/tree.vue') diff --git a/test/routers/card.vue b/test/routers/card.vue index 75fb31bf..06f94d6c 100644 --- a/test/routers/card.vue +++ b/test/routers/card.vue @@ -1,38 +1,42 @@ \ No newline at end of file