vue-default-value
v1.0.2
Published
Vue.js Directive to set a default value in the value attribute that will not affect the model state.
Downloads
34
Maintainers
Readme
vue-default-value
A Vue.js Directive to set a default value for editable elements with no affect to the model state.
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