mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-23 15:17:09 +00:00
Add model and add event listeners
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { AbstractNode, NodeMods } from './AbstractNode'
|
||||
import { DataModel } from '../model/DataModel'
|
||||
import { Path } from '../model/Path'
|
||||
|
||||
export class EnumNode extends AbstractNode<string> {
|
||||
protected options: string[]
|
||||
@@ -8,10 +10,13 @@ export class EnumNode extends AbstractNode<string> {
|
||||
this.options = options
|
||||
}
|
||||
|
||||
render (field: string, value: string) {
|
||||
return `<span>${field}</span>
|
||||
updateModel(el: Element, path: Path, model: DataModel) {
|
||||
}
|
||||
|
||||
render(path: Path, value: string, model: DataModel) {
|
||||
return this.wrap(path, model, `<span>${path.last()}</span>
|
||||
<select value="${value}">
|
||||
${this.options.map(o => `<option>${o}</option>`)}
|
||||
</select>`
|
||||
</select>`)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user