vue-i18n icon indicating copy to clipboard operation
vue-i18n copied to clipboard

Installing the mixin on a case-by-case basis

Open ReinisV opened this issue 3 years ago • 0 comments

Clear and concise description of the problem

I dont want to have internationalization available in every little icon component, generic input component, list item wrapper, etc, etc.

I think localized strings should only be introduced (and thus, the mixin should only be introduced) in business related components, and generic ("dumb") components should not know anything about labels/tooltips/help-messages.

This is why I dont want to have to install the mixin globally via

import VueI18n from 'vue-i18n'

Vue.use(VueI18n)

Suggested solution

I would like to install it on a per component basis

import { mixin } from 'vue-i18n'

return Vue.extend({
  mixins: [mixin]
})

Alternative

No response

Additional context

I think everything for this is already in place, all we have to do is export a mixin instance so that it can be used.

though do correct me if I'm wrong and implementing this would require more work.

Validations

ReinisV avatar Dec 22 '21 10:12 ReinisV