0.1.2 • Published 3 years ago

widgetify v0.1.2

Weekly downloads
5
License
ISC
Repository
github
Last release
3 years ago

API

Widgets

Widget's options

import MyWidget from "./Component";
import MyWidgetPreview from "./Preview";

// widget's options
let widgetOptions = {
  name: "MyWidget", // must be unique
  component: MyWidget, // component of component name if registered globally
  preview: MyWidgetPreview, // same
  configurator: "DefaultWidgetConfigurator", // same
  title: "my widget", // human readable friendly title (for display purposes)
  icon: "fa-bicycle",
};

Adding a widget

import Vue from "vue";
Vue.$widgets.add(widgetOptions);

// or directly inside of a component
export default {
  name:"foo",
  ...,
  created(){
    this.$widgets.add(widgetOptions);
  }
  ...
}

Widget Configurator

Event: 'configured'

should be sent with widget's props as payload in order to configure it

Event: 'cancel'

cancels the configuration process

0.1.2

3 years ago

0.1.1

4 years ago

0.1.0

4 years ago