@pureadmin/descriptions
Secondary encapsulation of element-plus Descriptions, providing flexible configuration items
English | 简体中文
🤔 Original intention of development
element-plus
DescriptionsDescriptions Item
attribute can only be written in the<template></template>
template at present, which is not very flexible. If there are enoughItem
describing the list, the code is written and looks bloated, so I developed this library, Let's explore together
🚀 Features
🦾 High flexibility: Written usingtsx
syntax, while ensuring the type, it provides developers with more flexible writing methods and provides users with more convenient configuration⚡ Fully tree-shaking: Comes with Tree-shaking, only packages the imported code- 🫶 Code Zero Intrusion: Keep all attributes and slots of
element-plus
Descriptions and provide more Flexible configuration ⚓ Verification before code submission: Use husky to verify the rules before submitting code, enforce standard development process and prevent development mistakes
📦 Install
npm install @pureadmin/descriptions
or
pnpm add @pureadmin/descriptions
🦄 Usage
Partial registration (single file)
import { PureDescriptions } from "@pureadmin/descriptions";
<pure-descriptions :data="data" :columns="columns"></pure-descriptions>
Global registration (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");
Click to view the specific usage
Volar support
- If you are using
Volar
, you can configure compilerOptions.types in tsconfig.json to specify the global component type (especially if you want to get type hints during global registration, you need to add the following configuration)
// tsconfig.json
{
"compilerOptions": {
// ...
"types": ["@pureadmin/descriptions/volar"]
}
}