2016-10-11 04:56:07 +00:00
|
|
|
<template>
|
|
|
|
<button :disabled="disabled" class="el-button"
|
|
|
|
:type="nativeType"
|
|
|
|
:class="[
|
2016-10-25 03:33:39 +00:00
|
|
|
type ? 'el-button--' + type : '',
|
|
|
|
size ? 'el-button--' + size : '',
|
2016-10-11 04:56:07 +00:00
|
|
|
{
|
|
|
|
'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>
|
2016-10-25 03:33:39 +00:00
|
|
|
<span v-if="$slots.default"><slot></slot></span>
|
2016-10-11 04:56:07 +00:00
|
|
|
</button>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
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>
|