An open API service indexing awesome lists of open source software.

https://github.com/drewjbartlett/vue-multivue

Use multiple Vue apps of the same class on the same page
https://github.com/drewjbartlett/vue-multivue

app components javascript multiple reusable vue vuejs

Last synced: about 1 month ago
JSON representation

Use multiple Vue apps of the same class on the same page

Awesome Lists containing this project

README

          

# MultiVue for Vue.js

Use multiple vue apps of the same class on the same page.

## Vue support

Supports only Vue >= 2

## Installation

$ npm install vue-multivue --save

## JS & Vue

```vue
// AwesomeComponent.vue



export default {
data () {
return {
isDoingSomethingCool: false
}
},

methods: {
doSomethingCool () {
this.isDoingSomethingCool = true;
}
}
}

```

```js
// app.js
import MultiVue from 'vue-multivue';
import AwesomeComponent from './Components/AwesomeComponent.vue';

new MultiVue('.my-app', {
components: {
AwesomeComponent
}
});
```

## HTML

Now you can use your app with the `.my-app` selector multiple times on a single page.

```html





...



...





```