mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-09-26 10:59:58 +08:00
refactor: button text prop 改成 link element-plus将废弃text
This commit is contained in:
parent
aa601f8703
commit
5c54f50365
@ -27,6 +27,7 @@ export interface BadgeProps {
|
||||
export interface ButtonProps {
|
||||
type?: string;
|
||||
size?: FieldSize;
|
||||
link?: boolean;
|
||||
text?: boolean;
|
||||
icon?: any;
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
@closed="closedHandler"
|
||||
>
|
||||
<template #left>
|
||||
<TMagicButton type="primary" text @click="difVisible = true">查看修改</TMagicButton>
|
||||
<TMagicButton type="primary" link @click="difVisible = true">查看修改</TMagicButton>
|
||||
</template>
|
||||
</component>
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
<span>{{ title }}</span>
|
||||
</slot>
|
||||
<div>
|
||||
<TMagicButton text size="small" :icon="Close" @click="closeHandler"></TMagicButton>
|
||||
<TMagicButton link size="small" :icon="Close" @click="closeHandler"></TMagicButton>
|
||||
</div>
|
||||
</div>
|
||||
<div class="m-editor-float-box-body">
|
||||
|
@ -12,11 +12,11 @@
|
||||
|
||||
<template v-else-if="data.type === 'button'">
|
||||
<TMagicTooltip v-if="data.tooltip" effect="dark" placement="bottom-start" :content="data.tooltip">
|
||||
<TMagicButton size="small" text :disabled="disabled"
|
||||
<TMagicButton size="small" link :disabled="disabled"
|
||||
><MIcon v-if="data.icon" :icon="data.icon"></MIcon><span>{{ data.text }}</span></TMagicButton
|
||||
>
|
||||
</TMagicTooltip>
|
||||
<TMagicButton v-else size="small" text :disabled="disabled" :title="data.text"
|
||||
<TMagicButton v-else size="small" link :disabled="disabled" :title="data.text"
|
||||
><MIcon v-if="data.icon" :icon="data.icon"></MIcon><span>{{ data.text }}</span></TMagicButton
|
||||
>
|
||||
</template>
|
||||
|
@ -36,7 +36,7 @@
|
||||
></m-form-container>
|
||||
<TMagicButton
|
||||
style="color: #f56c6c"
|
||||
text
|
||||
link
|
||||
:icon="Delete"
|
||||
:disabled="disabled"
|
||||
:size="size"
|
||||
|
@ -51,7 +51,7 @@
|
||||
v-if="config.advanced"
|
||||
size="default"
|
||||
:disabled="disabled"
|
||||
text
|
||||
link
|
||||
:icon="CodeIcon"
|
||||
@click="showCode = !showCode"
|
||||
></TMagicButton>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="m-fields-ui-select" v-if="uiSelectMode" @click="cancelHandler">
|
||||
<TMagicButton type="danger" :icon="Delete" :disabled="disabled" :size="size" text style="padding: 0"
|
||||
<TMagicButton type="danger" :icon="Delete" :disabled="disabled" :size="size" link style="padding: 0"
|
||||
>取消</TMagicButton
|
||||
>
|
||||
</div>
|
||||
@ -13,14 +13,14 @@
|
||||
:icon="Close"
|
||||
:disabled="disabled"
|
||||
:size="size"
|
||||
text
|
||||
link
|
||||
@click.stop="deleteHandler"
|
||||
></TMagicButton>
|
||||
</TMagicTooltip>
|
||||
|
||||
<TMagicTooltip content="点击选中组件" placement="top">
|
||||
<TMagicButton
|
||||
text
|
||||
link
|
||||
style="padding: 0; margin: 0"
|
||||
:disabled="disabled"
|
||||
:size="size"
|
||||
@ -33,7 +33,7 @@
|
||||
</template>
|
||||
|
||||
<TMagicTooltip v-else content="点击此处选择" placement="top">
|
||||
<TMagicButton text style="padding: 0; margin: 0" :disabled="disabled" :size="size" @click="startSelect"
|
||||
<TMagicButton link style="padding: 0; margin: 0" :disabled="disabled" :size="size" @click="startSelect"
|
||||
>点击此处选择</TMagicButton
|
||||
>
|
||||
</TMagicTooltip>
|
||||
|
@ -4,7 +4,7 @@
|
||||
class="m-editor-page-bar-switch-type-button"
|
||||
size="small"
|
||||
:key="item.type"
|
||||
text
|
||||
link
|
||||
:class="{ active: modelValue === item.type }"
|
||||
:type="modelValue === item.type ? 'primary' : ''"
|
||||
@click="clickHandler(item.type)"
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div v-if="nodes.length === 1" class="m-editor-breadcrumb">
|
||||
<template v-for="(item, index) in path" :key="item.id">
|
||||
<TMagicButton text :disabled="item.id === node?.id" @click="select(item)">{{ item.name }}</TMagicButton
|
||||
<TMagicButton link :disabled="item.id === node?.id" @click="select(item)">{{ item.name }}</TMagicButton
|
||||
><span v-if="index < path.length - 1">/</span>
|
||||
</template>
|
||||
</div>
|
||||
|
@ -212,7 +212,7 @@
|
||||
</template>
|
||||
|
||||
<div style="text-align: center" v-if="config.expand && type !== 'fieldset'">
|
||||
<TMagicButton type="primary" size="small" :disabled="false" text @click="expandHandler">{{
|
||||
<TMagicButton type="primary" size="small" :disabled="false" link @click="expandHandler">{{
|
||||
expand ? '收起配置' : '展开更多配置'
|
||||
}}</TMagicButton>
|
||||
</div>
|
||||
|
@ -1,24 +1,24 @@
|
||||
<template>
|
||||
<div class="m-fields-group-list-item">
|
||||
<div>
|
||||
<TMagicButton text :disabled="disabled" :icon="expand ? CaretBottom : CaretRight" @click="expandHandler">{{
|
||||
<TMagicButton link :disabled="disabled" :icon="expand ? CaretBottom : CaretRight" @click="expandHandler">{{
|
||||
title
|
||||
}}</TMagicButton>
|
||||
|
||||
<TMagicButton
|
||||
v-show="showDelete(parseInt(String(index)))"
|
||||
style="color: #f56c6c"
|
||||
text
|
||||
link
|
||||
:icon="Delete"
|
||||
:disabled="disabled"
|
||||
@click="removeHandler"
|
||||
></TMagicButton>
|
||||
|
||||
<template v-if="movable()">
|
||||
<TMagicButton v-show="index !== 0" text :disabled="disabled" size="small" @click="changeOrder(-1)"
|
||||
<TMagicButton v-show="index !== 0" link :disabled="disabled" size="small" @click="changeOrder(-1)"
|
||||
>上移<TMagicIcon><CaretTop /></TMagicIcon
|
||||
></TMagicButton>
|
||||
<TMagicButton v-show="index !== length - 1" :disabled="disabled" text size="small" @click="changeOrder(1)"
|
||||
<TMagicButton v-show="index !== length - 1" :disabled="disabled" link size="small" @click="changeOrder(1)"
|
||||
>下移<TMagicIcon><CaretBottom /></TMagicIcon
|
||||
></TMagicButton>
|
||||
</template>
|
||||
|
@ -6,7 +6,7 @@
|
||||
>
|
||||
<template #header>
|
||||
<div style="width: 100%; display: flex; align-items: center">
|
||||
<TMagicButton style="padding: 0" text :icon="expand ? CaretBottom : CaretRight" @click="expand = !expand">
|
||||
<TMagicButton style="padding: 0" link :icon="expand ? CaretBottom : CaretRight" @click="expand = !expand">
|
||||
</TMagicButton>
|
||||
<span v-if="config && config.extra" v-html="config.extra" class="m-form-tip"></span>
|
||||
<slot name="header">{{ filter(config.title) }}</slot>
|
||||
|
@ -54,7 +54,7 @@
|
||||
type="primary"
|
||||
:icon="ArrowUp"
|
||||
:disabled="disabled"
|
||||
text
|
||||
link
|
||||
@click="upHandler(scope.$index + 1 + pagecontext * pagesize - 1)"
|
||||
@dblclick="topHandler(scope.$index + 1 + pagecontext * pagesize - 1)"
|
||||
></TMagicButton>
|
||||
@ -70,7 +70,7 @@
|
||||
type="primary"
|
||||
:icon="ArrowDown"
|
||||
:disabled="disabled"
|
||||
text
|
||||
link
|
||||
@click="downHandler(scope.$index + 1 + pagecontext * pagesize - 1)"
|
||||
@dblclick="bottomHandler(scope.$index + 1 + pagecontext * pagesize - 1)"
|
||||
></TMagicButton>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<a v-if="config.href && !disabled" target="_blank" :href="href" :style="config.css || {}">{{ displayText }}</a>
|
||||
<span v-else-if="config.href && disabled" :style="config.disabledCss || {}">{{ displayText }}</span>
|
||||
<div v-else class="m-fields-link">
|
||||
<TMagicButton :text="true" type="primary" @click="editHandler">点击编辑</TMagicButton>
|
||||
<TMagicButton link type="primary" @click="editHandler">点击编辑</TMagicButton>
|
||||
<FormDialog
|
||||
ref="editor"
|
||||
:title="config.formTitle || '编辑扩展配置'"
|
||||
|
@ -11,7 +11,7 @@
|
||||
<TMagicButton
|
||||
v-show="display(action.display, scope.row) && !editState[scope.$index]"
|
||||
class="action-btn"
|
||||
text
|
||||
link
|
||||
size="small"
|
||||
:type="action.buttonType || 'primary'"
|
||||
:icon="action.icon"
|
||||
@ -22,7 +22,7 @@
|
||||
<TMagicButton
|
||||
class="action-btn"
|
||||
v-show="editState[scope.$index]"
|
||||
text
|
||||
link
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="save(scope.$index, config)"
|
||||
@ -31,7 +31,7 @@
|
||||
<TMagicButton
|
||||
class="action-btn"
|
||||
v-show="editState[scope.$index]"
|
||||
text
|
||||
link
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="editState[scope.$index] = undefined"
|
||||
|
@ -14,7 +14,7 @@
|
||||
:data="(config.prop && scope.row[config.prop]) || []"
|
||||
></MTable>
|
||||
<template #reference>
|
||||
<TMagicButton text type="primary"> {{ config.text || formatter(config, scope.row) }}</TMagicButton>
|
||||
<TMagicButton link type="primary"> {{ config.text || formatter(config, scope.row) }}</TMagicButton>
|
||||
</template>
|
||||
</TMagicPopover>
|
||||
</template>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
<TMagicButton
|
||||
v-else-if="config.action === 'actionLink' && config.prop"
|
||||
text
|
||||
link
|
||||
type="primary"
|
||||
@click="config.handler?.(scope.row)"
|
||||
>
|
||||
@ -43,7 +43,7 @@
|
||||
<template #content>
|
||||
<div>{{ formatter(config, scope.row) }}</div>
|
||||
</template>
|
||||
<TMagicButton text type="primary">{{ config.buttonText || '扩展配置' }}</TMagicButton>
|
||||
<TMagicButton link type="primary">{{ config.buttonText || '扩展配置' }}</TMagicButton>
|
||||
</el-tooltip>
|
||||
|
||||
<TMagicTag
|
||||
|
@ -126,7 +126,7 @@ const adapter: any = {
|
||||
theme: props.type,
|
||||
size: props.size === 'default' ? 'medium' : props.size,
|
||||
icon: () => (props.icon ? h(props.icon) : null),
|
||||
variant: props.text ? 'text' : 'base',
|
||||
variant: props.link || props.text ? 'text' : 'base',
|
||||
}),
|
||||
},
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
class="menu-item button"
|
||||
:key="index"
|
||||
size="small"
|
||||
text
|
||||
link
|
||||
@click="item.handler"
|
||||
>
|
||||
<TMagicIcon><component :is="item.icon"></component></TMagicIcon><span>{{ item.text }}</span>
|
||||
|
Loading…
x
Reference in New Issue
Block a user