parent
d1e81474c0
commit
5e9dd986df
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "wkitd",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.3",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
"files": [
|
||||
|
|
|
@ -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}>`
|
||||
: `<${it} ref="${it}" :__keep_alive__="%s" style=%s></${it}>`,
|
||||
[
|
||||
this.current === it,
|
||||
{ ...option, immediate: this.current === it },
|
||||
this.current === it ? '' : 'display:none'
|
||||
]
|
||||
])
|
||||
? [
|
||||
`<${it} ref="${it}" keep-alive #animation="%s" style="%s"></${it}>`,
|
||||
[
|
||||
{ ...option, immediate: this.current === it },
|
||||
this.current === it ? '' : 'display:none'
|
||||
]
|
||||
]
|
||||
: [
|
||||
`<${it} ref="${it}" keep-alive style=%s></${it}>`,
|
||||
[this.current === it ? '' : 'display:none']
|
||||
]
|
||||
)
|
||||
|
||||
return raw(
|
||||
template.map(it => it[0]).join(''),
|
||||
|
|
Loading…
Reference in New Issue