Socket
Socket
Sign inDemoInstall

@pureadmin/descriptions

Package Overview
Dependencies
45
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @pureadmin/descriptions

Use tsx syntax to encapsulate element-plus Descriptions twice to provide flexible configuration items


Version published
Maintainers
1
Install size
117 MB
Created

Readme

Source

@pureadmin/descriptions

二次封装element-plus的Descriptions,提供灵活的配置项

NPM version NPM Downloads

简体中文 | English

🤔 开发初衷

  • element-plus DescriptionsDescriptions Item属性目前只能写在<template></template>模版里,这样不是很灵活,如果描述列表的Item足够多,代码写、看起来很臃肿,于是我开发了这个库,让我们一起探索吧

🚀 特性

  • 🦾 灵活度高: 使用tsx语法编写,保证类型的同时,给开发者提供了更灵活的写法,给使用者提供了更方便的配置
  • 完全可摇树: 自带 Tree-shaking,只对引入的代码进行打包
  • 🫶 代码零侵入: 保持element-plus Descriptions 所有属性、插槽的同时,提供更灵活的配置
  • 代码提交前校验: 使用 husky 对提交代码前进行规则校验,强制规范开发流程,防止开发失误

📦 安装

npm install @pureadmin/descriptions
or
pnpm add @pureadmin/descriptions

🦄 用法

局部注册(单文件)

import { PureDescriptions } from "@pureadmin/descriptions";

<pure-descriptions :data="data" :columns="columns"></pure-descriptions>

全局注册(main.ts)

import { createApp } from "vue";
import App from "./App.vue";

import PureDescriptions from "@pureadmin/descriptions";

const app = createApp(App);

app.use(PureDescriptions).mount("#app");

点击查看具体用法

Volar 支持

  • 如果您在使用 Volar,那么可以在 tsconfig.json 中配置 compilerOptions.types 来指定全局组件类型(尤其是全局注册时要想获得类型提示就需要加上下面配置)
// tsconfig.json
{
  "compilerOptions": {
    // ...
    "types": ["@pureadmin/descriptions/volar"]
  }
}

许可证

MIT © xiaoxian521-latest

Keywords

FAQs

Last updated on 12 Mar 2024

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc