migrate to vue3; autocomplete still needs work

This commit is contained in:
bkfox
2022-03-11 18:37:57 +01:00
parent ab8858154b
commit 5b788ca28f
34 changed files with 457 additions and 17868 deletions

View File

@ -34,16 +34,16 @@ export default class Builder {
* @param {Boolean} [reset=False]: if True, force application recreation.
* @return `app.mount`'s result.
*/
mount({content=null, title=null, el=null, reset=false}={}) {
mount({content=null, title=null, el=null, reset=false, props=null}={}) {
try {
this.unmount()
let config = this.config
if(el === null)
el = config.el
if(reset || !this.app)
this.app = this.createApp({title,content,el,...config})
this.app = this.createApp({title,content,el,...config}, props)
this.vm = this.app.mount(el)
window.scroll(0, 0)
return this.vm
@ -53,7 +53,7 @@ export default class Builder {
}
}
createApp({el, title=null, content=null, ...config}) {
createApp({el, title=null, content=null, ...config}, props) {
const container = document.querySelector(el)
if(!container)
throw `Error: can't get element ${el}`
@ -61,7 +61,7 @@ export default class Builder {
container.innerHTML = content
if(title)
document.title = title
return createApp(config)
return createApp(config, props)
}
unmount() {