项目作者: ukchukx

项目描述 :
An inline editable input component
高级语言: JavaScript
项目地址: git://github.com/ukchukx/vue-inline-input.git
创建时间: 2020-01-12T20:29:05Z
项目社区:https://github.com/ukchukx/vue-inline-input

开源协议:

下载


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 @ukchukx/ad7ef6403694">here

Installation

  1. npm install vue-inline-input

Browser

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

Module

  1. import InlineInput from 'vue-inline-input';

Usage

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

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

See the props table below for the available options.

Props

Property Type Description Default
type string The input type. Could be text, number, textarea or select text
placeholder string Text to be shown as a placeholder while there is no input empty string
label-classes string CSS classes for the label element empty string
input-classes string CSS classes for the input element empty string
rows integer Textarea rows 2
cols integer Textarea columns 20
options array Provides the options for selects. Each object should have the format {label: x, value: x} []

Events

Event Description
blur Fired when the input element loses focus. Also provides the input element’s value

Contribution

Install dependencies

  1. npm install

When you’re done, build the dist files

  1. npm run build

License

MIT