mirror of https://github.com/ElemeFE/element
parent
1ceafc42e1
commit
42921e247f
|
@ -1,22 +0,0 @@
|
||||||
/**
|
|
||||||
* button
|
|
||||||
* @module components/basic/menu
|
|
||||||
* @desc 用于按钮组
|
|
||||||
* @param {string} label - 名称
|
|
||||||
*/
|
|
||||||
export default {
|
|
||||||
name: 'ElButtonGroup',
|
|
||||||
|
|
||||||
functional: true,
|
|
||||||
|
|
||||||
render(h, { slots, data }) {
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
class="el-button-group"
|
|
||||||
{ ...data }
|
|
||||||
{ ...{ on: data.nativeOn } }>
|
|
||||||
{ slots().default }
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
<template>
|
||||||
|
<div class="el-button-group">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
/**
|
||||||
|
* button
|
||||||
|
* @module components/basic/menu
|
||||||
|
* @desc 用于按钮组
|
||||||
|
* @param {string} label - 名称
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
name: 'ElButtonGroup'
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -1,65 +0,0 @@
|
||||||
export default {
|
|
||||||
name: 'ElButton',
|
|
||||||
|
|
||||||
functional: true,
|
|
||||||
|
|
||||||
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
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
render(h, { props, slots, data }) {
|
|
||||||
return (
|
|
||||||
<button
|
|
||||||
disabled={ props.disabled }
|
|
||||||
type={ props.nativeType }
|
|
||||||
class={[
|
|
||||||
'el-button',
|
|
||||||
props.type ? 'el-button-' + props.type : '',
|
|
||||||
props.size ? 'el-button-' + props.size : '',
|
|
||||||
{
|
|
||||||
'is-disabled': props.disabled,
|
|
||||||
'is-loading': props.loading,
|
|
||||||
'is-plain': props.plain
|
|
||||||
}
|
|
||||||
]}
|
|
||||||
{ ...data }
|
|
||||||
{ ...{ on: data.nativeOn } }>
|
|
||||||
{
|
|
||||||
[
|
|
||||||
props.loading
|
|
||||||
? <i class="el-icon-loading"></i>
|
|
||||||
: {},
|
|
||||||
props.icon && !props.loading
|
|
||||||
? <i class={ 'el-icon-' + props.icon }></i>
|
|
||||||
: {}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
{ slots().default }
|
|
||||||
</button>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
|
@ -0,0 +1,54 @@
|
||||||
|
<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>
|
|
@ -1 +1 @@
|
||||||
module.exports = require('./src/icon');
|
module.exports = require('./src/icon.vue');
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
export default {
|
|
||||||
name: 'ElIcon',
|
|
||||||
|
|
||||||
functional: true,
|
|
||||||
|
|
||||||
props: {
|
|
||||||
name: String
|
|
||||||
},
|
|
||||||
|
|
||||||
render(h, { props, data }) {
|
|
||||||
return (
|
|
||||||
<i
|
|
||||||
class={ 'el-icon' + props.name }
|
|
||||||
{ ...data }
|
|
||||||
{ ...{ on: data.nativeOn } }>
|
|
||||||
</i>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
<template>
|
||||||
|
<i :class="'el-icon-' + name"></i>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'ElIcon',
|
||||||
|
|
||||||
|
props: {
|
||||||
|
name: String
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in New Issue