Skip to content

Commit e1360d3

Browse files
committed
fix: bring back ability to dynamically add bundles
1 parent 3b29d2d commit e1360d3

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

packages/fluent-vue/src/fluentVue.ts

+17
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,23 @@ export function createFluentVue(options: FluentVueOptions): FluentVue {
151151
}
152152
},
153153

154+
get bundles() {
155+
return rootContext.bundles
156+
},
157+
158+
set bundles(value: FluentBundle[]) {
159+
rootContext.bundles = value
160+
rootContext.refresh()
161+
162+
for (const context of contexts.keys()) {
163+
context.refresh()
164+
}
165+
166+
for (const subscriber of subscribers.keys()) {
167+
subscriber.$forceUpdate()
168+
}
169+
},
170+
154171
install(vue: typeof Vue) {
155172
return install(vue, this, rootContext)
156173
},

packages/fluent-vue/src/interfaces.ts

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export interface IUpdatable {
1313

1414
export interface FluentVue {
1515
locale: string | string[]
16+
bundles: FluentBundle[]
1617

1718
install(vue: VueConstructor<Vue>): void
1819

0 commit comments

Comments
 (0)