import { use } from '../utils'; import Loading from '../loading'; const [sfc, bem] = use('button'); export default sfc({ props: { text: String, block: Boolean, plain: Boolean, round: Boolean, square: Boolean, loading: Boolean, disabled: Boolean, nativeType: String, bottomAction: Boolean, tag: { type: String, default: 'button' }, type: { type: String, default: 'default' }, size: { type: String, default: 'normal' } }, methods: { onClick(event) { if (!this.loading && !this.disabled) { this.$emit('click', event); } } }, render(h) { return ( {this.loading ? ( ) : ( {this.$slots.default || this.text} )} ); } });