perf: add xtextbutton

This commit is contained in:
xingyu4j
2022-11-09 16:31:37 +08:00
parent 9c033d0104
commit b8665a9bc6
5 changed files with 21 additions and 17 deletions

View File

@@ -1,3 +1,4 @@
import XButton from './src/XButton.vue'
import XTextButton from './src/XTextButton.vue'
export { XButton }
export { XButton, XTextButton }

View File

@@ -7,7 +7,7 @@ const props = defineProps({
loading: propTypes.bool.def(false),
preIcon: propTypes.string.def(''),
postIcon: propTypes.string.def(''),
title: propTypes.string.def('按钮'),
title: propTypes.string.def(''),
type: propTypes.oneOf(['', 'primary', 'success', 'warning', 'danger', 'info']).def(''),
link: propTypes.bool.def(false),
circle: propTypes.bool.def(false),
@@ -31,7 +31,17 @@ const getBindValue = computed(() => {
<template>
<el-button v-bind="getBindValue" @click="onClick">
<Icon :icon="preIcon" v-if="preIcon" class="mr-1px" />
{{ title }}
{{ title ? title : '' }}
<Icon :icon="postIcon" v-if="postIcon" class="mr-1px" />
</el-button>
</template>
<style lang="less" scoped>
:deep(.el-button.is-text) {
margin-left: 0;
padding: 8px 4px;
}
:deep(.el-button.is-link) {
margin-left: 0;
padding: 8px 4px;
}
</style>