single-spa-vue
Advanced tools
Comparing version 0.0.3 to 1.0.0
@@ -51,2 +51,3 @@ 'use strict'; | ||
mountedInstances.instance = new opts.Vue(opts.appOptions); | ||
mountedInstances.instance = mountedInstances.instance.bind(mountedInstances.instance); | ||
resolve(); | ||
@@ -63,2 +64,3 @@ }); | ||
}); | ||
} | ||
} | ||
//# sourceMappingURL=single-spa-vue.js.map |
{ | ||
"name": "single-spa-vue", | ||
"version": "0.0.3", | ||
"version": "1.0.0", | ||
"description": "a single-spa plugin for vue.js applications", | ||
"main": "lib/single-spa-vue.js", | ||
"scripts": { | ||
"build": "babel src --out-dir lib" | ||
"prepublish": "yarn build", | ||
"build": "babel src --out-dir lib --source-maps" | ||
}, | ||
@@ -9,0 +10,0 @@ "repository": { |
# single-spa-vuejs | ||
a single-spa plugin for vue.js applications | ||
Generic lifecycle hooks for Vue.js applications that are registered as [child applications](https://github.com/CanopyTax/single-spa/blob/master/docs/child-applications.md) of [single-spa](https://github.com/CanopyTax/single-spa). | ||
## Example | ||
In addition to this Readme, example usage of single-spa-vue can be found in the [single-spa-examples](https://github.com/CanopyTax/single-spa-examples/blob/master/src/vue/vue.app.js) project. | ||
## Quickstart | ||
First, in the child application, run `npm install --save single-spa-vue` (or `jspm install npm:single-spa-vue` if your child application is managed by jspm). Then, in your [child app's entry file](https://github.com/CanopyTax/single-spa/blob/docs-1/docs/configuring-child-applications.md#the-entry-file), do the following: | ||
```js | ||
import Vue from 'vue'; | ||
import singleSpaVue from 'single-spa-vue'; | ||
const vueLifecycles = singleSpaVue({ | ||
Vue, | ||
appOptions: { | ||
el: '#mount-location', | ||
template: '<div>some template</div>' | ||
} | ||
}); | ||
export const bootstrap = [ | ||
vueLifecycles.bootstrap, | ||
]; | ||
export const mount = [ | ||
vueLifecycles.mount, | ||
]; | ||
export const unmount = [ | ||
vueLifecycles.unmount, | ||
]; | ||
``` | ||
## Options | ||
All options are passed to single-spa-vue via the `opts` parameter when calling `singleSpaVue(opts)`. The following options are available: | ||
- `Vue`: (required) The main Vue object, which is generally either exposed onto the window or is available via `require('vue')` `import Vue from 'vue'`. | ||
- `appOptions`: (required) An object which will be used to instantiate your Vue.js application. `appOptions` will pass directly through to `new Vue(appOptions)` |
@@ -43,2 +43,3 @@ const defaultOpts = { | ||
mountedInstances.instance = new opts.Vue(opts.appOptions); | ||
mountedInstances.instance = mountedInstances.instance.bind(mountedInstances.instance) | ||
resolve(); | ||
@@ -45,0 +46,0 @@ }); |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
9878
6
96
0
43
1