1.0.1 • Published 4 years ago

vue-inline-input v1.0.1

Weekly downloads
16
License
MIT
Repository
github
Last release
4 years ago

vue-inline-input

An inline editable input component for Vue.

Displays as text and becomes editable by clicking or tapping.

Example

You can read how it was built here

Installation

npm install vue-inline-input

Browser

<script type="text/javascript" src="https://unpkg.com/vue"></script>
<script type="text/javascript" src="https://unpkg.com/vue-inline-input"></script>
<script type="text/javascript">
  Vue.use(InlineInput);
</script>

Module

import InlineInput from 'vue-inline-input';

Usage

Once installed, it can be used in a template as:

<inline-input v-model="amount" />

See the props table below for the available options.

Props

PropertyTypeDescriptionDefault
typestringThe input type. Could be text, number, textarea or selecttext
placeholderstringText to be shown as a placeholder while there is no inputempty string
label-classesstringCSS classes for the label elementempty string
input-classesstringCSS classes for the input elementempty string
rowsintegerTextarea rows2
colsintegerTextarea columns20
optionsarrayProvides the options for selects. Each object should have the format {label: x, value: x}[]

Events

EventDescription
blurFired when the input element loses focus. Also provides the input element's value

Contribution

Install dependencies

npm install

When you're done, build the dist files

npm run build

License

MIT