update Card
@muei 更新了一下
This commit is contained in:
parent
b0a9eb4e2c
commit
19d4135239
2 changed files with 11 additions and 8 deletions
|
@ -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>
|
||||||
经典电影
|
经典电影
|
||||||
|
|
|
@ -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,15 +55,14 @@
|
||||||
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 () {
|
||||||
this.showHead = this.$slots.title !== undefined;
|
this.showHead = this.$slots.title !== undefined;
|
||||||
|
|
Loading…
Add table
Reference in a new issue