v-maxlength

Vue 2.x directive for limiting textbox and textarea maxlength.

Usage no npm install needed!

<script type="module">
  import vMaxlength from 'https://cdn.skypack.dev/v-maxlength';
</script>

README

v-maxlength

bundlephobia minified size npm package version github license js standard style

Vue 2.x directive for limiting textbox and textarea maxlength.

Install

$ npm i --save v-maxlength

Usage

import Vue from 'vue'
const maxLength = require('v-maxlength').default;

Vue.use(maxLength)
<template>
  <textarea v-maxlength="50"></textarea>
  <input v-maxlength="50" />
</template>

Event Handler

  • input