mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-21 01:02:59 +08:00
Merge pull request #1 from element-plus/fix/typescripting-button-component
fix/typescripting-button-component
This commit is contained in:
commit
e08d5c6279
@ -22,9 +22,19 @@
|
||||
<span v-if="$slots.default"><slot></slot></span>
|
||||
</button>
|
||||
</template>
|
||||
<script>
|
||||
<script lang='ts'>
|
||||
import { computed, inject } from 'vue'
|
||||
const ELEMENT = {}
|
||||
const ELEMENT: {
|
||||
size?: number;
|
||||
} = {}
|
||||
// TODOS: replace these interface definition with actual ElForm interface
|
||||
interface ElForm {
|
||||
disabled: boolean;
|
||||
}
|
||||
interface ElFormItem {
|
||||
elFormItemSize: number;
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'ElButton',
|
||||
|
||||
@ -49,16 +59,10 @@ export default {
|
||||
round: Boolean,
|
||||
circle: Boolean
|
||||
},
|
||||
|
||||
methods: {
|
||||
handleClick(evt) {
|
||||
this.$emit('click', evt);
|
||||
}
|
||||
},
|
||||
setup(props,ctx) {
|
||||
// inject
|
||||
const elForm = inject('elForm', '')
|
||||
const elFormItem = inject('elFormItem', '')
|
||||
const elForm = inject<ElForm>('elForm')
|
||||
const elFormItem = inject<ElFormItem>('elFormItem')
|
||||
|
||||
// computed
|
||||
const _elFormItemSize = computed(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user