@mixspa/vue

0.6.1 • Public • Published

mixspa-vue

Mixspa-vue is a wrapper for mixspa-core with vue.

Current Status:

NPM Version NPM Downloads Build Status

NPM

What it come from?

Pleas reference here: mixspa-core

Apis for this library

createApp: create a mixspa app.

import { createApp } from '@mixspa/vue';
import App from './App';

createApp('vue-app', ({ baseurl }) => {
  return {
    render: h => h(App)
  };
});

mixin: Receive event and handle url change event.

import { mixin } from '@mixspa/vue';
import App from './App';
import router from './router';

new Vue({
  mixins: [mixin],
  router: router,
  render: h => h(App, { props: { baseUrl: '' } })
}).$mount('#app');

AppLoader: load a mixspa app.

<template>
  <app-loader app-id="vue-app" app-props="{}">
    <div v-slot:loading>Loading...</div>
    <div v-slot:fallback>Not found</div>
  </app-loader>
</template>

<script>
import { AppLoader } from '@mixspa/vue'
export default {
  components: {
    'app-loader': AppLoader
  }
}
</script>

AppLink: This link will send a event to event bus.

<template>
  <app-link to="/vue-app">Vue App</app-link>
</template>

<script>
import { AppLink } from '@mixspa/vue'
export default {
  components: {
    'app-link': AppLink
  }
}
</script>

License

mixspa-vue is released under the MIT license.

Readme

Keywords

Package Sidebar

Install

npm i @mixspa/vue

Weekly Downloads

0

Version

0.6.1

License

MIT

Unpacked Size

10.2 kB

Total Files

10

Last publish

Collaborators

  • xqcao