Thunberg087 / vue-fragment

a very candide fragment component for Vue.js
http://jsfiddle.net/cdkn5wL3/
670 stars 51 forks source link

Vue fragment deletes dynamically generated element #38

Closed axelthat closed 4 years ago

axelthat commented 4 years ago

I have a dynamic component which renders html elements based on tag provided which is wrapped in a v-fragment component. However, when I change tag dynamically, for some reason, v-fragment deletes the element.

Here's the codesandbox element: https://codesandbox.io/s/wispy-field-8ksnv?fontsize=14&hidenavigation=1&theme=dark

Select different tag from the dropdown and you can see the element is deleted.

jordan-boyer commented 4 years ago

I have no problem with your code if I replace import { Fragment } from "vue-fragment"; with import { Plugin } from "vue-fragment"; and Vue.component("VFragment", Fragment); with Vue.use(Plugin)

I don't know why it doesn't work as a component !

axelthat commented 4 years ago

Yup confirmed it works. But it's weird it doesn't allow custom component id.