update Card

@muei 更新了一下
This commit is contained in:
梁灏 2017-03-21 14:50:32 +08:00
parent b0a9eb4e2c
commit 19d4135239
2 changed files with 11 additions and 8 deletions

View file

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

View file

@ -7,6 +7,7 @@
</template> </template>
<script> <script>
const prefixCls = 'ivu-card'; const prefixCls = 'ivu-card';
const defaultPadding = 16;
export default { export default {
props: { props: {
@ -22,7 +23,10 @@
type: Boolean, type: Boolean,
default: false default: false
}, },
padding: Number padding: {
type: Number,
default: defaultPadding
}
}, },
data () { data () {
return { return {
@ -51,14 +55,13 @@
return `${prefixCls}-body`; return `${prefixCls}-body`;
}, },
bodyStyles () { bodyStyles () {
let padding = this.padding; if (this.padding !== defaultPadding) {
if (this.padding !== undefined) {
padding += 'px';
return { return {
padding, padding: `${this.padding}px`
}; }
} else {
return '';
} }
return '';
} }
}, },
mounted () { mounted () {