style(card): padding with number

This commit is contained in:
young 2017-03-17 13:30:10 +08:00
parent fb8a7b3f55
commit 6d090ebf6a
2 changed files with 6 additions and 7 deletions

View file

@ -1,5 +1,5 @@
<template> <template>
<Card style="width:350px"> <Card style="width:350px" v-bind:padding="0">
<p slot="title"> <p slot="title">
<Icon type="ios-film-outline"></Icon> <Icon type="ios-film-outline"></Icon>
经典电影 经典电影

View file

@ -22,10 +22,7 @@
type: Boolean, type: Boolean,
default: false default: false
}, },
padding: { padding: Number
type: Boolean,
default: true
}
}, },
data () { data () {
return { return {
@ -54,9 +51,11 @@
return `${prefixCls}-body`; return `${prefixCls}-body`;
}, },
bodyStyles () { bodyStyles () {
if (!this.padding) { let padding = this.padding
if (this.padding !== undefined) {
padding += 'px'
return { return {
padding: 0 padding
}; };
} }
return ''; return '';