0

Hello, I am building a micro frontend architecture with single-spa. In my main app (bootstrap), I declare my fragments, my routing and I inject the component library (ex: element UI), and my authentication library (custom).

Everything works fine, display and routing, though:

  1. how to use a component of elementUI in a fragment? Example:
import {Button} from 'element-ui'

I have tried with this code (where component_name is button or other)

<component :is="component_name">bla bla</component>

but Vue does not recognize this button.

  1. How to use utility functions of the authentication library. For example recover the access rights for a component? Calling the function directly does not work.

Thanks

Brice Chaponneau
  • 564
  • 2
  • 9
  • 22
  • are you dealing with dynamic, async components (e.g. https://vuejs.org/v2/guide/components-dynamic-async.html)? – Federico Moretti Oct 18 '20 at 10:01
  • Yes with . Else, how to use import myComponent from ? – Brice Chaponneau Oct 18 '20 at 10:09
  • it was just to be sure: have you tried enclosing your component in a `` element already (e.g. https://vuejs.org/v2/api/#keep-alive)? – Federico Moretti Oct 18 '20 at 10:24
  • Why use keep-alive component ? this is only to keep state. The problem is : How reference ElementUI from my boostrap for all fragments? Same for a utility library ? – Brice Chaponneau Oct 18 '20 at 10:36
  • AFAIK `` is now required for dynamic/async components to work; BTW, I don’t think you did something wrong here; just check your main import of both Bootstrap and Element UI (cfr. https://element.eleme.io/1.4/#/en-US/component/quickstart). – Federico Moretti Oct 18 '20 at 11:28
  • I’ve tried. Not better. Fragment do not recognize ElementUI. I don’t want install elementui in each fragment. I want it globally – Brice Chaponneau Oct 18 '20 at 12:47
  • @BriceChaponneau did you ever find an answer for the questions you had? I am especially interested in the authentication question. If so can you add the answer and mark it as answered? – Rutix Jun 14 '21 at 09:59
  • Yes. You need to create a styleguide to share components, style… – Brice Chaponneau Jun 15 '21 at 11:42

0 Answers0