Skip to content

Latest commit

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

v-field

πŸ–A Vue.js directive for dynamic input

<el-table
:data="tableData"
style="width: 100%">
<el-table-column
prop="date"
label="ζ—₯期"
width="180">
<template slot-scope="{row}">
<span v-field="{value: () => row.date, input: v => row.date = v}">{{ row.date }}<span>
</template>
</el-table-column>
</el-table>

Installation

npm i --save v-field
import Vue from 'vue';
import VField from 'v-field';
Vue.use(VField, directiveName); // default directiveName = 'field'

Playground on the Web

https://codesandbox.io/s/v-field-hh8g2 (interactive playground with webpack and ESM)

Options

<span
v-field="{
event: 'click', // dblclick
nodeName: 'TD', // TH
value: () => row.date, input: val => row.date = val,
disabled: () => false, inputClass: 'v-field',
inputType: 'text',
}"
>
{{ row.date }}
<span>

you can set defaultOptions

import VField from 'v-field';
VField.defaultOptions.event = 'dblclick';
VField.defaultOptions.nodeName = 'TH';

About

πŸ–A Vue.js directive for dynamic input

Resources

Stars

8 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages