|
@@ -1,18 +1,14 @@
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
import { propTypes } from '@/utils/propTypes'
|
|
import { propTypes } from '@/utils/propTypes'
|
|
import { computed, useAttrs, PropType } from 'vue'
|
|
import { computed, useAttrs, PropType } from 'vue'
|
|
-import { useI18n } from '@/hooks/web/useI18n'
|
|
|
|
-
|
|
|
|
-const { t } = useI18n() // 国际化
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
modelValue: propTypes.bool.def(false),
|
|
modelValue: propTypes.bool.def(false),
|
|
loading: propTypes.bool.def(false),
|
|
loading: propTypes.bool.def(false),
|
|
preIcon: propTypes.string.def(''),
|
|
preIcon: propTypes.string.def(''),
|
|
postIcon: propTypes.string.def(''),
|
|
postIcon: propTypes.string.def(''),
|
|
- iTitle: propTypes.string.def(''),
|
|
|
|
title: propTypes.string.def('按钮'),
|
|
title: propTypes.string.def('按钮'),
|
|
- type: propTypes.oneOf(['primary', 'success', 'warning', 'danger', 'info']).def('primary'),
|
|
|
|
|
|
+ type: propTypes.oneOf(['', 'primary', 'success', 'warning', 'danger', 'info']).def(''),
|
|
link: propTypes.bool.def(false),
|
|
link: propTypes.bool.def(false),
|
|
circle: propTypes.bool.def(false),
|
|
circle: propTypes.bool.def(false),
|
|
round: propTypes.bool.def(false),
|
|
round: propTypes.bool.def(false),
|
|
@@ -35,7 +31,7 @@ const getBindValue = computed(() => {
|
|
<template>
|
|
<template>
|
|
<el-button v-bind="getBindValue" @click="onClick">
|
|
<el-button v-bind="getBindValue" @click="onClick">
|
|
<Icon :icon="preIcon" v-if="preIcon" class="mr-1px" />
|
|
<Icon :icon="preIcon" v-if="preIcon" class="mr-1px" />
|
|
- {{ iTitle ? t(iTitle) : title }}
|
|
|
|
|
|
+ {{ title }}
|
|
<Icon :icon="postIcon" v-if="postIcon" class="mr-1px" />
|
|
<Icon :icon="postIcon" v-if="postIcon" class="mr-1px" />
|
|
</el-button>
|
|
</el-button>
|
|
</template>
|
|
</template>
|