vue-ip-input
vue-ip-input
An ip input implement by vue 2.0
Demo
Usage
Install
npm install vue-ip-input --save
CommonJS
var VueIpInput = require('vue-ip-input');
new Vue({
components: {
'vue-ip-input': VueIpInput
},
data: function () {
return {
ip: '127.0.0.1'
};
},
methods: {
onIpChange: function(ip) {
console.log('ip input change:', ip);
},
onIpBlur: function (ip) {
console.log('ip input blur:', ip);
}
},
template: '<vue-ip-input :ip="ip" :on-change="onIpChange" :on-blur="onIpBlur"></vue-ip-input>'
});
ES6
import VueIpInput from 'vue-ip-input';
new Vue({
components: {
'vue-ip-input': VueIpInput
},
data() {
return {
ip: '127.0.0.1'
};
},
methods: {
onIpChange(ip) {
console.log('ip input change:', ip);
},
onIpBlur(ip) {
console.log('ip input blur:', ip);
}
},
template: '<vue-ip-input :ip="ip" :on-change="onIpChange" :on-blur="onIpBlur"></vue-ip-input>'
})
Props
Property | Description |
---|---|
ip | the value of ip input |
onChange | trigger when the ip change |
onBlur | trigger when the input blur |
Contribution
First, install dependencies
npm install
Second, setup development environment
npm run dev
License
Dependencies
Dependencies
babel-core: ^6.5.2babel-loader: ^6.2.2babel-plugin-transform-runtime: ^6.5.2babel-preset-es2015: ^6.5.0babel-runtime: ^6.9.2codecov: ^1.0.1css-loader: ^0.23.1eslint: ^3.1.1eslint-config-google: ^0.6.0eslint-config-vue: ^1.0.3eslint-plugin-html: ^1.5.1file-loader: ^0.8.5isparta: ^4.0.0isparta-loader: ^2.0.0istanbul: ^0.4.4jasmine-core: ^2.4.1karma: ^1.2.0karma-babel-preprocessor: ^6.0.1karma-coverage: ^1.1.1karma-html-reporter: ^0.2.7karma-jasmine: ^1.0.2karma-phantomjs-launcher: ^1.0.1karma-spec-reporter: 0.0.26karma-verbose-reporter: 0.0.3karma-webpack: ^1.8.0node-sass: ^3.4.2phantomjs: ^2.1.7sass-loader: ^3.1.2style-loader: ^0.13.0url-loader: ^0.5.7vue-hot-reload-api: ^1.3.2vue-html-loader: ^1.1.0vue-loader: ^8.1.3vue-style-loader: ^1.0.0webpack: ^2.1.0-beta.2webpack-dev-server: ^1.15.0webpack-merge: ^0.14.1