New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

v-field

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

v-field

a vue custom-directive

latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

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';

Keywords

vue

FAQs

Package last updated on 03 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts