mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-24 15:47:08 +00:00
Actually change version schema
This commit is contained in:
@@ -35,10 +35,14 @@ export const renderHtml: Hook<[any, Mounter], [string, string, string]> = {
|
||||
|
||||
choice({ choices, config, switchNode }, path, value, mounter) {
|
||||
const choice = switchNode.activeCase(path, true)
|
||||
const pathWithContext = (config?.context) ?
|
||||
new ModelPath(path.getModel(), new Path(path.getArray(), [config.context])) : path
|
||||
const pathWithContext = (config?.context) ? new ModelPath(path.getModel(), new Path(path.getArray(), [config.context])) : path
|
||||
const pathWithChoiceContext = config?.choiceContext ? new Path([], [config.choiceContext]) : config?.context ? new Path([], [config.context]) : path
|
||||
|
||||
const [prefix, suffix, body] = choice.node.hook(this, pathWithContext, value, mounter)
|
||||
if (choices.length === 1) {
|
||||
return [prefix, suffix, body]
|
||||
}
|
||||
|
||||
const inputId = mounter.register(el => {
|
||||
(el as HTMLSelectElement).value = choice.type
|
||||
el.addEventListener('change', () => {
|
||||
@@ -52,7 +56,6 @@ export const renderHtml: Hook<[any, Mounter], [string, string, string]> = {
|
||||
</option>`).join('')}
|
||||
</select>`
|
||||
|
||||
const [prefix, suffix, body] = choice.node.hook(this, pathWithContext, value, mounter)
|
||||
return [prefix, inject + suffix, body]
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user