Comparing version 2.0.1 to 2.0.2
@@ -247,3 +247,5 @@ module.exports = | ||
window.AIMER_VERSION = "2.0.1"; | ||
if (typeof window !== 'undefined') { | ||
window.AIMER_VERSION = "2.0.2"; | ||
} | ||
@@ -260,3 +262,3 @@ var Aimer = function () { | ||
this.adapter = new Adapter(); | ||
this.Adapter = Adapter; | ||
this.stories = []; | ||
@@ -288,3 +290,3 @@ this.config = config; | ||
props: { | ||
adapter: _this.adapter, | ||
Adapter: _this.Adapter, | ||
stories: _this.stories, | ||
@@ -556,2 +558,12 @@ config: _this.config | ||
function mountComponent(adapter, targetWrapper, component) { | ||
if (adapter.isMount()) { | ||
adapter.unmount(targetWrapper.firstChild); | ||
targetWrapper.removeChild(targetWrapper.firstChild); | ||
} | ||
var target = document.createElement('div'); | ||
targetWrapper.appendChild(target); | ||
adapter.mount(component, target); | ||
} | ||
/* harmony default export */ __webpack_exports__["a"] = ({ | ||
@@ -561,4 +573,4 @@ name: 'aimer', | ||
props: { | ||
adapter: { | ||
type: Object, | ||
Adapter: { | ||
type: Function, | ||
required: true | ||
@@ -601,2 +613,3 @@ }, | ||
mounted: function mounted() { | ||
this.adapter = new this.Adapter(); | ||
this.handleRender(); | ||
@@ -609,13 +622,6 @@ }, | ||
var targetWrapper = this.$refs.targetWrapper; | ||
if (this.adapter.isMount()) { | ||
this.adapter.unmount(targetWrapper.firstChild); | ||
targetWrapper.removeChild(targetWrapper.firstChild); | ||
} | ||
var target = document.createElement('div'); | ||
targetWrapper.appendChild(target); | ||
var component = this.currentStory.component; | ||
component = typeof component === 'function' ? component() : component; | ||
this.adapter.mount(component, target); | ||
mountComponent(this.adapter, targetWrapper, component); | ||
@@ -622,0 +628,0 @@ updateURL({ |
{ | ||
"name": "aimer", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "The UI Development Framework", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
350771
10754