1.3.2 • Published 7 years ago

vue-ip-input-ar v1.3.2

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

vue-ip-input-ar

This is a forked project from VueIpInput. We develop some items based on VUE-1.

An ip input implement by vuejs

Demo

Demo

Usage

Install

npm install vue-ip-input-ar --save

And, if you are using vue 2.0

npm install vue-ip-input-ar@next --save

CommonJS

var VueIpInput = require('vue-ip-input-ar');

new Vue({
    components: {
        'vue-ip-input': VueIpInput
    },
    data: function () {
        return {
            ip: '127.0.0.1/16'
        };
    },
    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" :with-mask="true"></vue-ip-input>'
});

ES6

import VueIpInput from 'vue-ip-input-ar';

new Vue({
    components: {
        'vue-ip-input': VueIpInput
    },
    data() {
        return {
            ip: '127.0.0.1/16'
        };
    },
    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" :with-mask="true"></vue-ip-input>'
})

Props

PropertyDescription
ipthe value of ip input
onChangetrigger when the ip change
onBlurtrigger when the input blur
withMask‌Boolean variable of show select mask of ip

License

MIT

1.3.2

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago