1.0.0 • Published 3 years ago

clear-on-disable v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

clear-on-disable

A small package for Vue that clears HTML form fields when they're being disabled.

Install

Download the package

yarn

yarn add clear-on-disable

npm

npm i clear-on-disable

Use the package in your main file

import ClearOnDisable from 'clear-on-disable';
Vue.use(ClearOnDisable);

Usage

Text

<input type="text" v-model="variable" :disabled="disableVariable" v-clear-on-disable />

Textarea

<textarea v-model="variable" :disabled="disableVariable" v-clear-on-disable></textarea>

Select

<select v-model="variable" :disabled="disableVariable" v-clear-on-disable>
  <option value="one">One</option>
  <option value="two">Two</option>
  <option value="three">Three</option>
</select>

Checkbox

<input type="checkbox" v-model="variable" :disabled="disableVariable" v-clear-on-disable />

Options

The following options are available and have these default values:

Vue.use(ClearOnDisable, {
  disableRadioButtonWarning: false  // When using v-clear-on-disable on radio buttons you will get a console warning because there's weird behaviour.
});
1.0.0

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago