diff --git a/src/layout/adder/HotAdder.tsx b/src/layout/adder/HotAdder.tsx
index 789acff..c005ff0 100644
--- a/src/layout/adder/HotAdder.tsx
+++ b/src/layout/adder/HotAdder.tsx
@@ -5,6 +5,7 @@ import useLayoutStore from '../useLayoutStore'
import { AddToToken } from './AdderPage'
import { v4 as uuid } from 'uuid'
import useAdderPageStore, { type HotAppType } from './useAdderPageStore'
+import { globalToast } from '@/main'
export const LinkItem = defineComponent({
props: {
@@ -83,8 +84,8 @@ export const LinkItem = defineComponent({
}
)}
onClick={() => {
- layout.addBlock(
- {
+ if (layout.openDir) {
+ layout.state.dir[layout.openDir].list.push({
id: uuid(),
link: props.content.url,
name: props.content.name,
@@ -95,11 +96,27 @@ export const LinkItem = defineComponent({
color: '',
w: 1,
h: 1
- },
- addTo?.value
- )
- if (addTo?.value) {
- layout.state.currentPage = addTo?.value
+ })
+ globalToast.success('添加成功')
+ } else {
+ layout.addBlock(
+ {
+ id: uuid(),
+ link: props.content.url,
+ name: props.content.name,
+ label: props.content.name,
+ icon: props.content.icon,
+ text: '',
+ background: '',
+ color: '',
+ w: 1,
+ h: 1
+ },
+ addTo?.value
+ )
+ if (addTo?.value) {
+ layout.state.currentPage = addTo?.value
+ }
}
}}
>
diff --git a/src/layout/grid/BlockWrapper.tsx b/src/layout/grid/BlockWrapper.tsx
index 0748b65..908202f 100644
--- a/src/layout/grid/BlockWrapper.tsx
+++ b/src/layout/grid/BlockWrapper.tsx
@@ -170,7 +170,7 @@ export default defineComponent({
{props.block.link ? (
props.block.link.startsWith('id:') ? (
// 文件夹
-