[improvement] use component name (#2450)

This commit is contained in:
neverland
2019-01-06 23:08:14 +08:00
committed by GitHub
parent e437e9c10d
commit bf50db9ea0
13 changed files with 87 additions and 76 deletions

View File

@@ -1,12 +1,9 @@
import createSfc from '../utils/create';
import createBem from '../utils/bem';
import { use, isDef } from '../utils';
import Tag from '../tag';
const bem = createBem('van-card');
export default createSfc({
name: 'card',
const [sfc, bem] = use('card');
export default sfc({
props: {
tag: String,
desc: String,
@@ -25,7 +22,7 @@ export default createSfc({
},
render(h) {
const { thumb, isDef, $slots: slots } = this;
const { thumb, $slots: slots } = this;
const Thumb = (slots.thumb || thumb) && (
<a href={this.thumbLink} class={bem('thumb')}>