diff --git a/package.json b/package.json index 63276e8..40cbaba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wkitd", - "version": "1.1.2", + "version": "1.1.3", "type": "module", "main": "dist/index.js", "files": [ diff --git a/src/router/router-components.js b/src/router/router-components.js index 9143a8a..24cef99 100644 --- a/src/router/router-components.js +++ b/src/router/router-components.js @@ -5,7 +5,6 @@ import { __ROUTER_VIEW__ } from '../constants.js' class RouterView extends Component { static props = { - keepAlive: false, transition: false, current: { type: String, @@ -49,16 +48,20 @@ class RouterView extends Component { ] } if (this.keepAlive) { - let template = this.#views.map(it => [ + let template = this.#views.map(it => this.transition - ? `<${it} ref="${it}" :__keep_alive__="%s" #animation="%s" style="%s">` - : `<${it} ref="${it}" :__keep_alive__="%s" style=%s>`, - [ - this.current === it, - { ...option, immediate: this.current === it }, - this.current === it ? '' : 'display:none' - ] - ]) + ? [ + `<${it} ref="${it}" keep-alive #animation="%s" style="%s">`, + [ + { ...option, immediate: this.current === it }, + this.current === it ? '' : 'display:none' + ] + ] + : [ + `<${it} ref="${it}" keep-alive style=%s>`, + [this.current === it ? '' : 'display:none'] + ] + ) return raw( template.map(it => it[0]).join(''),