mirror of https://github.com/ElemeFE/element
55 lines
1005 B
Vue
55 lines
1005 B
Vue
<template>
|
|
<button :disabled="disabled" class="el-button"
|
|
:type="nativeType"
|
|
:class="[
|
|
type ? 'el-button-' + type : '',
|
|
size ? 'el-button-' + size : '',
|
|
{
|
|
'is-disabled': disabled,
|
|
'is-loading': loading,
|
|
'is-plain': plain
|
|
}
|
|
]"
|
|
>
|
|
<i class="el-icon-loading" v-if="loading"></i>
|
|
<i :class="'el-icon-' + icon" v-if="icon && !loading"></i>
|
|
<slot></slot>
|
|
</button>
|
|
</template>
|
|
<script>
|
|
/**
|
|
* button
|
|
*/
|
|
export default {
|
|
name: 'ElButton',
|
|
|
|
props: {
|
|
type: {
|
|
type: String,
|
|
default: 'default'
|
|
},
|
|
size: String,
|
|
icon: {
|
|
type: String,
|
|
default: ''
|
|
},
|
|
nativeType: {
|
|
type: String,
|
|
default: 'button'
|
|
},
|
|
loading: {
|
|
type: Boolean,
|
|
default: false
|
|
},
|
|
disabled: {
|
|
type: Boolean,
|
|
default: false
|
|
},
|
|
plain: {
|
|
type: Boolean,
|
|
default: false
|
|
}
|
|
}
|
|
};
|
|
</script>
|