From 743d0278979a81f7b4e0ae0de4d201b0e93bf5ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=81=8F?= Date: Fri, 3 Mar 2017 10:46:19 +0800 Subject: [PATCH] update Card update Card @huixisheng --- src/components/card/card.vue | 12 ++-- test/routers/card.vue | 106 +++++++++++++++++++++++++---------- 2 files changed, 80 insertions(+), 38 deletions(-) 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 @@ \ No newline at end of file +