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

vue-dictionary

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-dictionary

vue-dictionary

latest
Source
npmnpm
Version
2.1.0
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

VueDictionary

一个后台管理系统通用的字典数据组件
文档

安装

npm i vue-dictionary
# or
yarn add vue-dictionary

使用

全部引入

import { createApp } from "vue";
import App from "./App.vue";
import VueDictionary from "vue-dictionary";

const app = createApp(App);

// global config
const getDict = (type: string) => axios.get("/api/dict/" + type);
app.use(VueDictionary, {
  label: "title",
  value: "id",
  children: "child",
  request: getDict,
  res: "res.data"
});

app.mount("#app");

手动引入

<!-- App.vue -->
<template>
  <v-dict type="select" :data="[]"></v-dict>
  <!-- Same As -->
  <dict-select :data="[]"></dict-select>
</template>
<script setup>
  import { VDict, DictSelect } from "vue-dictionary";
</script>

Volar 支持

tsconfig.json 中为 Volar 添加类型定义

// tsconfig.json
{
  "compilerOptions": {
    // ...
    "types": ["vue-dictionary/global"]
  }
}

Keywords

vite

FAQs

Package last updated on 28 Jun 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