Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:markRaw优化组件警告 #105

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/core/commands/ddos/ddosCommand.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommandType } from "../../command";
import { defineAsyncComponent } from "vue";
import { defineAsyncComponent, markRaw } from "vue";
import ComponentOutputType = YuTerminal.ComponentOutputType;

/**
Expand All @@ -14,7 +14,7 @@ const ddosCommand: CommandType = {
action(options, terminal) {
const output: ComponentOutputType = {
type: "component",
component: defineAsyncComponent(() => import("./DdosBox.vue")),
component: markRaw(defineAsyncComponent(() => import("./DdosBox.vue"))),
props: {},
};
terminal.writeResult(output);
Expand Down
4 changes: 2 additions & 2 deletions src/core/commands/hot/hotCommand.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommandType } from "../../command";
import { defineAsyncComponent } from "vue";
import { defineAsyncComponent, markRaw } from "vue";
import ComponentOutputType = YuTerminal.ComponentOutputType;

/**
Expand All @@ -22,7 +22,7 @@ const hotCommand: CommandType = {
async action(options, terminal) {
const output: ComponentOutputType = {
type: "component",
component: defineAsyncComponent(() => import("./HotBox.vue")),
component: markRaw(defineAsyncComponent(() => import("./HotBox.vue"))),
props: {},
};
terminal.writeResult(output);
Expand Down
4 changes: 2 additions & 2 deletions src/core/commands/relax/ikun/ikunCommand.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommandType } from "../../../command";
import { defineAsyncComponent } from "vue";
import { defineAsyncComponent, markRaw } from "vue";
import ComponentOutputType = YuTerminal.ComponentOutputType;

/**
Expand All @@ -14,7 +14,7 @@ const ikunCommand: CommandType = {
action(options, terminal) {
const output: ComponentOutputType = {
type: "component",
component: defineAsyncComponent(() => import("./IkunBox.vue")),
component: markRaw(defineAsyncComponent(() => import("./IkunBox.vue"))),
props: {},
};
terminal.writeResult(output);
Expand Down
6 changes: 4 additions & 2 deletions src/core/commands/relax/ikuntest/ikuntestCommand.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommandType } from "../../../command";
import { defineAsyncComponent } from "vue";
import { defineAsyncComponent, markRaw } from "vue";
import ComponentOutputType = YuTerminal.ComponentOutputType;

/**
Expand All @@ -15,7 +15,9 @@ const ikuntestCommand: CommandType = {
action(options, terminal) {
const output: ComponentOutputType = {
type: "component",
component: defineAsyncComponent(() => import("./IkunTestBox.vue")),
component: markRaw(
defineAsyncComponent(() => import("./IkunTestBox.vue"))
),
props: {},
};
terminal.writeResult(output);
Expand Down
4 changes: 2 additions & 2 deletions src/core/commands/relax/moyu/moyuCommand.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommandType } from "../../../command";
import { defineAsyncComponent } from "vue";
import { defineAsyncComponent, markRaw } from "vue";
import ComponentOutputType = YuTerminal.ComponentOutputType;

/**
Expand All @@ -14,7 +14,7 @@ const moyuCommand: CommandType = {
action(options, terminal) {
const output: ComponentOutputType = {
type: "component",
component: defineAsyncComponent(() => import("./MoYuBox.vue")),
component: markRaw(defineAsyncComponent(() => import("./MoYuBox.vue"))),
props: {},
};
terminal.writeResult(output);
Expand Down
4 changes: 2 additions & 2 deletions src/core/commands/relax/music/musicCommand.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommandType } from "../../../command";
import { defineAsyncComponent } from "vue";
import { defineAsyncComponent, markRaw } from "vue";
import ComponentOutputType = YuTerminal.ComponentOutputType;

/**
Expand Down Expand Up @@ -28,7 +28,7 @@ const musicCommand: CommandType = {
const name = _[0];
const output: ComponentOutputType = {
type: "component",
component: defineAsyncComponent(() => import("./MusicBox.vue")),
component: markRaw(defineAsyncComponent(() => import("./MusicBox.vue"))),
props: {
name,
},
Expand Down
6 changes: 4 additions & 2 deletions src/core/commands/search/bilibili/bilibiliCommand.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommandType } from "../../../command";
import { defineAsyncComponent } from "vue";
import { defineAsyncComponent, markRaw } from "vue";
import ComponentOutputType = YuTerminal.ComponentOutputType;

const baseUrl = "https://www.baidu.com/s";
Expand Down Expand Up @@ -41,7 +41,9 @@ const bilibiliCommand: CommandType = {
if (bvid) {
const output: ComponentOutputType = {
type: "component",
component: defineAsyncComponent(() => import("./BilibiliBox.vue")),
component: markRaw(
defineAsyncComponent(() => import("./BilibiliBox.vue"))
),
props: {
bvid,
},
Expand Down
8 changes: 5 additions & 3 deletions src/core/commands/terminal/help/helpCommand.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommandType } from "../../../command";
import { defineAsyncComponent } from "vue";
import { defineAsyncComponent, markRaw } from "vue";
import { commandMap } from "../../../commandRegister";
import ComponentOutputType = YuTerminal.ComponentOutputType;

Expand All @@ -25,7 +25,7 @@ const helpCommand: CommandType = {
if (_.length < 1) {
const output: ComponentOutputType = {
type: "component",
component: defineAsyncComponent(() => import("./HelpBox.vue")),
component: markRaw(defineAsyncComponent(() => import("./HelpBox.vue"))),
};
terminal.writeResult(output);
return;
Expand All @@ -48,7 +48,9 @@ const helpCommand: CommandType = {
}
const output: ComponentOutputType = {
type: "component",
component: defineAsyncComponent(() => import("./CommandHelpBox.vue")),
component: markRaw(
defineAsyncComponent(() => import("./CommandHelpBox.vue"))
),
props: {
command,
parentCommand,
Expand Down
4 changes: 2 additions & 2 deletions src/core/commands/terminal/info/infoCommand.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommandType } from "../../../command";
import { defineAsyncComponent } from "vue";
import { defineAsyncComponent, markRaw } from "vue";
import ComponentOutputType = YuTerminal.ComponentOutputType;

/**
Expand All @@ -14,7 +14,7 @@ const infoCommand: CommandType = {
action(options, terminal): void {
const output: ComponentOutputType = {
type: "component",
component: defineAsyncComponent(() => import("./InfoBox.vue")),
component: markRaw(defineAsyncComponent(() => import("./InfoBox.vue"))),
};
terminal.writeResult(output);
},
Expand Down
6 changes: 4 additions & 2 deletions src/core/commands/terminal/shortcut/shortcutCommand.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommandType } from "../../../command";
import { defineAsyncComponent } from "vue";
import { defineAsyncComponent, markRaw } from "vue";
import ComponentOutputType = YuTerminal.ComponentOutputType;

/**
Expand All @@ -17,7 +17,9 @@ const shortcutCommand: CommandType = {
action(options, terminal): void {
const output: ComponentOutputType = {
type: "component",
component: defineAsyncComponent(() => import("./ShortcutBox.vue")),
component: markRaw(
defineAsyncComponent(() => import("./ShortcutBox.vue"))
),
};
terminal.writeResult(output);
},
Expand Down
4 changes: 2 additions & 2 deletions src/core/commands/timing/timingCommand.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommandType } from "../../command";
import { defineAsyncComponent } from "vue";
import { defineAsyncComponent, markRaw } from "vue";
import ComponentOutputType = YuTerminal.ComponentOutputType;

/**
Expand All @@ -26,7 +26,7 @@ const timingCommand: CommandType = {
}
const output: ComponentOutputType = {
type: "component",
component: defineAsyncComponent(() => import("./TimingBox.vue")),
component: markRaw(defineAsyncComponent(() => import("./TimingBox.vue"))),
props: {
seconds,
},
Expand Down
4 changes: 2 additions & 2 deletions src/core/commands/todo/todoCommand.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommandType } from "../../command";
import { defineAsyncComponent } from "vue";
import { defineAsyncComponent, markRaw } from "vue";
import ComponentOutputType = YuTerminal.ComponentOutputType;
import addCommand from "./subCommands/addCommand";

Expand Down Expand Up @@ -28,7 +28,7 @@ const todoCommand: CommandType = {
if (_.length < 1) {
const output: ComponentOutputType = {
type: "component",
component: defineAsyncComponent(() => import("./TodoBox.vue")),
component: markRaw(defineAsyncComponent(() => import("./TodoBox.vue"))),
};
terminal.writeResult(output);
return;
Expand Down
6 changes: 4 additions & 2 deletions src/core/commands/varbook/varbookCommand.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommandType } from "../../command";
import { defineAsyncComponent } from "vue";
import { defineAsyncComponent, markRaw } from "vue";
import ComponentOutputType = YuTerminal.ComponentOutputType;
import { checkSearchText } from "./hooks/character/standard";

Expand Down Expand Up @@ -27,7 +27,9 @@ const varbookCommand: CommandType = {
if (!searchText) return;
const output: ComponentOutputType = {
type: "component",
component: defineAsyncComponent(() => import("./VarbookBox.vue")),
component: markRaw(
defineAsyncComponent(() => import("./VarbookBox.vue"))
),
props: {
searchText,
},
Expand Down