We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Schema.dynamic
如图,上面 1,2,3 是动态设置的 schema,其中 2,3 是多选的数组,无法显示。4,5是手动设置的 schema,正常显示。
import { Context, Schema } from "koishi"; export const name = "test"; export interface Config {} enum Intents { FOO = 1, BAR = 2, QUX = 4, } export const Config: Schema<Config> = Schema.object({ dynamicBitset: Schema.dynamic("dynamicBitset"), dynamicArray: Schema.dynamic("dynamicArray").role("checkbox"), dynamicSelect: Schema.dynamic("dynamicSelect").role("select"), bitset: Schema.bitset(Intents) .default(Intents.FOO | Intents.QUX) .role("checkbox"), array: Schema.array(Schema.union(["FOO", "BAR", "QUX"])) .default(["FOO", "QUX"]) .role("select"), }); export function apply(ctx: Context, config: Config) { ctx.schema.set( "dynamicBitset", Schema.bitset(Intents) .default(Intents.FOO | Intents.QUX) .role("checkbox") ); ctx.schema.set( "dynamicArray", Schema.array(Schema.union(["FOO", "BAR", "QUX"])) ); ctx.schema.set( "dynamicSelect", Schema.array(Schema.union(["FOO", "BAR", "QUX"])).role("select") ); }
全部正常显示。
No response
@koishijs/plugin-config
@koishijs/client
@koishijs/plugin-console
在 yarn dev 模式下运行,则所有用 dynamic 设置的 schema 都无法正常显示。
yarn dev
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
如图,上面 1,2,3 是动态设置的 schema,其中 2,3 是多选的数组,无法显示。4,5是手动设置的 schema,正常显示。
Steps to reproduce
Expected behavior
全部正常显示。
Screenshots
No response
Versions
@koishijs/plugin-config
: 2.8.6@koishijs/client
: 5.30.0@koishijs/plugin-console
: 5.30.0Additional context
在
yarn dev
模式下运行,则所有用 dynamic 设置的 schema 都无法正常显示。The text was updated successfully, but these errors were encountered: