From 743d0278979a81f7b4e0ae0de4d201b0e93bf5ae Mon Sep 17 00:00:00 2001 From: 梁灏 Date: Fri, 3 Mar 2017 10:46:19 +0800 Subject: [PATCH] update Card --- 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 bfb973a..f5714ac 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 06f94d6..c3edcbd 100644 --- a/test/routers/card.vue +++ b/test/routers/card.vue @@ -1,42 +1,88 @@ \ No newline at end of file + -- libgit2 0.21.4