2.0.2 • Published 6 years ago

vue-ip-input v2.0.2

Weekly downloads
37
License
ISC
Repository
github
Last release
6 years ago

vue-ip-input

Build Status codecov

An ip input implement by vue 2.0

Demo

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

PropertyDescription
ipthe value of ip input
onChangetrigger when the ip change
onBlurtrigger when the input blur

Contribution

First, install dependencies

npm install

Second, setup development environment

npm run dev

License

MIT

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

7 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago