Skip to content

Vue.js 2.x directive to set a default value for editable elements with no affect to the model state

License

Notifications You must be signed in to change notification settings

termosa/vue-default-value

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vue-default-value

A Vue.js Directive to set a default value for editable elements with no affect to the model state.

NPM version Bower version

Installation

Via NPM

Install the package

$ npm install vue-default-value

and require it in the code

var Vue = require('vue');
var VueDefaultValue = require('vue-default-value');
Vue.use(VueDefaultValue);

Via Bower

Install the package

$ bower install vue-default-value

add script on page

<script src="/bower_components/vue-default-value/dist/vue-default-value.js"></script>
<script>Vue.use(VueDefaultValue);</script>

or you can do it with RequireJS or any similar tool.

Usage

The directive can be used with any element that has value attribute.

Username: <input v-model="username" v-default-value="'Guest'" />

License

MIT © Stanislav Termosa

About

Vue.js 2.x directive to set a default value for editable elements with no affect to the model state

Resources

License

Stars

Watchers

Forks

Packages

No packages published