diff --git a/docs/product/widget.md b/docs/product/widget.md index 7c47bedb5..deec4644c 100644 --- a/docs/product/widget.md +++ b/docs/product/widget.md @@ -85,8 +85,8 @@ After adding a Widget, users can adjust its Name, Basic Config, Advanced Config, Both the code of the Stage and the Sprite can interact with the Widgets in the current Stage through the following interfaces: ```go -scoreMonitor := getWidget("score").(*Monitor) -usernameInput := getWidget("usernameInput").(*Input) +scoreMonitor := getWidget("score").(Monitor) +usernameInput := getWidget("usernameInput").(Input) // `show` & `setXYPos` are basic methods provided by all types of Widgets scoreMonitor.show diff --git a/docs/product/widget.zh.md b/docs/product/widget.zh.md index 0e1c5eb8a..cd21ab47f 100644 --- a/docs/product/widget.zh.md +++ b/docs/product/widget.zh.md @@ -86,8 +86,8 @@ Widget 添加完成后,用户可以调整其 Name、Basic Config、Advanced Co Stage 与 Sprite 的代码均可以通过以下接口与当前 Stage 中的 Widget 进行交互: ```go -scoreMonitor := getWidget("score").(*Monitor) -usernameInput := getWidget("usernameInput").(*Input) +scoreMonitor := getWidget("score").(Monitor) +usernameInput := getWidget("usernameInput").(Input) // `show` & `setXYPos` 等是基础方法,所有类别的 Widget 都会提供 scoreMonitor.show diff --git a/spx-gui/src/models/widget/widget.ts b/spx-gui/src/models/widget/widget.ts index 7fa018a2e..04dbaeec9 100644 --- a/spx-gui/src/models/widget/widget.ts +++ b/spx-gui/src/models/widget/widget.ts @@ -1,6 +1,6 @@ import { reactive } from 'vue' +import { Disposable } from '@/utils/disposable' import { validateWidgetName } from '../common/asset-name' -import { Disposable } from '../common/disposable' import type { Stage } from '../stage' export type BaseWidgetInits = {