fragment-for-vue
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Fragment For Vue

Provide multi-root support in Vue 2, and able to work in Vue 3.

Comparison with vue-fragment

Features fragment-for-vue vue-fragment
Vue 3
Vue Devtools
Directive v-for
Directive v-if
TypeScript

⬇️ Install

npm i -S fragment-for-vue

📃 Usage

In Vue 2

import Vue from 'vue'
import { FragmentPlugin } from 'fragment-for-vue'

Vue.use(FragmentPlugin)
<script>
    import { Fragment } from 'fragment-for-vue'

    export default {
        components: {
            Fragment,
        },
    }
</script>
<template>
    <Fragment>
        <h1>title</h1>
        <Fragment v-for="i in 6" :key="i">
            <p>Num is {{ i }}</p>
        </Fragment>
    </Fragment>
</template>

In Vue 3

- import { Fragment } from 'fragment-for-vue'
+ import { Fragment } from 'fragment-for-vue/vue3'
import Vue from 'vue'
import { FragmentPlugin } from 'fragment-for-vue/vue3'

Vue.use(FragmentPlugin)

☎️ Contact

  1. WeChat: ambit_tsai
  2. QQ Group: 663286147
  3. E-mail: ambit_tsai@qq.com

Package Sidebar

Install

npm i fragment-for-vue

Weekly Downloads

134

Version

1.0.1

License

Apache-2.0

Unpacked Size

23.6 kB

Total Files

9

Last publish

Collaborators

  • ambit_tsai