@coleman.rg/vue-options-plugin

A simple Vue plugin that shows how to use the options object

Usage no npm install needed!

<script type="module">
  import colemanRgVueOptionsPlugin from 'https://cdn.skypack.dev/@coleman.rg/vue-options-plugin';
</script>

README

optionsplugin

A demo of making a simple Vue 2 plugin and using it with values stored in the options object. This plugin logs out to the console the number of characters in an element. It also adds different CSS styles based on the length of characters in the element.

Installation

 npm install --save optionsplugin

Configuration

import Vue from 'vue';
import OptionsPlugin from 'optionsplugin'
Vue.use(OptionsPlugin, {
  selectedOption: {
    plum: "5px dashed purple",
    orange: "10px double orange"
  }
})

Usage

To use it, simply add the plugin's custom directive of v-text-length to an element in your template's code.