Skip to content

Commit

Permalink
fix: bring back ability to dynamically add bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
Demivan committed Aug 2, 2020
1 parent 3b29d2d commit e1360d3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/fluent-vue/src/fluentVue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,23 @@ export function createFluentVue(options: FluentVueOptions): FluentVue {
}
},

get bundles() {
return rootContext.bundles
},

set bundles(value: FluentBundle[]) {
rootContext.bundles = value
rootContext.refresh()

for (const context of contexts.keys()) {
context.refresh()
}

for (const subscriber of subscribers.keys()) {
subscriber.$forceUpdate()
}
},

install(vue: typeof Vue) {
return install(vue, this, rootContext)
},
Expand Down
1 change: 1 addition & 0 deletions packages/fluent-vue/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface IUpdatable {

export interface FluentVue {
locale: string | string[]
bundles: FluentBundle[]

install(vue: VueConstructor<Vue>): void

Expand Down

0 comments on commit e1360d3

Please sign in to comment.