Add new tab animation
This commit is contained in:
parent
2b98714548
commit
b2160ae159
3 changed files with 51 additions and 14 deletions
|
@ -16,6 +16,7 @@ export class NavigationTabModel {
|
|||
id = genTabId()
|
||||
history: HistoryItem[] = [{url: '/', ts: Date.now()}]
|
||||
index = 0
|
||||
isNewTab = false
|
||||
|
||||
constructor() {
|
||||
makeAutoObservable(this, {
|
||||
|
@ -112,6 +113,10 @@ export class NavigationTabModel {
|
|||
this.current.title = title
|
||||
}
|
||||
|
||||
setIsNewTab(v: boolean) {
|
||||
this.isNewTab = v
|
||||
}
|
||||
|
||||
// persistence
|
||||
// =
|
||||
|
||||
|
@ -208,6 +213,7 @@ export class NavigationModel {
|
|||
newTab(url: string, title?: string) {
|
||||
const tab = new NavigationTabModel()
|
||||
tab.navigate(url, title)
|
||||
tab.isNewTab = true
|
||||
this.tabs.push(tab)
|
||||
this.tabIndex = this.tabs.length - 1
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue