diff --git a/src/components/card/card.vue b/src/components/card/card.vue index bfb973a1..f5714acd 100644 --- a/src/components/card/card.vue +++ b/src/components/card/card.vue @@ -1,7 +1,7 @@ - - + + @@ -51,12 +51,8 @@ } }, mounted () { - if (this.$refs.head) { - this.showHead = this.$refs.head.innerHTML != ''; - } - if (this.$refs.extra) { - this.showExtra = this.$refs.extra.innerHTML != ''; - } + this.showHead = this.$slots.title !== undefined; + this.showExtra = this.$slots.extra !== undefined; } }; diff --git a/test/routers/card.vue b/test/routers/card.vue index 06f94d6c..c3edcbde 100644 --- a/test/routers/card.vue +++ b/test/routers/card.vue @@ -1,42 +1,88 @@ - - - - iView2.0 - - - More - - iView 是一套基于 Vue.js 的开源 UI 组件库,主要服务于 PC 界面的中后台产品。 + + + + 经典电影 + + + + 换一换 + + + + {{ item.name }} + + + {{ item.rate }} + + + - - - Hello - iView2.0 - Card - - \ No newline at end of file +
iView2.0
iView 是一套基于 Vue.js 的开源 UI 组件库,主要服务于 PC 界面的中后台产品。
+ + 经典电影 +
Hello