diff --git a/docs/.vuepress/components/DemoViewer.vue b/docs/.vuepress/components/DemoViewer.vue
new file mode 100644
index 000000000..bec815183
--- /dev/null
+++ b/docs/.vuepress/components/DemoViewer.vue
@@ -0,0 +1,33 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/modules/Traits.md b/docs/modules/Traits.md
index fdfc3c8a2..0b14f0e50 100644
--- a/docs/modules/Traits.md
+++ b/docs/modules/Traits.md
@@ -488,7 +488,7 @@ To recap what we have done so far, to create a custom trait type all you will ne
### Result
The final result of what we have done can be seen here
-
+
### Integrate external UI components
@@ -499,7 +499,7 @@ editor.TraitManager.addType('slider', {
createInput({ trait }) {
const vueInst = new Vue({ render: h => h(VueSlider) }).$mount();
const sliderInst = vueInst.$children[0];
- sliderInst.$on('change', ev => this.onChange(ev));
+ sliderInst.$on('change', ev => this.onChange(ev)); // Use onChange to trigger onEvent
this.sliderInst = sliderInst;
return vueInst.$el;
},
@@ -516,4 +516,14 @@ editor.TraitManager.addType('slider', {
});
```
-
\ No newline at end of file
+
+
+The integration with external components is possible by following those simple core points:
+
+1. **Component rendering**: `new Vue({ render: ...`
+ Depends on the framework, for example, in React it should be `ReactDOM.render(element, ...`
+1. **Change propogation**: `sliderInst.$on('change', ev => this.onChange(ev))`
+ The framework should have a mechanism to subscribe to changes and the component [should expose that change](https://nightcatsama.github.io/vue-slider-component/#/api/events)
+ We've also used `onChange` method which comes handy when you need to trigger manually the `onEvent` event (you should never call directly `onEvent` method, but only via `onChange` when you need)
+1. **Property getters/setters**: [`sliderInst.getValue()`](https://nightcatsama.github.io/vue-slider-component/#/api/methods?hash=getvalue)/ [`sliderInst.setValue(value)`](https://nightcatsama.github.io/vue-slider-component/#/api/methods?hash=setvaluevalue)
+ The component should allow to read and write data from the instance