fragment component for vuejs
npm install vue-fragmentFragment so you won't have to change much code when Vue3 native fragments arrive. That said, I'm not a core developer of Vue.js, and I don't have any view of their implementation. I only know what fragments are and how they should work, and did my best to reproduce it ; so it _should_ be fine.
npm i -s vue-fragment
js
import Fragment from 'vue-fragment'
Vue.use(Fragment.Plugin)
// or
import { Plugin } from 'vue-fragment'
Vue.use(Plugin)
// …
export const MyComponent {
template: '
{{ message }}
',
data() { return { message: 'hello world }}
}
`
- Component:
`js
import { Fragment } from 'vue-fragment'
export const MyComponent {
components: { Fragment },
template: '
{{ message }}
',
data() { return { message: 'hello world }}
}
``