Commit b8665a9bc67c91a14d05e06641c147e8d7fc91ff

Authored by xingyu4j
1 parent 9c033d01

perf: add xtextbutton

yudao-ui-admin-vue3/src/components/XButton/index.ts
1 import XButton from './src/XButton.vue' 1 import XButton from './src/XButton.vue'
  2 +import XTextButton from './src/XTextButton.vue'
2 3
3 -export { XButton } 4 +export { XButton, XTextButton }
yudao-ui-admin-vue3/src/components/XButton/src/XButton.vue
@@ -7,7 +7,7 @@ const props = defineProps({ @@ -7,7 +7,7 @@ const props = defineProps({
7 loading: propTypes.bool.def(false), 7 loading: propTypes.bool.def(false),
8 preIcon: propTypes.string.def(''), 8 preIcon: propTypes.string.def(''),
9 postIcon: propTypes.string.def(''), 9 postIcon: propTypes.string.def(''),
10 - title: propTypes.string.def('按钮'), 10 + title: propTypes.string.def(''),
11 type: propTypes.oneOf(['', 'primary', 'success', 'warning', 'danger', 'info']).def(''), 11 type: propTypes.oneOf(['', 'primary', 'success', 'warning', 'danger', 'info']).def(''),
12 link: propTypes.bool.def(false), 12 link: propTypes.bool.def(false),
13 circle: propTypes.bool.def(false), 13 circle: propTypes.bool.def(false),
@@ -31,7 +31,17 @@ const getBindValue = computed(() => { @@ -31,7 +31,17 @@ const getBindValue = computed(() => {
31 <template> 31 <template>
32 <el-button v-bind="getBindValue" @click="onClick"> 32 <el-button v-bind="getBindValue" @click="onClick">
33 <Icon :icon="preIcon" v-if="preIcon" class="mr-1px" /> 33 <Icon :icon="preIcon" v-if="preIcon" class="mr-1px" />
34 - {{ title }} 34 + {{ title ? title : '' }}
35 <Icon :icon="postIcon" v-if="postIcon" class="mr-1px" /> 35 <Icon :icon="postIcon" v-if="postIcon" class="mr-1px" />
36 </el-button> 36 </el-button>
37 </template> 37 </template>
  38 +<style lang="less" scoped>
  39 +:deep(.el-button.is-text) {
  40 + margin-left: 0;
  41 + padding: 8px 4px;
  42 +}
  43 +:deep(.el-button.is-link) {
  44 + margin-left: 0;
  45 + padding: 8px 4px;
  46 +}
  47 +</style>
yudao-ui-admin-vue3/src/components/index.ts
@@ -5,7 +5,7 @@ import { Table } from &#39;@/components/Table&#39; @@ -5,7 +5,7 @@ import { Table } from &#39;@/components/Table&#39;
5 import { Search } from '@/components/Search' 5 import { Search } from '@/components/Search'
6 import { Dialog } from '@/components/Dialog' 6 import { Dialog } from '@/components/Dialog'
7 import { XModal } from '@/components/XModal' 7 import { XModal } from '@/components/XModal'
8 -import { XButton } from '@/components/XButton' 8 +import { XButton, XTextButton } from '@/components/XButton'
9 import { DictTag } from '@/components/DictTag' 9 import { DictTag } from '@/components/DictTag'
10 import { ContentWrap } from '@/components/ContentWrap' 10 import { ContentWrap } from '@/components/ContentWrap'
11 import { Descriptions } from '@/components/Descriptions' 11 import { Descriptions } from '@/components/Descriptions'
@@ -18,6 +18,7 @@ export const setupGlobCom = (app: App&lt;Element&gt;): void =&gt; { @@ -18,6 +18,7 @@ export const setupGlobCom = (app: App&lt;Element&gt;): void =&gt; {
18 app.component('Dialog', Dialog) 18 app.component('Dialog', Dialog)
19 app.component('XModal', XModal) 19 app.component('XModal', XModal)
20 app.component('XButton', XButton) 20 app.component('XButton', XButton)
  21 + app.component('XTextButton', XTextButton)
21 app.component('DictTag', DictTag) 22 app.component('DictTag', DictTag)
22 app.component('ContentWrap', ContentWrap) 23 app.component('ContentWrap', ContentWrap)
23 app.component('Descriptions', Descriptions) 24 app.component('Descriptions', Descriptions)
yudao-ui-admin-vue3/src/views/system/menu/index.vue
@@ -73,17 +73,13 @@ @@ -73,17 +73,13 @@
73 <vxe-column title="创建时间" field="createTime" formatter="formatDate" /> 73 <vxe-column title="创建时间" field="createTime" formatter="formatDate" />
74 <vxe-column title="操作" width="200"> 74 <vxe-column title="操作" width="200">
75 <template #default="{ row }"> 75 <template #default="{ row }">
76 - <XButton  
77 - link  
78 - type="primary" 76 + <XTextButton
79 preIcon="ep:edit" 77 preIcon="ep:edit"
80 :title="t('action.edit')" 78 :title="t('action.edit')"
81 v-hasPermi="['system:menu:update']" 79 v-hasPermi="['system:menu:update']"
82 @click="handleUpdate(row.id)" 80 @click="handleUpdate(row.id)"
83 /> 81 />
84 - <XButton  
85 - link  
86 - type="primary" 82 + <XTextButton
87 preIcon="ep:delete" 83 preIcon="ep:delete"
88 :title="t('action.del')" 84 :title="t('action.del')"
89 v-hasPermi="['system:menu:delete']" 85 v-hasPermi="['system:menu:delete']"
yudao-ui-admin-vue3/src/views/system/post/index.vue
@@ -14,23 +14,19 @@ @@ -14,23 +14,19 @@
14 <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" /> 14 <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
15 </template> 15 </template>
16 <template #action_default="{ row }"> 16 <template #action_default="{ row }">
17 - <XButton  
18 - link  
19 - type="primary" 17 + <XTextButton
20 preIcon="ep:edit" 18 preIcon="ep:edit"
21 :title="t('action.edit')" 19 :title="t('action.edit')"
22 v-hasPermi="['system:post:update']" 20 v-hasPermi="['system:post:update']"
23 @click="handleUpdate(row.id)" 21 @click="handleUpdate(row.id)"
24 /> 22 />
25 - <XButton  
26 - link  
27 - type="primary" 23 + <XTextButton
28 preIcon="ep:view" 24 preIcon="ep:view"
29 :title="t('action.detail')" 25 :title="t('action.detail')"
30 v-hasPermi="['system:post:update']" 26 v-hasPermi="['system:post:update']"
31 @click="handleDetail(row)" 27 @click="handleDetail(row)"
32 /> 28 />
33 - <XButton 29 + <XTextButton
34 link 30 link
35 type="primary" 31 type="primary"
36 preIcon="ep:delete" 32 preIcon="ep:delete"