[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,11 +1,9 @@
import createSfc from '../utils/create';
import createBem from '../utils/bem';
import { use } from '../utils';
import Loading from '../loading';
const bem = createBem('van-button');
export default createSfc({
name: 'button',
const [sfc, bem] = use('button');
export default sfc({
props: {
text: String,
block: Boolean,
@@ -59,7 +57,7 @@ export default createSfc({
onClick={this.onClick}
>
{this.loading ? (
<loading size="20px" color={this.type === 'default' ? undefined : ''} />
<Loading size="20px" color={this.type === 'default' ? undefined : ''} />
) : (
<span class={bem('text')}>{this.$slots.default || this.text}</span>
)}