vue-web-component-wrapper | Vue 2 only ) Wrap a Vue component | Web Framework library
kandi X-RAY | vue-web-component-wrapper Summary
kandi X-RAY | vue-web-component-wrapper Summary
Wrap a Vue component as a web component / custom element.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Wraps a component in a component instance .
vue-web-component-wrapper Key Features
vue-web-component-wrapper Examples and Code Snippets
Community Discussions
Trending Discussions on vue-web-component-wrapper
QUESTION
I'm creating a Vue web component using vue-cli 3 and the --target wc
option. I also need the component to use the vue-i18n plugin, which requires some options to be passed to the main Vue instance like this:
ANSWER
Answered 2018-Nov-20 at 15:40The i18n plugin needs to be initialized on the "entry" component (i.e. the one that forms the base of the web component) instead of the root component.
But even doing that, it's important that all messages are defined on the entry component. Defining messages on a child component, either directly in the component or using the element, effectively overrides the vue-i18n config from the entry component and causes that child component to use the default language of en-US.
Here is a simple working example:
Entry Component
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install vue-web-component-wrapper
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page