refactor timi-web

This commit is contained in:
Timi
2026-08-27 16:04:06 +08:00
parent 13bd61326d
commit 7ef7653deb
33 changed files with 1193 additions and 1097 deletions
@@ -1,19 +1,18 @@
<template>
<t-button v-popup="'插入内嵌网页'" variant="outline" :theme="active ? 'primary' : 'default'" @click="openDialog">
<t-button v-popup="'插入内嵌网页'" :variant="active ? 'base' : 'text'" :theme="active ? 'light' : 'default'" @click="openDialog">
<t-icon name="web" />
</t-button>
<t-popup
<bottom-popup
v-model="visible"
placement="bottom"
title="插入内嵌网页"
left-button-text="取消"
right-button-text="插入"
@left-button-click="visible = false"
@right-button-click="onConfirm"
destroy-on-close
>
<div class="form-popup">
<div class="popup-head">
<span class="title">插入内嵌网页</span>
<t-button shape="square" size="small" variant="text" title="关闭" @click="visible = false">
<t-icon name="close" />
</t-button>
</div>
<t-form class="form-content" label-align="left" label-width="auto">
<t-form-item label="网页地址">
<t-input v-model="iframeForm.src" placeholder="请输入网页地址" />
@@ -28,17 +27,14 @@
<t-input v-model="iframeForm.height" placeholder="请输入高度,默认 28rem" />
</t-form-item>
</t-form>
<div class="popup-actions">
<t-button variant="outline" block @click="visible = false">取消</t-button>
<t-button theme="primary" block @click="onConfirm">插入</t-button>
</div>
</div>
</t-popup>
</bottom-popup>
</template>
<script lang="ts" setup>
import { showPlatformMessage } from "../message";
import type { TiptapEditorInstance } from "timi-web/editor";
import BottomPopup from "../bottom-popup/index.vue";
defineOptions({
name: "TiptapIframeButton"
@@ -117,33 +113,11 @@ async function onConfirm() {
overflow-y: auto;
background: var(--td-bg-color-container);
.popup-head {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 1rem;
.title {
font-size: 1rem;
font-weight: 600;
color: var(--td-text-color-primary, #000);
}
}
.form-content {
:deep(.t-form__item) {
margin-bottom: .875rem;
}
}
.popup-actions {
gap: .75rem;
display: flex;
margin-top: 1rem;
:deep(.t-button) {
flex: 1;
}
}
}
</style>