mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-06-24 11:19:17 +08:00
fix: 升级element-plus2.2.0后,button默认样式变化
This commit is contained in:
parent
7dc54797d2
commit
1486beb52c
@ -2,10 +2,10 @@
|
|||||||
<el-tabs v-if="data.type === 'tabs'" class="m-editor-sidebar" v-model="activeTabName" type="card" tab-position="left">
|
<el-tabs v-if="data.type === 'tabs'" class="m-editor-sidebar" v-model="activeTabName" type="card" tab-position="left">
|
||||||
<el-tab-pane v-for="item in items" :key="item.text" :name="item.text">
|
<el-tab-pane v-for="item in items" :key="item.text" :name="item.text">
|
||||||
<template #label>
|
<template #label>
|
||||||
<span>
|
<div :key="item.text">
|
||||||
<m-icon v-if="item.icon" :icon="item.icon"></m-icon>
|
<m-icon v-if="item.icon" :icon="item.icon"></m-icon>
|
||||||
<div v-if="item.text" class="magic-editor-tab-panel-title">{{ item.text }}</div>
|
<div v-if="item.text" class="magic-editor-tab-panel-title">{{ item.text }}</div>
|
||||||
</span>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<component :is="item.component" v-bind="item.props || {}" v-on="item.listeners || {}">
|
<component :is="item.component" v-bind="item.props || {}" v-on="item.listeners || {}">
|
||||||
|
@ -14,6 +14,10 @@
|
|||||||
.el-tabs__item {
|
.el-tabs__item {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.el-input__wrapper {
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.m-editor-props-panel-popper {
|
.m-editor-props-panel-popper {
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
<el-button
|
<el-button
|
||||||
plain
|
plain
|
||||||
size="small"
|
size="small"
|
||||||
|
type="primary"
|
||||||
:icon="ArrowUp"
|
:icon="ArrowUp"
|
||||||
text
|
text
|
||||||
@click="upHandler(scope.$index + 1 + pagecontext * pagesize - 1)"
|
@click="upHandler(scope.$index + 1 + pagecontext * pagesize - 1)"
|
||||||
@ -57,6 +58,7 @@
|
|||||||
<el-button
|
<el-button
|
||||||
plain
|
plain
|
||||||
size="small"
|
size="small"
|
||||||
|
type="primary"
|
||||||
:icon="ArrowDown"
|
:icon="ArrowDown"
|
||||||
text
|
text
|
||||||
@click="downHandler(scope.$index + 1 + pagecontext * pagesize - 1)"
|
@click="downHandler(scope.$index + 1 + pagecontext * pagesize - 1)"
|
||||||
@ -107,10 +109,16 @@
|
|||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
<el-button v-if="addable" size="small" type="primary" plain @click="newHandler()">添加</el-button>
|
<el-button v-if="addable" size="small" type="primary" plain @click="newHandler()">添加</el-button>
|
||||||
<el-button :icon="Grid" size="small" @click="toggleMode" v-if="enableToggleMode && !isFullscreen"
|
<el-button :icon="Grid" size="small" type="primary" @click="toggleMode" v-if="enableToggleMode && !isFullscreen"
|
||||||
>展开配置</el-button
|
>展开配置</el-button
|
||||||
>
|
>
|
||||||
<el-button :icon="FullScreen" size="small" @click="toggleFullscreen" v-if="config.enableFullscreen !== false">
|
<el-button
|
||||||
|
:icon="FullScreen"
|
||||||
|
size="small"
|
||||||
|
type="primary"
|
||||||
|
@click="toggleFullscreen"
|
||||||
|
v-if="config.enableFullscreen !== false"
|
||||||
|
>
|
||||||
{{ isFullscreen ? '退出全屏' : '全屏编辑' }}
|
{{ isFullscreen ? '退出全屏' : '全屏编辑' }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-upload
|
<el-upload
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<a v-if="config.href && !disabled" target="_blank" :href="href" :style="config.css || {}">{{ displayText }}</a>
|
<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>
|
<span v-else-if="config.href && disabled" :style="config.disabledCss || {}">{{ displayText }}</span>
|
||||||
<div v-else class="m-fields-link">
|
<div v-else class="m-fields-link">
|
||||||
<el-button text @click="editHandler">点击编辑</el-button>
|
<el-button text type="primary" @click="editHandler">点击编辑</el-button>
|
||||||
<m-form-dialog
|
<m-form-dialog
|
||||||
ref="editor"
|
ref="editor"
|
||||||
:title="config.formTitle || '编辑扩展配置'"
|
:title="config.formTitle || '编辑扩展配置'"
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
v-html="action.text"
|
v-html="action.text"
|
||||||
class="action-btn"
|
class="action-btn"
|
||||||
text
|
text
|
||||||
|
type="primary"
|
||||||
size="small"
|
size="small"
|
||||||
:key="actionIndex"
|
:key="actionIndex"
|
||||||
@click="actionHandler(action, scope.row, scope.$index)"
|
@click="actionHandler(action, scope.row, scope.$index)"
|
||||||
@ -15,6 +16,7 @@
|
|||||||
class="action-btn"
|
class="action-btn"
|
||||||
v-show="editState[scope.$index]"
|
v-show="editState[scope.$index]"
|
||||||
text
|
text
|
||||||
|
type="primary"
|
||||||
size="small"
|
size="small"
|
||||||
@click="save(scope.$index, config)"
|
@click="save(scope.$index, config)"
|
||||||
>保存</el-button
|
>保存</el-button
|
||||||
@ -23,6 +25,7 @@
|
|||||||
class="action-btn"
|
class="action-btn"
|
||||||
v-show="editState[scope.$index]"
|
v-show="editState[scope.$index]"
|
||||||
text
|
text
|
||||||
|
type="primary"
|
||||||
size="small"
|
size="small"
|
||||||
@click="editState[scope.$index] = undefined"
|
@click="editState[scope.$index] = undefined"
|
||||||
>取消</el-button
|
>取消</el-button
|
||||||
@ -72,9 +75,9 @@ const display = (fuc: boolean | Function | undefined, row: any) => {
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const success = (msg: string, action: ColumnActionConfig) => {
|
const success = (msg: string, action: ColumnActionConfig, row: any) => {
|
||||||
ElMessage.success(msg);
|
ElMessage.success(msg);
|
||||||
action.after?.();
|
action.after?.(row);
|
||||||
};
|
};
|
||||||
|
|
||||||
const error = (msg: string) => ElMessage.error(msg);
|
const error = (msg: string) => ElMessage.error(msg);
|
||||||
@ -89,7 +92,7 @@ const deleteAction = async (action: ColumnActionConfig, row: any) => {
|
|||||||
const res = await action.handler?.(row);
|
const res = await action.handler?.(row);
|
||||||
|
|
||||||
if (res.ret === 0) {
|
if (res.ret === 0) {
|
||||||
success('删除成功!', action);
|
success('删除成功!', action, row);
|
||||||
} else {
|
} else {
|
||||||
error(res.msg || '删除失败');
|
error(res.msg || '删除失败');
|
||||||
}
|
}
|
||||||
@ -106,7 +109,7 @@ const copyHandler = async (action: ColumnActionConfig, row: any) => {
|
|||||||
const res = await action.handler?.(row);
|
const res = await action.handler?.(row);
|
||||||
|
|
||||||
if (res.ret === 0) {
|
if (res.ret === 0) {
|
||||||
success('复制成功!', action);
|
success('复制成功!', action, row);
|
||||||
} else {
|
} else {
|
||||||
error(`复制失败!${res.msg}`);
|
error(`复制失败!${res.msg}`);
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
:data="scope.row[config.prop]"
|
:data="scope.row[config.prop]"
|
||||||
></m-table>
|
></m-table>
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<el-button text> {{ config.text || formatter(config, scope.row) }}</el-button>
|
<el-button text type="primary"> {{ config.text || formatter(config, scope.row) }}</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</template>
|
</template>
|
||||||
|
@ -205,9 +205,6 @@ export default defineComponent({
|
|||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.m-table {
|
.m-table {
|
||||||
.el-button.action-btn {
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
.el-button.action-btn + .el-button.action-btn {
|
.el-button.action-btn + .el-button.action-btn {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
></m-form-container>
|
></m-form-container>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-button v-else-if="config.action === 'actionLink'" text @click="config.handler(scope.row)">
|
<el-button v-else-if="config.action === 'actionLink'" text type="primary" @click="config.handler(scope.row)">
|
||||||
{{ formatter(config, scope.row) }}
|
{{ formatter(config, scope.row) }}
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
@ -34,7 +34,7 @@
|
|||||||
<template #content>
|
<template #content>
|
||||||
<div>{{ formatter(config, scope.row) }}</div>
|
<div>{{ formatter(config, scope.row) }}</div>
|
||||||
</template>
|
</template>
|
||||||
<el-button text>扩展配置</el-button>
|
<el-button text type="primary">扩展配置</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
|
||||||
<el-tag
|
<el-tag
|
||||||
|
Loading…
x
Reference in New Issue
Block a user