mirror of
https://github.com/youzan/vant.git
synced 2025-10-22 11:54:02 +00:00
[improvement] use component name (#2450)
This commit is contained in:
@@ -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>
|
||||
)}
|
||||
|
Reference in New Issue
Block a user