1.0.1 • Published 8 years ago

proto-vue v1.0.1

Weekly downloads
6
License
All Right Reserve...
Repository
-
Last release
8 years ago

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

  1. Register the component.
    import ProtoVue from 'proto-vue';

    Vue.use(ProtoVue);
  1. 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