1.0.1 • Published 8 years ago
proto-vue v1.0.1
proto-vue
A Vue plugin enabling easy creation, communication, and management of iFrame protoviewer elements.
Dependencies
- Promises
- VueJS
- Protoviewer endpoint returning HTML which uses evnt-hub
Installation
Download the repository to your node_modules directory. Hopefully we will add npm support soon.
Getting Started
- Register the component.
import ProtoVue from 'proto-vue';
Vue.use(ProtoVue);
- Initialize your viewers by class name.
// component.js
new Vue({
name: 'app',
mounted() {
this.$pv.init().then(() => {
// subscribe to the iframe events by name
this.$pv.sub('mouseClick', this.handlePVMouse);
});
},
methods: {
handlePVMouse(type, payload) {
// Logs 'Event captured: mouseClick {mouseX: ___, mouseY: ___}
console.log('Event captured: ', type, payload);
}
}
});
Development Setup
npm install
npm run dev
npm run dev:demo # open http://localhost:8100/ in a web browser
npm run build
npm run test
npm run test:watch
1.0.1
8 years ago