From 6d090ebf6a9fbc4f485c6b0139ac0a413ee58a7a Mon Sep 17 00:00:00 2001 From: young <ohoh.co@qq.com> Date: Fri, 17 Mar 2017 13:30:10 +0800 Subject: [PATCH] style(card): padding with number --- examples/routers/card.vue | 2 +- src/components/card/card.vue | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/examples/routers/card.vue b/examples/routers/card.vue index 1a6e922..b62acf7 100644 --- a/examples/routers/card.vue +++ b/examples/routers/card.vue @@ -1,5 +1,5 @@ <template> - <Card style="width:350px"> + <Card style="width:350px" v-bind:padding="0"> <p slot="title"> <Icon type="ios-film-outline"></Icon> 经典电影 diff --git a/src/components/card/card.vue b/src/components/card/card.vue index 7bee4ba..5a3d0bd 100644 --- a/src/components/card/card.vue +++ b/src/components/card/card.vue @@ -22,10 +22,7 @@ type: Boolean, default: false }, - padding: { - type: Boolean, - default: true - } + padding: Number }, data () { return { @@ -54,9 +51,11 @@ return `${prefixCls}-body`; }, bodyStyles () { - if (!this.padding) { + let padding = this.padding + if (this.padding !== undefined) { + padding += 'px' return { - padding: 0 + padding }; } return ''; -- libgit2 0.21.4