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

vc-directive

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

vc-directive

A Vue custom directive library

latest
npmnpm
Version
0.1.4-Beta
Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

vc-directive - a vue custom directive library

vue2.x 自定义指令库

使用

  • 安装
npm install vc-directive

or

yarn add vc-directive
  • 全局注册
// main.js
import Vue from 'vue'
import VcDirectives from 'vc-directive'

Vue.use(VcDirectives)
...

然后在任一的vue组件中即可使用需要的指令,例如:

<div v-vcfocus></div>
  • 按需注册
<template>
    <div>
        <input v-focus v-model="text" />
    </div>
</template>
import { vcFocus } from 'vc-directive'
export default {
    directives: {
        vfocus: vcFocus
    },
    data() {
        return {
            text: 'hello vc-directive'
        }
    }
}

License

MIT License © 2022-PRESENT Panjinhong

Keywords

vue

FAQs

Package last updated on 25 May 2022

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