single-spa / single-spa-vue

a single-spa plugin for vue.js applications
MIT License
182 stars 42 forks source link

Add replaceMode onto User Options #73

Closed mbomfim33 closed 3 years ago

mbomfim33 commented 3 years ago

This PR is related to #64 discussion, and it is a pretty naive implementation of what I understand would suffice to allow users to mount their applications onto the specified DOM element, and avoid the concatenation of .single-spa-container class.

mbomfim33 commented 3 years ago

Hey, @joeldenning, sure. I'll start the tests and trying it out now, just wanted to be sure that this was what we are looking for. Is there any other specific scenarios I should be worried about with this new condition? Or that's all good?

joeldenning commented 3 years ago

We should verify that the following code would result in the following html:

singleSpaVue({
  el: '#vue-app',
  replaceMode: true,
  // rest of options
})
<template>
  <div id="vue-app">
    <button>Hi</button>
  </div>
</template>
<html>
  <body>
    <div id="vue-app">
      <button>Hi</button>
    </div>
  </body>
</html>
mbomfim33 commented 3 years ago

@joeldenning, done. Should have TDD'ed here, but oh well.

joeldenning commented 3 years ago

I documented this in https://github.com/single-spa/single-spa.js.org/pull/443 and released it in https://github.com/single-spa/single-spa-vue/releases/tag/v2.3.0