statgen / bravo_vue

BRAVO's Vue JS based UI.
0 stars 0 forks source link

Implement Vue plugin for domain model constants #14

Open grosscol opened 2 years ago

grosscol commented 2 years ago

Accessing the constants in src/domainModel/*.js requires at least an import and possibly an additional private variable declaration to make constants available to templates.

Replace with a vue plugin such that the constants can be provided to the app and the components that use them can simply inject them. E.g.

// in plugins/domainModel.js
app.provide('domain', domainModel)
// in a component
export default {
  inject: ['domain'],