├── .eslintrc.cjs
├── .github
└── workflows
│ └── deploy.yml
├── .gitignore
├── .prettierrc.json
├── .vscode
└── extensions.json
├── README.md
├── docs
├── .vitepress
│ ├── config.ts
│ ├── dist
│ │ ├── 404.html
│ │ ├── assets
│ │ │ ├── app.CDxaPr1w.js
│ │ │ ├── chunks
│ │ │ │ ├── framework.DI4jW7Xc.js
│ │ │ │ └── theme.B3CIiGP4.js
│ │ │ ├── component_Button_defineEmits.md.DB-Eg9B5.js
│ │ │ ├── component_Button_defineEmits.md.DB-Eg9B5.lean.js
│ │ │ ├── component_Button_defineProps.md.CrN5gVxI.js
│ │ │ ├── component_Button_defineProps.md.CrN5gVxI.lean.js
│ │ │ ├── component_Button_index.md.Dwm166d8.js
│ │ │ ├── component_Button_index.md.Dwm166d8.lean.js
│ │ │ ├── component_Dialog_index.md.Is75_HGS.js
│ │ │ ├── component_Dialog_index.md.Is75_HGS.lean.js
│ │ │ ├── component_Icon.md.Dzl2xEgc.js
│ │ │ ├── component_Icon.md.Dzl2xEgc.lean.js
│ │ │ ├── component_Space.md.4O0h3eNH.js
│ │ │ ├── component_Space.md.4O0h3eNH.lean.js
│ │ │ ├── component_Table_index.md.CHTPO8mi.js
│ │ │ ├── component_Table_index.md.CHTPO8mi.lean.js
│ │ │ ├── guide_install.md.DMRGMTm0.js
│ │ │ ├── guide_install.md.DMRGMTm0.lean.js
│ │ │ ├── guide_use.md.DNutHxYg.js
│ │ │ ├── guide_use.md.DNutHxYg.lean.js
│ │ │ ├── index.md.DLpHgSIC.js
│ │ │ ├── index.md.DLpHgSIC.lean.js
│ │ │ ├── inter-italic-cyrillic-ext.r48I6akx.woff2
│ │ │ ├── inter-italic-cyrillic.By2_1cv3.woff2
│ │ │ ├── inter-italic-greek-ext.1u6EdAuj.woff2
│ │ │ ├── inter-italic-greek.DJ8dCoTZ.woff2
│ │ │ ├── inter-italic-latin-ext.CN1xVJS-.woff2
│ │ │ ├── inter-italic-latin.C2AdPX0b.woff2
│ │ │ ├── inter-italic-vietnamese.BSbpV94h.woff2
│ │ │ ├── inter-roman-cyrillic-ext.BBPuwvHQ.woff2
│ │ │ ├── inter-roman-cyrillic.C5lxZ8CY.woff2
│ │ │ ├── inter-roman-greek-ext.CqjqNYQ-.woff2
│ │ │ ├── inter-roman-greek.BBVDIX6e.woff2
│ │ │ ├── inter-roman-latin-ext.4ZJIpNVo.woff2
│ │ │ ├── inter-roman-latin.Di8DUHzh.woff2
│ │ │ ├── inter-roman-vietnamese.BjW4sHH5.woff2
│ │ │ └── style.CpPVVOZk.css
│ │ ├── component
│ │ │ ├── Button
│ │ │ │ ├── defineEmits.html
│ │ │ │ ├── defineProps.html
│ │ │ │ └── index.html
│ │ │ ├── Dialog
│ │ │ │ └── index.html
│ │ │ ├── Icon.html
│ │ │ ├── Space.html
│ │ │ └── Table
│ │ │ │ └── index.html
│ │ ├── guide
│ │ │ ├── install.html
│ │ │ └── use.html
│ │ ├── hashmap.json
│ │ └── index.html
│ └── theme
│ │ ├── Enum.vue
│ │ └── index.ts
├── component
│ ├── Button
│ │ ├── basic.vue
│ │ ├── circle.vue
│ │ ├── clickEffect.vue
│ │ ├── defineEmits.md
│ │ ├── defineProps.md
│ │ ├── disabled.vue
│ │ ├── icon.vue
│ │ ├── index.md
│ │ ├── loading.vue
│ │ ├── plain.vue
│ │ ├── round.vue
│ │ ├── size.vue
│ │ └── text.vue
│ ├── Card
│ │ ├── basic.vue
│ │ └── index.md
│ ├── Checkbox
│ │ ├── basic.vue
│ │ ├── group.vue
│ │ ├── index.md
│ │ └── label.vue
│ ├── ColorPicker
│ │ ├── basic.vue
│ │ └── index.md
│ ├── Dialog
│ │ ├── basic.vue
│ │ └── index.md
│ ├── Dropdown
│ │ ├── basic.vue
│ │ └── index.md
│ ├── Form
│ │ ├── basic.vue
│ │ ├── index.md
│ │ └── validate.vue
│ ├── Icon.md
│ ├── Icon
│ │ ├── basic.vue
│ │ └── index.md
│ ├── Input
│ │ ├── basic.vue
│ │ ├── clearable.vue
│ │ ├── disabled.vue
│ │ ├── icon.vue
│ │ ├── index.md
│ │ ├── password.vue
│ │ └── textarea.vue
│ ├── List
│ │ ├── basic.vue
│ │ └── index.md
│ ├── Menu
│ │ ├── basic.vue
│ │ └── index.md
│ ├── Message
│ │ ├── basic.vue
│ │ ├── index.md
│ │ └── type.vue
│ ├── Popover
│ │ ├── basic.vue
│ │ └── index.md
│ ├── Radio
│ │ ├── basic.vue
│ │ ├── group.vue
│ │ ├── index.md
│ │ └── label.vue
│ ├── Select
│ │ ├── basic.vue
│ │ ├── clearable.vue
│ │ ├── disabled.vue
│ │ ├── filterable.vue
│ │ ├── index.md
│ │ └── multiple.vue
│ ├── Space
│ │ ├── basic.vue
│ │ ├── direction.vue
│ │ └── index.md
│ ├── Switch
│ │ ├── basic.vue
│ │ ├── disabled.vue
│ │ ├── index.md
│ │ └── text.vue
│ ├── Table
│ │ ├── basic.vue
│ │ ├── fixed.vue
│ │ └── index.md
│ ├── Tag
│ │ ├── basic.vue
│ │ ├── close.vue
│ │ └── index.md
│ └── Tooltip
│ │ ├── basic.vue
│ │ └── index.md
├── guide
│ ├── install.md
│ └── use.md
└── index.md
├── env.d.ts
├── generateGlobalTs.ts
├── global.d.ts
├── index.html
├── package.json
├── pnpm-lock.yaml
├── postcss.config.js
├── public
└── favicon.ico
├── release.config.ts
├── src
├── App.vue
├── assets
│ ├── global.css
│ └── icons
│ │ ├── checked.vue
│ │ ├── close.vue
│ │ ├── delete.vue
│ │ ├── drop-down.vue
│ │ ├── drop-up.vue
│ │ ├── edit.vue
│ │ ├── error.vue
│ │ ├── index.ts
│ │ ├── info.vue
│ │ ├── loading.vue
│ │ ├── plus.vue
│ │ ├── search.vue
│ │ ├── success.vue
│ │ └── warning.vue
├── components
│ ├── Button
│ │ ├── _test_
│ │ │ └── button.test.tsx
│ │ └── index.vue
│ ├── Card
│ │ └── index.vue
│ ├── Checkbox
│ │ ├── Checkbox.vue
│ │ ├── Group.vue
│ │ ├── index.ts
│ │ └── symbol.ts
│ ├── Clear.vue
│ ├── ColorPicker
│ │ └── index.vue
│ ├── Dialog
│ │ └── index.vue
│ ├── Dropdown
│ │ └── index.vue
│ ├── Form
│ │ ├── Form.vue
│ │ ├── FormItem.vue
│ │ ├── config.ts
│ │ └── index.ts
│ ├── Input
│ │ └── index.vue
│ ├── List
│ │ ├── Item.vue
│ │ ├── index.ts
│ │ └── index.vue
│ ├── Menu
│ │ └── index.vue
│ ├── Popover
│ │ └── index.vue
│ ├── Radio
│ │ ├── Group.vue
│ │ ├── Radio.vue
│ │ ├── index.ts
│ │ └── symbol.ts
│ ├── Select
│ │ └── index.vue
│ ├── Space
│ │ └── index.vue
│ ├── Switch
│ │ └── index.vue
│ ├── Table
│ │ ├── Td.tsx
│ │ ├── index.ts
│ │ ├── index.vue
│ │ └── type.ts
│ ├── Tag
│ │ └── index.vue
│ ├── Tooltip
│ │ └── index.vue
│ ├── common.ts
│ └── index.ts
├── config.ts
├── directive
│ ├── clickWater.ts
│ └── index.ts
├── globalComponents.d.ts
├── hooks
│ └── useClickWater.ts
├── main.ts
├── release.ts
└── style
│ ├── button.scss
│ ├── buttonVar.scss
│ ├── card.scss
│ ├── checkbox.scss
│ ├── colorPicker.scss
│ ├── dialog.scss
│ ├── form.scss
│ ├── functions.scss
│ ├── global.scss
│ ├── index.scss
│ ├── input.scss
│ ├── list.scss
│ ├── menu.scss
│ ├── message.scss
│ ├── mixins.scss
│ ├── popover.scss
│ ├── radio.scss
│ ├── select.scss
│ ├── space.scss
│ ├── switch.scss
│ ├── table.scss
│ ├── tag.scss
│ ├── tooltip.scss
│ └── var.scss
├── tsconfig.json
└── vite.config.ts
/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | /* eslint-env node */
2 | require('@rushstack/eslint-patch/modern-module-resolution')
3 |
4 | module.exports = {
5 | root: true,
6 | 'extends': [
7 | 'plugin:vue/vue3-essential',
8 | 'eslint:recommended',
9 | '@vue/eslint-config-typescript',
10 | '@vue/eslint-config-prettier/skip-formatting'
11 | ],
12 | parserOptions: {
13 | ecmaVersion: 'latest'
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/.github/workflows/deploy.yml:
--------------------------------------------------------------------------------
1 | # 构建 VitePress 站点并将其部署到 GitHub Pages 的示例工作流程
2 | #
3 | name: Deploy VitePress site to Pages
4 |
5 | on:
6 | # 在针对 `main` 分支的推送上运行。如果你
7 | # 使用 `master` 分支作为默认分支,请将其更改为 `master`
8 | push:
9 | branches: [master]
10 |
11 | # 允许你从 Actions 选项卡手动运行此工作流程
12 | workflow_dispatch:
13 |
14 | # 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages
15 | permissions:
16 | contents: read
17 | pages: write
18 | id-token: write
19 |
20 | # 只允许同时进行一次部署,跳过正在运行和最新队列之间的运行队列
21 | # 但是,不要取消正在进行的运行,因为我们希望允许这些生产部署完成
22 | concurrency:
23 | group: pages
24 | cancel-in-progress: false
25 |
26 | jobs:
27 | # 构建工作
28 | build:
29 | runs-on: ubuntu-latest
30 | steps:
31 | - name: Checkout
32 | uses: actions/checkout@v4
33 | with:
34 | fetch-depth: 0 # 如果未启用 lastUpdated,则不需要
35 | uses: pnpm/action-setup@v3
36 | # - uses: oven-sh/setup-bun@v1 # 如果使用 Bun,请取消注释
37 | - name: Install pnpm
38 | run: |
39 | curl -L https://unpkg.com/@pnpm/self-installer | node
40 | - name: pnpm version
41 | run: pnpm -v
42 | - name: Setup Node
43 | uses: actions/setup-node@v4
44 | with:
45 | node-version: 20
46 | cache: pnpm # 或 pnpm / yarn
47 | - name: Setup Pages
48 | uses: actions/configure-pages@v4
49 | - name: Install dependencies
50 | run: pnpm install # 或 pnpm install / yarn install / bun install
51 | - name: Build with VitePress
52 | run: pnpm build # 或 pnpm docs:build / yarn docs:build / bun run docs:build
53 | - name: Upload artifact
54 | uses: actions/upload-pages-artifact@v3
55 | with:
56 | path: docs/.vitepress/dist
57 |
58 | # 部署工作
59 | deploy:
60 | environment:
61 | name: github-pages
62 | url: ${{ steps.deployment.outputs.page_url }}
63 | needs: build
64 | runs-on: ubuntu-latest
65 | name: Deploy
66 | steps:
67 | - name: Deploy to GitHub Pages
68 | id: deployment
69 | uses: actions/deploy-pages@v4
70 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | .DS_Store
12 | dist
13 | dist-ssr
14 | coverage
15 | *.local
16 | docs/.vitepress/cache
17 | /cypress/videos/
18 | /cypress/screenshots/
19 |
20 | # Editor directories and files
21 | .vscode/*
22 | !.vscode/extensions.json
23 | .idea
24 | *.suo
25 | *.ntvs*
26 | *.njsproj
27 | *.sln
28 | *.sw?
29 |
30 | *.tsbuildinfo
31 |
--------------------------------------------------------------------------------
/.prettierrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/prettierrc",
3 | "semi": false,
4 | "tabWidth": 2,
5 | "singleQuote": true,
6 | "printWidth": 100,
7 | "trailingComma": "none"
8 | }
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "Vue.volar",
4 | "Vue.vscode-typescript-vue-plugin",
5 | "dbaeumer.vscode-eslint",
6 | "esbenp.prettier-vscode"
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Elin UI
2 |
3 | 一个Vue3组件
4 |
5 | [前往在线文档](https://xinnian999.github.io/elin-ui/)
6 |
7 | ## 使用方法
8 |
9 | ```xml
10 | npm install elin-ui
11 | ```
12 |
13 | ```ts
14 | //main.ts
15 |
16 | import { createApp } from 'vue'
17 | import App from './App.vue'
18 | import ElinUI from 'elin-ui'
19 | import 'elin-ui/dist/style.css'
20 |
21 | createApp(App).use(ElinUI).mount('#app')
22 | ```
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/docs/.vitepress/config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vitepress'
2 | import { fileURLToPath, URL } from 'node:url'
3 | import vueJsx from '@vitejs/plugin-vue-jsx'
4 |
5 | export default defineConfig({
6 | title: 'Elin-UI',
7 | description: '一个有趣的vue3组件库',
8 | base: '/elin-ui/',
9 | vite: {
10 | resolve: {
11 | alias: {
12 | '@': fileURLToPath(new URL('../../src/', import.meta.url)),
13 | 'elin-ui': fileURLToPath(new URL('../../src/release', import.meta.url))
14 | }
15 | },
16 | plugins: [vueJsx()],
17 | server: {
18 | port: 9999
19 | }
20 | },
21 | themeConfig: {
22 | // https://vitepress.dev/reference/default-theme-config
23 | nav: [
24 | { text: '首页', link: '/' },
25 | { text: '指南', link: '/guide/install' },
26 | { text: '组件', link: `/component/Button/` }
27 | ],
28 | sidebar: {
29 | '/guide/': [
30 | { text: '安装', link: '/guide/install' },
31 | { text: '使用', link: '/guide/use' }
32 | ],
33 | '/component/': [
34 | {
35 | text: '基础组件',
36 | items: [
37 | { text: 'Button 按钮', link: `/component/Button/` },
38 | { text: 'Icon 图标', link: `/component/Icon/` },
39 | { text: 'Space 间距', link: '/component/Space/' }
40 | ]
41 | },
42 | {
43 | text: '表单组件',
44 | items: [
45 | { text: 'Form 表单', link: '/component/Form/' },
46 | { text: 'Input 输入框', link: '/component/Input/' },
47 | { text: 'Radio 单选框', link: '/component/Radio/' },
48 | { text: 'Checkbox 多选框', link: '/component/Checkbox/' },
49 | { text: 'Select 选择框', link: '/component/Select/' },
50 | { text: 'Switch 开关', link: '/component/Switch/' },
51 | { text: 'ColorPicker 取色器', link: '/component/ColorPicker/' }
52 | ]
53 | },
54 | {
55 | text: '数据展示',
56 | items: [
57 | { text: 'Table 表格', link: '/component/Table/' },
58 | { text: 'List 列表', link: '/component/List/' },
59 | { text: 'Tag 标签', link: '/component/Tag/' },
60 | { text: 'Card 卡片', link: '/component/Card/' }
61 | ]
62 | },
63 | {
64 | text: '反馈组件',
65 | items: [
66 | { text: 'Dialog 对话框', link: '/component/Dialog/' },
67 | { text: 'Message 提示消息', link: '/component/Message/' },
68 | { text: 'Tooltip 文字提示', link: '/component/Tooltip/' },
69 | { text: 'Popover 悬浮气泡', link: '/component/Popover/' }
70 | ]
71 | },
72 | {
73 | text: '导航组件',
74 | items: [
75 | { text: 'Dropdown 下拉菜单', link: '/component/Dropdown/' },
76 | { text: 'Menu 菜单', link: '/component/Menu/' }
77 | ]
78 | }
79 | ]
80 | },
81 | socialLinks: [{ icon: 'github', link: 'https://github.com/xinnian999/elin-ui' }]
82 | }
83 | })
84 |
--------------------------------------------------------------------------------
/docs/.vitepress/dist/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 404 | Elin-UI
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | Skip to content 404
PAGE NOT FOUND
But if you don't change your direction, and if you keep looking, you may end up where you are heading.
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/app.CDxaPr1w.js:
--------------------------------------------------------------------------------
1 | import{Z as s,a6 as p,a7 as u,a8 as l,a9 as c,aa as f,ab as d,ac as m,ad as h,ae as g,af as A,ag as P,d as _,x as v,B as R,I as w,ah as y,ai as C,aj as E,ak as b}from"./chunks/framework.DI4jW7Xc.js";import{R as T}from"./chunks/theme.B3CIiGP4.js";function i(e){if(e.extends){const a=i(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const o=i(T),S=_({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=v();return R(()=>{w(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&y(),C(),E(),o.setup&&o.setup(),()=>b(o.Layout)}});async function D(){globalThis.__VITEPRESS__=!0;const e=x(),a=j();a.provide(u,e);const t=l(e.route);return a.provide(c,t),a.component("Content",f),a.component("ClientOnly",d),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),o.enhanceApp&&await o.enhanceApp({app:a,router:e,siteData:m}),{app:a,router:e,data:t}}function j(){return h(S)}function x(){let e=s,a;return g(t=>{let n=A(t),r=null;return n&&(e&&(a=n),(e||a===n)&&(n=n.replace(/\.js$/,".lean.js")),r=P(()=>import(n),[],import.meta.url)),s&&(e=!1),r},o.NotFound)}s&&D().then(({app:e,router:a,data:t})=>{a.go().then(()=>{p(a.route,t.site),e.mount("#app")})});export{D as createApp};
2 |
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/component_Button_defineEmits.md.DB-Eg9B5.js:
--------------------------------------------------------------------------------
1 | import{_ as e,a as n,o as l,k as t}from"./chunks/framework.DI4jW7Xc.js";const f=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"component/Button/defineEmits.md","filePath":"component/Button/defineEmits.md"}'),o={name:"component/Button/defineEmits.md"},a=t("table",null,[t("thead",null,[t("tr",null,[t("th",null,"属性名"),t("th",null,"说明"),t("th",null,"类型")])]),t("tbody",null,[t("tr",null,[t("td",null,"click"),t("td",null,"按钮点击事件"),t("td",null,[t("code",null,"(event: Event) => void")])])])],-1),s=[a];function d(c,i,r,u,m,_){return l(),n("div",null,s)}const h=e(o,[["render",d]]);export{f as __pageData,h as default};
2 |
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/component_Button_defineEmits.md.DB-Eg9B5.lean.js:
--------------------------------------------------------------------------------
1 | import{_ as e,a as n,o as l,k as t}from"./chunks/framework.DI4jW7Xc.js";const f=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"component/Button/defineEmits.md","filePath":"component/Button/defineEmits.md"}'),o={name:"component/Button/defineEmits.md"},a=t("table",null,[t("thead",null,[t("tr",null,[t("th",null,"属性名"),t("th",null,"说明"),t("th",null,"类型")])]),t("tbody",null,[t("tr",null,[t("td",null,"click"),t("td",null,"按钮点击事件"),t("td",null,[t("code",null,"(event: Event) => void")])])])],-1),s=[a];function d(c,i,r,u,m,_){return l(),n("div",null,s)}const h=e(o,[["render",d]]);export{f as __pageData,h as default};
2 |
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/component_Button_defineProps.md.CrN5gVxI.js:
--------------------------------------------------------------------------------
1 | import{_ as t,a as d,o as e,a5 as o}from"./chunks/framework.DI4jW7Xc.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"component/Button/defineProps.md","filePath":"component/Button/defineProps.md"}'),a={name:"component/Button/defineProps.md"},r=o("属性名 说明 类型 默认值 type 颜色类型 'primary' | 'success' | 'info' | 'warning' | 'danger'
无 siaze 按钮大小 'large' | 'default' | 'small'
'default'
plain 是否为朴素按钮 boolean
false text 是否为文字按钮 boolean
false round 是否为圆角按钮 boolean
false circle 是否为圆形按钮 boolean
false loading 是否加载中状态 boolean
false
",1),n=[r];function c(s,l,_,i,p,f){return e(),d("div",null,n)}const u=t(a,[["render",c]]);export{m as __pageData,u as default};
2 |
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/component_Button_defineProps.md.CrN5gVxI.lean.js:
--------------------------------------------------------------------------------
1 | import{_ as t,a as d,o as e,a5 as o}from"./chunks/framework.DI4jW7Xc.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"component/Button/defineProps.md","filePath":"component/Button/defineProps.md"}'),a={name:"component/Button/defineProps.md"},r=o("",1),n=[r];function c(s,l,_,i,p,f){return e(),d("div",null,n)}const u=t(a,[["render",c]]);export{m as __pageData,u as default};
2 |
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/component_Dialog_index.md.Is75_HGS.js:
--------------------------------------------------------------------------------
1 | import{I as y}from"./chunks/theme.B3CIiGP4.js";import{d as e,p as F,N as p,o as E,a as r,l as t,v as n,F as c,f as l,k as i,u,a5 as m}from"./chunks/framework.DI4jW7Xc.js";const C=e({__name:"basic",setup(d){const a=F(!1);return(g,s)=>{const k=p("e-button"),o=p("e-dialog");return E(),r(c,null,[t(o,{modelValue:a.value,"onUpdate:modelValue":s[2]||(s[2]=h=>a.value=h),title:"你好"},{footer:n(()=>[t(k,{onClick:s[0]||(s[0]=h=>a.value=!1)},{default:n(()=>[l("取消")]),_:1}),t(k,{type:"primary",onClick:s[1]||(s[1]=h=>a.value=!1)},{default:n(()=>[l("提交")]),_:1})]),default:n(()=>[i("p",null,[l("我是一个dialog "),t(u(y))])]),_:1},8,["modelValue"]),t(k,{onClick:s[3]||(s[3]=h=>a.value=!0)},{default:n(()=>[l("打开modal")]),_:1})],64)}}}),D=i("h1",{id:"dialog",tabindex:"-1"},[l("Dialog "),i("a",{class:"header-anchor",href:"#dialog","aria-label":'Permalink to "Dialog"'},"")],-1),_=i("p",null,"对话框操作。",-1),B=i("h2",{id:"基础用法",tabindex:"-1"},[l("基础用法 "),i("a",{class:"header-anchor",href:"#基础用法","aria-label":'Permalink to "基础用法"'},"")],-1),f={class:"vp-raw"},v=m(`查看代码 vue < template >
2 | < e-dialog v-model = " visible " title = "你好" >
3 | < p >我是一个dialog < IconDelete /></ p >
4 | < template # footer >
5 | < e-button @ click = " visible = false " >取消</ e-button >
6 | < e-button type = "primary" @ click = " visible = false " >提交</ e-button >
7 | </ template >
8 | </ e-dialog >
9 | < e-button @ click = " visible = true " >打开modal</ e-button >
10 | </ template >
11 |
12 | < script setup lang = "ts" >
13 | import { IconDelete } from 'elin-ui'
14 | import { ref } from 'vue'
15 |
16 | const visible = ref ( false )
17 | </ script >
`,1),x=JSON.parse('{"title":"Dialog","description":"","frontmatter":{},"headers":[],"relativePath":"component/Dialog/index.md","filePath":"component/Dialog/index.md"}'),A={name:"component/Dialog/index.md"},V=e({...A,setup(d){return(a,g)=>(E(),r("div",null,[D,_,B,i("div",f,[t(C)]),v]))}});export{x as __pageData,V as default};
18 |
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/component_Dialog_index.md.Is75_HGS.lean.js:
--------------------------------------------------------------------------------
1 | import{I as y}from"./chunks/theme.B3CIiGP4.js";import{d as e,p as F,N as p,o as E,a as r,l as t,v as n,F as c,f as l,k as i,u,a5 as m}from"./chunks/framework.DI4jW7Xc.js";const C=e({__name:"basic",setup(d){const a=F(!1);return(g,s)=>{const k=p("e-button"),o=p("e-dialog");return E(),r(c,null,[t(o,{modelValue:a.value,"onUpdate:modelValue":s[2]||(s[2]=h=>a.value=h),title:"你好"},{footer:n(()=>[t(k,{onClick:s[0]||(s[0]=h=>a.value=!1)},{default:n(()=>[l("取消")]),_:1}),t(k,{type:"primary",onClick:s[1]||(s[1]=h=>a.value=!1)},{default:n(()=>[l("提交")]),_:1})]),default:n(()=>[i("p",null,[l("我是一个dialog "),t(u(y))])]),_:1},8,["modelValue"]),t(k,{onClick:s[3]||(s[3]=h=>a.value=!0)},{default:n(()=>[l("打开modal")]),_:1})],64)}}}),D=i("h1",{id:"dialog",tabindex:"-1"},[l("Dialog "),i("a",{class:"header-anchor",href:"#dialog","aria-label":'Permalink to "Dialog"'},"")],-1),_=i("p",null,"对话框操作。",-1),B=i("h2",{id:"基础用法",tabindex:"-1"},[l("基础用法 "),i("a",{class:"header-anchor",href:"#基础用法","aria-label":'Permalink to "基础用法"'},"")],-1),f={class:"vp-raw"},v=m(`查看代码 vue < template >
2 | < e-dialog v-model = " visible " title = "你好" >
3 | < p >我是一个dialog < IconDelete /></ p >
4 | < template # footer >
5 | < e-button @ click = " visible = false " >取消</ e-button >
6 | < e-button type = "primary" @ click = " visible = false " >提交</ e-button >
7 | </ template >
8 | </ e-dialog >
9 | < e-button @ click = " visible = true " >打开modal</ e-button >
10 | </ template >
11 |
12 | < script setup lang = "ts" >
13 | import { IconDelete } from 'elin-ui'
14 | import { ref } from 'vue'
15 |
16 | const visible = ref ( false )
17 | </ script >
`,1),x=JSON.parse('{"title":"Dialog","description":"","frontmatter":{},"headers":[],"relativePath":"component/Dialog/index.md","filePath":"component/Dialog/index.md"}'),A={name:"component/Dialog/index.md"},V=e({...A,setup(d){return(a,g)=>(E(),r("div",null,[D,_,B,i("div",f,[t(C)]),v]))}});export{x as __pageData,V as default};
18 |
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/component_Icon.md.Dzl2xEgc.js:
--------------------------------------------------------------------------------
1 | import{_ as e,a as t,o}from"./chunks/framework.DI4jW7Xc.js";const i=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"component/Icon.md","filePath":"component/Icon.md"}'),n={name:"component/Icon.md"};function a(c,r,s,p,m,_){return o(),t("div")}const f=e(n,[["render",a]]);export{i as __pageData,f as default};
2 |
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/component_Icon.md.Dzl2xEgc.lean.js:
--------------------------------------------------------------------------------
1 | import{_ as e,a as t,o}from"./chunks/framework.DI4jW7Xc.js";const i=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"component/Icon.md","filePath":"component/Icon.md"}'),n={name:"component/Icon.md"};function a(c,r,s,p,m,_){return o(),t("div")}const f=e(n,[["render",a]]);export{i as __pageData,f as default};
2 |
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/component_Space.md.4O0h3eNH.js:
--------------------------------------------------------------------------------
1 | import{_ as e,a as t,o as a}from"./chunks/framework.DI4jW7Xc.js";const i=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"component/Space.md","filePath":"component/Space.md"}'),o={name:"component/Space.md"};function c(n,p,r,s,m,_){return a(),t("div")}const f=e(o,[["render",c]]);export{i as __pageData,f as default};
2 |
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/component_Space.md.4O0h3eNH.lean.js:
--------------------------------------------------------------------------------
1 | import{_ as e,a as t,o as a}from"./chunks/framework.DI4jW7Xc.js";const i=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"component/Space.md","filePath":"component/Space.md"}'),o={name:"component/Space.md"};function c(n,p,r,s,m,_){return a(),t("div")}const f=e(o,[["render",c]]);export{i as __pageData,f as default};
2 |
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/guide_install.md.DMRGMTm0.js:
--------------------------------------------------------------------------------
1 | import{_ as a,a as e,o as t,a5 as s}from"./chunks/framework.DI4jW7Xc.js";const m=JSON.parse('{"title":"安装","description":"","frontmatter":{},"headers":[],"relativePath":"guide/install.md","filePath":"guide/install.md"}'),i={name:"guide/install.md"},l=s('安装 使用包管理器 ',3),n=[l];function o(r,c,d,_,h,p){return t(),e("div",null,n)}const g=a(i,[["render",o]]);export{m as __pageData,g as default};
2 |
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/guide_install.md.DMRGMTm0.lean.js:
--------------------------------------------------------------------------------
1 | import{_ as a,a as e,o as t,a5 as s}from"./chunks/framework.DI4jW7Xc.js";const m=JSON.parse('{"title":"安装","description":"","frontmatter":{},"headers":[],"relativePath":"guide/install.md","filePath":"guide/install.md"}'),i={name:"guide/install.md"},l=s("",3),n=[l];function o(r,c,d,_,h,p){return t(),e("div",null,n)}const g=a(i,[["render",o]]);export{m as __pageData,g as default};
2 |
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/guide_use.md.DNutHxYg.js:
--------------------------------------------------------------------------------
1 | import{_ as s,a as i,o as a,a5 as n}from"./chunks/framework.DI4jW7Xc.js";const g=JSON.parse('{"title":"使用","description":"","frontmatter":{},"headers":[],"relativePath":"guide/use.md","filePath":"guide/use.md"}'),p={name:"guide/use.md"},t=n(`使用 完整引入 如果你对打包后的文件大小不是很在乎,那么使用完整导入会更方便。
ts // main.ts
2 | import { createApp } from 'vue'
3 | import ElinDesign from 'elin-ui'
4 | import 'elin-ui/dist/style.css'
5 | import App from './App.vue'
6 |
7 | const app = createApp (App)
8 |
9 | app. use (ElinDesign)
10 | app. mount ( '#app' )
TypeScript类型支持 组件库完整导入后,请在 tsconfig.json 中通过 compilerOptions.type 指定全局组件类型。
json // tsconfig.json
11 | {
12 | "compilerOptions" : {
13 | // ...
14 | "types" : [ "elin-ui/global" ]
15 | }
16 | }
`,7),e=[t];function l(h,k,r,d,o,E){return a(),i("div",null,e)}const y=s(p,[["render",l]]);export{g as __pageData,y as default};
17 |
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/guide_use.md.DNutHxYg.lean.js:
--------------------------------------------------------------------------------
1 | import{_ as s,a as i,o as a,a5 as n}from"./chunks/framework.DI4jW7Xc.js";const g=JSON.parse('{"title":"使用","description":"","frontmatter":{},"headers":[],"relativePath":"guide/use.md","filePath":"guide/use.md"}'),p={name:"guide/use.md"},t=n("",7),e=[t];function l(h,k,r,d,o,E){return a(),i("div",null,e)}const y=s(p,[["render",l]]);export{g as __pageData,y as default};
2 |
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/index.md.DLpHgSIC.js:
--------------------------------------------------------------------------------
1 | import{_ as e,a as t,o as i}from"./chunks/framework.DI4jW7Xc.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"Elin UI","text":"一个普通的vue组件库","tagline":"为vue3项目提供开箱即用的页面组件","actions":[{"theme":"brand","text":"快速开始","link":"/guide/install"},{"theme":"alt","text":"组件列表","link":"/component/Button"},{"theme":"alt","text":"GitHub","link":"/component/Button"}]},"features":[{"title":"Feature A","details":"Lorem ipsum dolor sit amet, consectetur adipiscing elit"},{"title":"Feature B","details":"Lorem ipsum dolor sit amet, consectetur adipiscing elit"},{"title":"Feature C","details":"Lorem ipsum dolor sit amet, consectetur adipiscing elit"}]},"headers":[],"relativePath":"index.md","filePath":"index.md"}'),a={name:"index.md"};function n(o,s,r,l,c,d){return i(),t("div")}const p=e(a,[["render",n]]);export{u as __pageData,p as default};
2 |
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/index.md.DLpHgSIC.lean.js:
--------------------------------------------------------------------------------
1 | import{_ as e,a as t,o as i}from"./chunks/framework.DI4jW7Xc.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"Elin UI","text":"一个普通的vue组件库","tagline":"为vue3项目提供开箱即用的页面组件","actions":[{"theme":"brand","text":"快速开始","link":"/guide/install"},{"theme":"alt","text":"组件列表","link":"/component/Button"},{"theme":"alt","text":"GitHub","link":"/component/Button"}]},"features":[{"title":"Feature A","details":"Lorem ipsum dolor sit amet, consectetur adipiscing elit"},{"title":"Feature B","details":"Lorem ipsum dolor sit amet, consectetur adipiscing elit"},{"title":"Feature C","details":"Lorem ipsum dolor sit amet, consectetur adipiscing elit"}]},"headers":[],"relativePath":"index.md","filePath":"index.md"}'),a={name:"index.md"};function n(o,s,r,l,c,d){return i(),t("div")}const p=e(a,[["render",n]]);export{u as __pageData,p as default};
2 |
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/inter-italic-cyrillic-ext.r48I6akx.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xinnian999/elin-ui/ed1bb6d9d85e68272f8688fec3930706f0abf2c3/docs/.vitepress/dist/assets/inter-italic-cyrillic-ext.r48I6akx.woff2
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/inter-italic-cyrillic.By2_1cv3.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xinnian999/elin-ui/ed1bb6d9d85e68272f8688fec3930706f0abf2c3/docs/.vitepress/dist/assets/inter-italic-cyrillic.By2_1cv3.woff2
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/inter-italic-greek-ext.1u6EdAuj.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xinnian999/elin-ui/ed1bb6d9d85e68272f8688fec3930706f0abf2c3/docs/.vitepress/dist/assets/inter-italic-greek-ext.1u6EdAuj.woff2
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/inter-italic-greek.DJ8dCoTZ.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xinnian999/elin-ui/ed1bb6d9d85e68272f8688fec3930706f0abf2c3/docs/.vitepress/dist/assets/inter-italic-greek.DJ8dCoTZ.woff2
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/inter-italic-latin-ext.CN1xVJS-.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xinnian999/elin-ui/ed1bb6d9d85e68272f8688fec3930706f0abf2c3/docs/.vitepress/dist/assets/inter-italic-latin-ext.CN1xVJS-.woff2
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/inter-italic-latin.C2AdPX0b.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xinnian999/elin-ui/ed1bb6d9d85e68272f8688fec3930706f0abf2c3/docs/.vitepress/dist/assets/inter-italic-latin.C2AdPX0b.woff2
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/inter-italic-vietnamese.BSbpV94h.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xinnian999/elin-ui/ed1bb6d9d85e68272f8688fec3930706f0abf2c3/docs/.vitepress/dist/assets/inter-italic-vietnamese.BSbpV94h.woff2
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xinnian999/elin-ui/ed1bb6d9d85e68272f8688fec3930706f0abf2c3/docs/.vitepress/dist/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/inter-roman-cyrillic.C5lxZ8CY.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xinnian999/elin-ui/ed1bb6d9d85e68272f8688fec3930706f0abf2c3/docs/.vitepress/dist/assets/inter-roman-cyrillic.C5lxZ8CY.woff2
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/inter-roman-greek-ext.CqjqNYQ-.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xinnian999/elin-ui/ed1bb6d9d85e68272f8688fec3930706f0abf2c3/docs/.vitepress/dist/assets/inter-roman-greek-ext.CqjqNYQ-.woff2
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/inter-roman-greek.BBVDIX6e.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xinnian999/elin-ui/ed1bb6d9d85e68272f8688fec3930706f0abf2c3/docs/.vitepress/dist/assets/inter-roman-greek.BBVDIX6e.woff2
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/inter-roman-latin-ext.4ZJIpNVo.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xinnian999/elin-ui/ed1bb6d9d85e68272f8688fec3930706f0abf2c3/docs/.vitepress/dist/assets/inter-roman-latin-ext.4ZJIpNVo.woff2
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/inter-roman-latin.Di8DUHzh.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xinnian999/elin-ui/ed1bb6d9d85e68272f8688fec3930706f0abf2c3/docs/.vitepress/dist/assets/inter-roman-latin.Di8DUHzh.woff2
--------------------------------------------------------------------------------
/docs/.vitepress/dist/assets/inter-roman-vietnamese.BjW4sHH5.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xinnian999/elin-ui/ed1bb6d9d85e68272f8688fec3930706f0abf2c3/docs/.vitepress/dist/assets/inter-roman-vietnamese.BjW4sHH5.woff2
--------------------------------------------------------------------------------
/docs/.vitepress/dist/guide/install.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 安装 | Elin-UI
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/docs/.vitepress/dist/hashmap.json:
--------------------------------------------------------------------------------
1 | {"index.md":"DLpHgSIC","component_icon.md":"Dzl2xEgc","guide_use.md":"DNutHxYg","component_space.md":"4O0h3eNH","component_button_defineemits.md":"DB-Eg9B5","component_button_defineprops.md":"CrN5gVxI","guide_install.md":"DMRGMTm0","component_dialog_index.md":"Is75_HGS","component_button_index.md":"Dwm166d8","component_table_index.md":"CHTPO8mi"}
2 |
--------------------------------------------------------------------------------
/docs/.vitepress/dist/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Elin-UI
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | Skip to content Elin UI 一个普通的vue组件库
为vue3项目提供开箱即用的页面组件
Feature A Lorem ipsum dolor sit amet, consectetur adipiscing elit
Feature B Lorem ipsum dolor sit amet, consectetur adipiscing elit
Feature C Lorem ipsum dolor sit amet, consectetur adipiscing elit
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/docs/.vitepress/theme/Enum.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | enum
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/docs/.vitepress/theme/index.ts:
--------------------------------------------------------------------------------
1 | import type { Theme } from 'vitepress'
2 | import DefaultTheme from 'vitepress/theme'
3 | // @ts-ignore
4 | import ElinUI from 'elin-ui'
5 | // @ts-ignore
6 | import Enum from './Enum.vue'
7 |
8 | export default {
9 | extends: DefaultTheme,
10 | enhanceApp({ app }) {
11 | // 注册自定义全局组件
12 | app.use(ElinUI)
13 | app.component('EEnum', Enum)
14 | }
15 | } satisfies Theme
16 |
--------------------------------------------------------------------------------
/docs/component/Button/basic.vue:
--------------------------------------------------------------------------------
1 |
2 | Default
3 | Primary
4 | Success
5 | Info
6 | Warning
7 | danger
8 |
9 |
--------------------------------------------------------------------------------
/docs/component/Button/circle.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
15 |
--------------------------------------------------------------------------------
/docs/component/Button/clickEffect.vue:
--------------------------------------------------------------------------------
1 |
2 | 水波纹
3 | 弹性
4 |
5 |
--------------------------------------------------------------------------------
/docs/component/Button/defineEmits.md:
--------------------------------------------------------------------------------
1 |
2 | | 属性名 | 说明 | 类型 |
3 | |-------|--------|--------------------------------------------------------------|
4 | | click | 按钮点击事件 | `(event: Event) => void` |
5 |
6 |
--------------------------------------------------------------------------------
/docs/component/Button/defineProps.md:
--------------------------------------------------------------------------------
1 |
6 |
7 | | 属性名 | 说明 | 类型 | 默认值 |
8 | | ----------- |---------| -------------------------------- | ----------- |
9 | | type | 颜色类型 | {{type}} | 无 |
10 | | size | 按钮大小 | {{size}} | `'default'` |
11 | | plain | 是否为次要按钮 | `boolean` | false |
12 | | text | 是否为文字按钮 | `boolean` | false |
13 | | round | 是否为圆角按钮 | `boolean` | false |
14 | | circle | 是否为圆形按钮 | `boolean` | false |
15 | | loading | 是否加载中状态 | `boolean` | false |
16 | | clickEffect | 点击动画 | {{clickEffect}} | `'water'` |
17 |
--------------------------------------------------------------------------------
/docs/component/Button/disabled.vue:
--------------------------------------------------------------------------------
1 |
2 | Default
3 | Primary
4 | Success
5 | Info
6 | Warning
7 | danger
8 |
9 |
--------------------------------------------------------------------------------
/docs/component/Button/icon.vue:
--------------------------------------------------------------------------------
1 |
2 | 新建
3 | 编辑
4 | 删除
5 |
6 |
7 | 新建
8 | 编辑
9 | 删除
10 |
11 |
12 |
15 |
--------------------------------------------------------------------------------
/docs/component/Button/index.md:
--------------------------------------------------------------------------------
1 |
14 |
15 | # Button
16 |
17 | 常用的操作按钮。
18 |
19 | ## 主要按钮
20 |
21 |
22 |
23 | ::: details 查看代码
24 |
25 | <<< ./basic.vue
26 |
27 | :::
28 |
29 | ## 次要按钮
30 |
31 |
32 |
33 | ::: details 查看代码
34 |
35 | <<< ./plain.vue
36 |
37 | :::
38 |
39 |
40 | ## 文字按钮
41 |
42 |
43 |
44 | ::: details 查看代码
45 |
46 | <<< ./text.vue
47 |
48 | :::
49 |
50 | ## 圆角按钮
51 |
52 |
53 |
54 | ::: details 查看代码
55 |
56 | <<< ./round.vue
57 |
58 | :::
59 |
60 |
61 | ## 圆形按钮
62 |
63 |
64 |
65 | ::: details 查看代码
66 |
67 | <<< ./circle.vue
68 |
69 | :::
70 |
71 | ## 图标按钮
72 |
73 | 直接将图标插入到文字的前面或者后面即可
74 |
75 |
76 |
77 | ::: details 查看代码
78 |
79 | <<< ./icon.vue
80 |
81 | :::
82 |
83 | ## 不同大小
84 |
85 |
86 |
87 | ::: details 查看代码
88 |
89 | <<< ./size.vue
90 |
91 | :::
92 |
93 | ## 不同点击效果
94 |
95 |
96 |
97 | ::: details 查看代码
98 |
99 | <<< ./clickEffect.vue
100 |
101 | :::
102 |
103 | ## 禁用状态
104 |
105 |
106 |
107 | ::: details 查看代码
108 |
109 | <<< ./disabled.vue
110 |
111 | :::
112 |
113 | ## 加载状态
114 |
115 |
116 |
117 | ::: details 查看代码
118 |
119 | <<< ./loading.vue
120 |
121 | :::
122 |
123 | ## API
124 |
125 | ### defineProps
126 |
127 |
128 |
129 | ### defineEmits
130 |
131 |
--------------------------------------------------------------------------------
/docs/component/Button/loading.vue:
--------------------------------------------------------------------------------
1 |
2 | Loading
3 |
4 |
--------------------------------------------------------------------------------
/docs/component/Button/plain.vue:
--------------------------------------------------------------------------------
1 |
2 | Default
3 | Primary
4 | Success
5 | Info
6 | Warning
7 | danger
8 |
9 |
--------------------------------------------------------------------------------
/docs/component/Button/round.vue:
--------------------------------------------------------------------------------
1 |
2 | Default
3 | Primary
4 | Success
5 | Info
6 | Warning
7 | danger
8 |
9 |
--------------------------------------------------------------------------------
/docs/component/Button/size.vue:
--------------------------------------------------------------------------------
1 |
2 | Large
3 | Default
4 | Small
5 |
6 |
--------------------------------------------------------------------------------
/docs/component/Button/text.vue:
--------------------------------------------------------------------------------
1 |
2 | Default
3 | Primary
4 | Success
5 | Info
6 | Warning
7 | danger
8 |
9 |
--------------------------------------------------------------------------------
/docs/component/Card/basic.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Item 1
5 | Item 2
6 | Item 3
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/docs/component/Card/index.md:
--------------------------------------------------------------------------------
1 |
5 |
6 | # Card 卡片
7 |
8 |
9 | ## 基础用法
10 |
11 |
12 |
13 |
14 |
15 | ::: details 查看代码
16 |
17 | <<< ./basic.vue
18 |
19 | :::
20 |
--------------------------------------------------------------------------------
/docs/component/Checkbox/basic.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
--------------------------------------------------------------------------------
/docs/component/Checkbox/group.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
16 |
--------------------------------------------------------------------------------
/docs/component/Checkbox/index.md:
--------------------------------------------------------------------------------
1 |
7 |
8 | # Checkbox 多选框
9 |
10 | 在一组备选项中进行多选。
11 |
12 | ## 基础用法
13 |
14 | 默认在布尔值之间切换
15 |
16 |
17 |
18 |
19 | ::: details 查看代码
20 |
21 | <<< ./basic.vue
22 |
23 | :::
24 |
25 | ## 指定【标签】和【选中状态的值】
26 |
27 | value参数,初始值必须是数组时才会生效
28 |
29 |
30 |
31 |
32 | ::: details 查看代码
33 |
34 | <<< ./label.vue
35 |
36 | :::
37 |
38 | ## 多选框组
39 |
40 |
41 |
42 |
43 |
44 |
45 | ::: details 查看代码
46 |
47 | <<< ./group.vue
48 |
49 | :::
50 |
--------------------------------------------------------------------------------
/docs/component/Checkbox/label.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
--------------------------------------------------------------------------------
/docs/component/ColorPicker/basic.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
14 |
--------------------------------------------------------------------------------
/docs/component/ColorPicker/index.md:
--------------------------------------------------------------------------------
1 |
5 |
6 | # ColorPicker 取色器
7 |
8 |
9 | ## 基础用法
10 |
11 |
12 |
13 |
14 |
15 | ::: details 查看代码
16 |
17 | <<< ./basic.vue
18 |
19 | :::
20 |
--------------------------------------------------------------------------------
/docs/component/Dialog/basic.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | 我是一个dialog
4 |
5 | 取消
6 | 提交
7 |
8 |
9 | 打开modal
10 |
11 |
12 |
18 |
--------------------------------------------------------------------------------
/docs/component/Dialog/index.md:
--------------------------------------------------------------------------------
1 |
5 |
6 | # Dialog
7 |
8 | 对话框操作。
9 |
10 | ## 基础用法
11 |
12 | ::: raw
13 |
14 |
15 |
16 | :::
17 |
18 | ::: details 查看代码
19 |
20 | <<< ./basic.vue
21 |
22 | :::
23 |
--------------------------------------------------------------------------------
/docs/component/Dropdown/basic.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | 打开下拉
4 |
5 |
6 |
7 |
14 |
--------------------------------------------------------------------------------
/docs/component/Dropdown/index.md:
--------------------------------------------------------------------------------
1 |
5 |
6 | # Dropdown 下拉菜单
7 |
8 | ## 基础用法
9 |
10 |
11 |
12 | ::: details 查看代码
13 |
14 | <<< ./basic.vue
15 |
16 | :::
17 |
--------------------------------------------------------------------------------
/docs/component/Form/basic.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | 提交
12 |
13 |
14 |
15 |
16 |
17 |
35 |
--------------------------------------------------------------------------------
/docs/component/Form/index.md:
--------------------------------------------------------------------------------
1 |
6 |
7 | # Form 表单
8 |
9 | ## 基础用法
10 |
11 |
12 |
13 | ::: details 查看代码
14 |
15 | <<< ./basic.vue
16 |
17 | :::
18 |
19 | ## 表单校验
20 |
21 |
22 |
23 | ::: details 查看代码
24 |
25 | <<< ./validate.vue
26 |
27 | :::
28 |
29 | ## Form API
30 |
31 | ### defineProps
32 |
33 | | 属性名 | 说明 | 类型 | 默认值 |
34 | | -------- |--------| ----------- | ------ |
35 | | data | 表单值 | `object` | -- |
36 | | disabled | 禁用整个表单 | `boolean` | false |
37 | | rules | 校验规则 | `FormRules` | -- |
38 |
39 | ### defineExpose
40 |
41 | | 属性名 | 说明 | 类型 | 默认值 |
42 | | ------------- | ------------ |-------------------| ------ |
43 | | validate | 校验表单 | `()=>Promise` | -- |
44 | | validateField | 校验某个字段 | `(name)=>Promise` | -- |
45 |
46 | ## FormItem API
47 |
48 | ### Props
49 |
50 | | 属性名 | 说明 | 类型 | 默认值 |
51 | |-------|--------|------------|-----|
52 | | label | 字段标签 | `string` | -- |
53 | | name | 字段表示 | `string` | -- |
54 | | rules | 字段校验规则 | `FormRule` | -- |
55 |
56 |
57 | ### Expose
58 |
59 | | 属性名 | 说明 | 类型 |
60 | |-------|--------|-------------------------|
61 | | validate | 校验整个表单 | `()=>Promise` |
62 | | validateField | 校验某个字段 | `(name)=>Promise` |
--------------------------------------------------------------------------------
/docs/component/Form/validate.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
15 |
16 |
17 |
28 |
29 |
30 |
31 | 提交
32 |
33 |
34 |
35 |
36 |
37 |
56 |
--------------------------------------------------------------------------------
/docs/component/Icon.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xinnian999/elin-ui/ed1bb6d9d85e68272f8688fec3930706f0abf2c3/docs/component/Icon.md
--------------------------------------------------------------------------------
/docs/component/Icon/basic.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {{ name.slice(4) }}
6 |
7 |
8 |
9 |
10 |
20 |
21 |
54 |
--------------------------------------------------------------------------------
/docs/component/Icon/index.md:
--------------------------------------------------------------------------------
1 |
5 |
6 | # Icon 图标
7 |
8 | **Elin-UI** 为您提供了一套常用的图标。
9 |
10 | ## 使用方法
11 |
12 | 每个图标都是一个vue组件,可直接导入使用,统一以【Iconxxx】命名。
13 |
14 | ```vue
15 |
16 |
17 |
18 |
19 |
22 | ```
23 |
24 |
25 |
26 | ## 可用图标列表
27 |
28 | 您可通过点击复制图标代码
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/docs/component/Input/basic.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
14 |
--------------------------------------------------------------------------------
/docs/component/Input/clearable.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
--------------------------------------------------------------------------------
/docs/component/Input/disabled.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
--------------------------------------------------------------------------------
/docs/component/Input/icon.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
17 |
--------------------------------------------------------------------------------
/docs/component/Input/index.md:
--------------------------------------------------------------------------------
1 |
11 |
12 | # Input 输入框
13 |
14 | 通过键盘输入字符,录入信息
15 |
16 | ## 基础用法
17 |
18 |
19 |
20 | ::: details 查看代码
21 |
22 | <<< ./basic.vue
23 |
24 | :::
25 |
26 | ## 一键清除
27 |
28 |
29 |
30 | ::: details 查看代码
31 |
32 | <<< ./clearable.vue
33 |
34 | :::
35 |
36 | ## 禁用
37 |
38 |
39 |
40 | ::: details 查看代码
41 |
42 | <<< ./disabled.vue
43 |
44 | :::
45 |
46 | ## 密码输入框
47 |
48 |
49 |
50 | ::: details 查看代码
51 |
52 | <<< ./password.vue
53 |
54 | :::
55 |
56 | ## 文本域
57 |
58 |
59 |
60 | ::: details 查看代码
61 |
62 | <<< ./textarea.vue
63 |
64 | :::
65 |
66 | ## 前缀or后缀图标
67 |
68 |
69 |
70 | ::: details 查看代码
71 |
72 | <<< ./icon.vue
73 |
74 | :::
75 |
76 | ## Input API
77 |
78 | ### Props
79 |
80 | | 属性名 | 说明 | 类型 | 默认值 |
81 | |-------------|---------------|---------------------------|---------|
82 | | v-model | 值 | `string` | -- |
83 | | type | 输入框类型 | {{type}} | false |
84 | | placeholder | 占位文本 | `string` | `'请输入'` |
85 | | disabled | 禁用 | `boolean` | false |
86 | | readonly | 只读 | `boolean` | false |
87 | | clearable | 一键清除,文本域模式下无效 | `boolean` | false |
88 | | prefixIcon | 前缀图标 | `VNode` | -- |
89 | | suffixIcon | 后缀图标 | `VNode` | -- |
90 |
--------------------------------------------------------------------------------
/docs/component/Input/password.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
--------------------------------------------------------------------------------
/docs/component/Input/textarea.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
--------------------------------------------------------------------------------
/docs/component/List/basic.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | Item 1
4 | Item 2
5 | Item 3
6 |
7 |
8 |
--------------------------------------------------------------------------------
/docs/component/List/index.md:
--------------------------------------------------------------------------------
1 |
5 |
6 | # List 列表
7 |
8 |
9 |
10 | ## 基础用法
11 |
12 |
13 |
14 |
15 |
16 | ::: details 查看代码
17 |
18 | <<< ./basic.vue
19 |
20 | :::
21 |
--------------------------------------------------------------------------------
/docs/component/Menu/basic.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
22 |
--------------------------------------------------------------------------------
/docs/component/Menu/index.md:
--------------------------------------------------------------------------------
1 |
5 |
6 | # Menu 菜单
7 |
8 |
9 |
10 | ## 基础用法
11 |
12 |
13 |
14 |
15 |
16 | ::: details 查看代码
17 |
18 | <<< ./basic.vue
19 |
20 | :::
21 |
--------------------------------------------------------------------------------
/docs/component/Message/basic.vue:
--------------------------------------------------------------------------------
1 |
2 | 打开Message
3 |
4 |
5 |
12 |
--------------------------------------------------------------------------------
/docs/component/Message/index.md:
--------------------------------------------------------------------------------
1 |
6 |
7 | # Message 提示消息
8 |
9 | ## 基础用法
10 |
11 |
12 |
13 | ::: details 查看代码
14 |
15 | <<< ./basic.vue
16 |
17 | :::
18 |
19 |
20 | ## 不同状态
21 |
22 |
23 |
24 | ::: details 查看代码
25 |
26 | <<< ./type.vue
27 |
28 | :::
29 |
--------------------------------------------------------------------------------
/docs/component/Message/type.vue:
--------------------------------------------------------------------------------
1 |
2 | Success
3 | Warning
4 | Info
5 | Error
6 |
7 |
8 |
11 |
--------------------------------------------------------------------------------
/docs/component/Popover/basic.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | 打开浮层
4 |
5 |
6 |
--------------------------------------------------------------------------------
/docs/component/Popover/index.md:
--------------------------------------------------------------------------------
1 |
5 |
6 | # Popover 悬浮气泡
7 |
8 | ## 基础用法
9 |
10 |
11 |
12 | ::: details 查看代码
13 |
14 | <<< ./basic.vue
15 |
16 | :::
17 |
--------------------------------------------------------------------------------
/docs/component/Radio/basic.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
14 |
--------------------------------------------------------------------------------
/docs/component/Radio/group.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
20 |
--------------------------------------------------------------------------------
/docs/component/Radio/index.md:
--------------------------------------------------------------------------------
1 |
7 |
8 | # Radio 单选框
9 |
10 | 在一组备选项中进行单选。
11 |
12 | ## 基础用法
13 |
14 | 默认在布尔值之间切换
15 |
16 |
17 |
18 |
19 | ::: details 查看代码
20 |
21 | <<< ./basic.vue
22 |
23 | :::
24 |
25 | ## 指定【标签】和【选中状态的值】
26 |
27 |
28 |
29 |
30 | ::: details 查看代码
31 |
32 | <<< ./label.vue
33 |
34 | :::
35 |
36 | ## 单选框组
37 |
38 |
39 |
40 |
41 |
42 |
43 | ::: details 查看代码
44 |
45 | <<< ./group.vue
46 |
47 | :::
48 |
--------------------------------------------------------------------------------
/docs/component/Radio/label.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
14 |
--------------------------------------------------------------------------------
/docs/component/Select/basic.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
16 |
--------------------------------------------------------------------------------
/docs/component/Select/clearable.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
--------------------------------------------------------------------------------
/docs/component/Select/disabled.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
16 |
--------------------------------------------------------------------------------
/docs/component/Select/filterable.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
--------------------------------------------------------------------------------
/docs/component/Select/index.md:
--------------------------------------------------------------------------------
1 |
9 |
10 | # Select 选择框
11 |
12 | ## 基础用法
13 |
14 |
15 |
16 | ::: details 查看代码
17 |
18 | <<< ./basic.vue
19 |
20 | :::
21 |
22 | ## 多选
23 |
24 |
25 |
26 | ::: details 查看代码
27 |
28 | <<< ./multiple.vue
29 |
30 | :::
31 |
32 | ## 一键清除
33 |
34 |
35 |
36 | ::: details 查看代码
37 |
38 | <<< ./clearable.vue
39 |
40 | :::
41 |
42 | ## 禁用
43 |
44 |
45 |
46 | ::: details 查看代码
47 |
48 | <<< ./disabled.vue
49 |
50 | :::
51 |
52 | ## 筛选
53 |
54 |
55 |
56 | ::: details 查看代码
57 |
58 | <<< ./filterable.vue
59 |
60 | :::
61 |
62 | ## Select API
63 |
64 | ### defineProps
65 |
66 | | 属性名 | 说明 | 类型 | 默认值 |
67 | |-------------|------|----------------------|-----------|
68 | | v-model | 值 | `string \| string[]` | -- |
69 | | placeholder | 占位文本 | `string` | `'请选择'` |
70 | | disabled | 禁用 | `boolean` | false |
71 | | clearable | 一键清除 | `boolean` | false |
72 | | options | 选项配置 | `option[]` | [] |
73 | | labelKey | 标签key | `string` | `'label'` |
74 | | valueKey | 值key | `string` | `'value'` |
75 | | filterable | 支持筛选 | `boolean` | false |
76 |
--------------------------------------------------------------------------------
/docs/component/Select/multiple.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
16 |
--------------------------------------------------------------------------------
/docs/component/Space/basic.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Item 1
6 | Item 2
7 | Item 3
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/docs/component/Space/direction.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Item 1
6 | Item 2
7 | Item 3
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/docs/component/Space/index.md:
--------------------------------------------------------------------------------
1 |
6 |
7 | # Space 间距
8 |
9 | ## 基础用法
10 |
11 |
12 |
13 | ::: details 查看代码
14 |
15 | <<< ./basic.vue
16 |
17 | :::
18 |
19 | ## 垂直排列
20 |
21 |
22 |
23 | ::: details 查看代码
24 |
25 | <<< ./direction.vue
26 |
27 | :::
28 |
29 | ## API
30 |
31 | ### defineProps
32 |
33 | | 属性名 | 说明 | 类型 | 默认值 |
34 | |-----------|------|------------------------------|----------------|
35 | | direction | 排列方向 | `'horizontal' \| 'vertical'` | `'horizontal'` |
36 | | wrap | 自动换行 | `boolean` | false |
37 | | gap | 间距大小 | `number` | 20 |
38 |
--------------------------------------------------------------------------------
/docs/component/Switch/basic.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
14 |
--------------------------------------------------------------------------------
/docs/component/Switch/disabled.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
14 |
--------------------------------------------------------------------------------
/docs/component/Switch/index.md:
--------------------------------------------------------------------------------
1 |
7 |
8 | # Switch 开关
9 |
10 | ## 基础用法
11 |
12 |
13 |
14 | ::: details 查看代码
15 |
16 | <<< ./basic.vue
17 |
18 | :::
19 |
20 | ## 文字描述
21 |
22 |
23 |
24 | ::: details 查看代码
25 |
26 | <<< ./text.vue
27 |
28 | :::
29 |
30 | ## 禁用
31 |
32 |
33 |
34 | ::: details 查看代码
35 |
36 | <<< ./disabled.vue
37 |
38 | :::
39 |
40 | ## Input API
41 |
42 | ### Props
43 |
44 | | 属性名 | 说明 | 类型 | 默认值 |
45 | | ----------- | ---------------- | ----------------------------- | ---------- |
46 | | v-model | 值 | `boolean \| string \| number` | -- |
47 | | onText | 开启时文字描述 | `string` | -- |
48 | | offText | 关闭时文字描述 | `string` | -- |
49 | | inlineText | 文字描述是否内嵌 | `boolean` | false |
50 | | onValue | 开启时的值 | `boolean \| string \| number` | true |
51 | | offValue | 关闭时的值 | `boolean \| string \| number` | false |
52 | | disabled | 禁用 | `boolean` | false |
53 |
--------------------------------------------------------------------------------
/docs/component/Switch/text.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
17 |
--------------------------------------------------------------------------------
/docs/component/Table/basic.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
43 |
--------------------------------------------------------------------------------
/docs/component/Table/fixed.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
76 |
--------------------------------------------------------------------------------
/docs/component/Table/index.md:
--------------------------------------------------------------------------------
1 |
6 |
7 | # Table
8 |
9 | 用于展示多条结构类似的数据, 可对数据进行排序、筛选、对比或其他自定义操作。
10 |
11 | ## 基础用法
12 |
13 | ::: raw
14 |
15 |
16 |
17 | :::
18 |
19 | ::: details 查看代码
20 |
21 | <<< ./basic.vue
22 |
23 | :::
24 |
25 | ## 固定列
26 |
27 | ::: raw
28 |
29 |
30 |
31 | :::
32 |
33 | ::: details 查看代码
34 |
35 | <<< ./fixed.vue
36 |
37 | :::
38 |
--------------------------------------------------------------------------------
/docs/component/Tag/basic.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | 标签
4 | 标签
5 | 标签
6 | 标签
7 | 标签
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/docs/component/Tag/close.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | 标签
4 |
5 |
6 |
7 |
17 |
--------------------------------------------------------------------------------
/docs/component/Tag/index.md:
--------------------------------------------------------------------------------
1 |
6 |
7 | # Tag 标签
8 |
9 | ## 基础用法
10 |
11 |
12 |
13 | ::: details 查看代码
14 |
15 | <<< ./basic.vue
16 |
17 | :::
18 |
19 | ## 可关闭
20 |
21 |
22 |
23 | ::: details 查看代码
24 |
25 | <<< ./close.vue
26 |
27 | :::
28 |
--------------------------------------------------------------------------------
/docs/component/Tooltip/basic.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | Tooltip
4 |
5 |
6 |
--------------------------------------------------------------------------------
/docs/component/Tooltip/index.md:
--------------------------------------------------------------------------------
1 |
6 |
7 | # Tooltip 文字提示
8 |
9 | ## 基础用法
10 |
11 |
12 |
13 | ::: details 查看代码
14 |
15 | <<< ./basic.vue
16 |
17 | :::
18 |
19 | ## Tooltip API
20 |
21 | ### Props
22 |
23 | | 属性名 | 说明 | 类型 | 默认值 |
24 | | --------- | -------------------------- | ------------------------------ | ---------- |
25 | | v-model | 显示状态,用于主动控制显隐 | `boolean` | false |
26 | | placement | 出现位置 | {{placement}} | `'请选择'` |
27 | | content | 提示内容 | `string` | -- |
28 | | disabled | 禁用 | `boolean` | false |
29 | | trigger | 触发方式 | `'hover' \| 'click'` | `'hover'` |
30 |
--------------------------------------------------------------------------------
/docs/guide/install.md:
--------------------------------------------------------------------------------
1 | # 安装
2 |
3 | ## 使用包管理器
4 |
5 | ```xml
6 | npm install elin-ui
7 | ```
8 |
--------------------------------------------------------------------------------
/docs/guide/use.md:
--------------------------------------------------------------------------------
1 | # 使用
2 |
3 | ## 完整引入
4 |
5 | 如果你对打包后的文件大小不是很在乎,那么使用完整导入会更方便。
6 |
7 | ```ts
8 | // main.ts
9 | import { createApp } from 'vue'
10 | import ElinDesign from 'elin-ui'
11 | import 'elin-ui/dist/style.css'
12 | import App from './App.vue'
13 |
14 | const app = createApp(App)
15 |
16 | app.use(ElinDesign)
17 | app.mount('#app')
18 | ```
19 |
20 | ## TypeScript类型支持
21 |
22 | 组件库完整导入后,请在 tsconfig.json 中通过 compilerOptions.type 指定全局组件类型。
23 |
24 | ```json
25 | // tsconfig.json
26 | {
27 | "compilerOptions": {
28 | // ...
29 | "types": ["elin-ui/global"]
30 | }
31 | }
32 | ```
33 |
--------------------------------------------------------------------------------
/docs/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | # https://vitepress.dev/reference/default-theme-home-page
3 | layout: home
4 |
5 | hero:
6 | name: 'Elin UI'
7 | text: '一个普通的vue组件库'
8 | tagline: 为vue3项目提供开箱即用的页面组件
9 | actions:
10 | - theme: brand
11 | text: 快速开始
12 | link: /guide/install
13 | - theme: alt
14 | text: 组件列表
15 | link: /component/Button
16 | - theme: alt
17 | text: GitHub
18 | link: /component/Button
19 |
20 | features:
21 | - title: Feature A
22 | details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
23 | - title: Feature B
24 | details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
25 | - title: Feature C
26 | details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
27 | ---
28 |
--------------------------------------------------------------------------------
/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | declare module '*.vue' {
4 | import { DefineComponent } from "vue"
5 | const component: DefineComponent<{}, {}, any>
6 | export default component
7 | }
--------------------------------------------------------------------------------
/generateGlobalTs.ts:
--------------------------------------------------------------------------------
1 | // vite-plugin-copy-global-components.js
2 | import fs from 'fs'
3 | import path from 'path'
4 |
5 | export default function vitePluginCopyGlobalComponents() {
6 | return {
7 | name: 'copy-global-components',
8 | apply: 'build',
9 | writeBundle() {
10 | const sourceFile = 'src/globalComponents.d.ts'
11 | const targetDir = './' // 或者你想要的目标目录
12 |
13 | const sourcePath = path.resolve(sourceFile)
14 | const targetPath = path.resolve(targetDir, 'global.d.ts')
15 |
16 | // 检查源文件是否存在
17 | if (!fs.existsSync(sourcePath)) {
18 | console.error(`Source file ${sourceFile} does not exist.`)
19 | return
20 | }
21 |
22 | // 尝试读取源文件内容并替换
23 | try {
24 | let content = fs.readFileSync(sourcePath, 'utf-8')
25 | content = content.replace(/@\/components/g, 'elin-ui')
26 | content = content.replace("'vue'", "'@vue/runtime-core'")
27 |
28 | // 将替换后的内容写入目标文件
29 | fs.writeFileSync(targetPath, content)
30 |
31 | console.log(`Copied and modified ${sourceFile} to ${targetPath}`)
32 | } catch (err) {
33 | console.error(`Error copying and modifying ${sourceFile} to ${targetPath}:`, err)
34 | }
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/global.d.ts:
--------------------------------------------------------------------------------
1 | declare module '@vue/runtime-core' {
2 | export interface GlobalComponents {
3 | EButton: (typeof import('elin-ui'))['EButton']
4 | ESpace: (typeof import('elin-ui'))['ESpace']
5 | EDialog: (typeof import('elin-ui'))['EDialog']
6 | ETable: (typeof import('elin-ui'))['ETable']
7 | ESelect: (typeof import('elin-ui'))['ESelect']
8 | EInput: (typeof import('elin-ui'))['EInput']
9 | EColorPicker: (typeof import('elin-ui'))['EColorPicker']
10 | ECheckbox: (typeof import('elin-ui'))['ECheckbox']
11 | ECheckboxGroup: (typeof import('elin-ui'))['ECheckboxGroup']
12 | ERadio: (typeof import('elin-ui'))['ERadio']
13 | ERadioGroup: (typeof import('elin-ui'))['ERadioGroup']
14 | ETooltip: (typeof import('elin-ui'))['ETooltip']
15 | EPopover: (typeof import('elin-ui'))['EPopover']
16 | EMenu: (typeof import('elin-ui'))['EMenu']
17 | EList: (typeof import('elin-ui'))['EList']
18 | EListItem: (typeof import('elin-ui'))['EListItem']
19 | EForm: (typeof import('elin-ui'))['EForm']
20 | EFormItem: (typeof import('elin-ui'))['EFormItem']
21 | EDropdown: (typeof import('elin-ui'))['EDropdown']
22 | ETag: (typeof import('elin-ui'))['ETag']
23 | ECard: (typeof import('elin-ui'))['ECard']
24 | ESwitch: (typeof import('elin-ui'))['ESwitch']
25 | }
26 | }
27 |
28 | export {}
29 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Funny UI
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "elin-ui",
3 | "version": "1.0.0",
4 | "private": false,
5 | "type": "module",
6 | "main": "./dist/elin-ui.js",
7 | "module": "./dist/elin-ui.js",
8 | "types": "./dist/elin-ui.d.ts",
9 | "files": [
10 | "dist",
11 | "global.d.ts"
12 | ],
13 | "scripts": {
14 | "dev": "vitepress dev docs",
15 | "build": "vitepress build docs",
16 | "preview": "vitepress preview docs",
17 | "type-check": "vue-tsc --build --force",
18 | "release": "vite build --config release.config.ts",
19 | "test": "vitest",
20 | "dev-web": "vite"
21 | },
22 | "dependencies": {
23 | "@floating-ui/vue": "^1.0.6",
24 | "@types/lodash": "^4.17.4",
25 | "@vue/test-utils": "^2.4.5",
26 | "animate.css": "^4.1.1",
27 | "async-validator": "^4.2.5",
28 | "lodash": "^4.17.21",
29 | "postcss": "^8.4.38",
30 | "vite-plugin-dts": "^3.8.1",
31 | "vue": "^3.4.15",
32 | "vue3-toastify": "^0.2.1"
33 | },
34 | "devDependencies": {
35 | "@rushstack/eslint-patch": "^1.3.3",
36 | "@testing-library/vue": "^8.0.3",
37 | "@tsconfig/node20": "^20.1.2",
38 | "@types/node": "^20.11.10",
39 | "@vitejs/plugin-vue": "^5.0.3",
40 | "@vitejs/plugin-vue-jsx": "^3.1.0",
41 | "@vue/eslint-config-prettier": "^8.0.0",
42 | "@vue/eslint-config-typescript": "^12.0.0",
43 | "@vue/tsconfig": "^0.5.1",
44 | "eslint": "^8.49.0",
45 | "eslint-plugin-vue": "^9.17.0",
46 | "happy-dom": "^14.7.1",
47 | "npm-run-all2": "^6.1.1",
48 | "prettier": "^3.0.3",
49 | "sass": "^1.74.1",
50 | "typescript": "~5.3.0",
51 | "vite": "^5.0.11",
52 | "vitepress": "^1.0.1",
53 | "vitest": "^1.5.2",
54 | "vue-tsc": "^1.8.27"
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | import { postcssIsolateStyles } from 'vitepress'
2 |
3 | export default {
4 | plugins: [
5 | postcssIsolateStyles({
6 | includeFiles: [/vp-doc\.css/] // defaults to /base\.css/
7 | })
8 | ]
9 | }
10 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xinnian999/elin-ui/ed1bb6d9d85e68272f8688fec3930706f0abf2c3/public/favicon.ico
--------------------------------------------------------------------------------
/release.config.ts:
--------------------------------------------------------------------------------
1 | import { fileURLToPath, URL } from 'node:url'
2 |
3 | import { defineConfig } from 'vite'
4 | import vue from '@vitejs/plugin-vue'
5 | import vueJsx from '@vitejs/plugin-vue-jsx'
6 | import dts from 'vite-plugin-dts'
7 | import generateGlobalTs from './generateGlobalTs'
8 |
9 | // https://vitejs.dev/config/
10 | export default defineConfig({
11 | plugins: [
12 | vue(),
13 | vueJsx(),
14 | dts({
15 | outDir: './dist',
16 | rollupTypes: true,
17 | include: ['src/**/*', 'src/**/*.vue'],
18 | pathsToAliases: true
19 | }),
20 | (generateGlobalTs as any)()
21 | ],
22 | resolve: {
23 | alias: {
24 | '@': fileURLToPath(new URL('./src', import.meta.url))
25 | }
26 | },
27 | build: {
28 | lib: {
29 | entry: fileURLToPath(new URL('./src/release.ts', import.meta.url)), //指定组件编译入口文件
30 | name: 'elin-ui', // 包名
31 | fileName: 'elin-ui' // 打包文件名
32 | },
33 | rollupOptions: {
34 | // 确保外部化处理那些你不想打包进库的依赖
35 | external: ['vue'],
36 | output: {
37 | // 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
38 | globals: {
39 | vue: 'Vue'
40 | }
41 | }
42 | }
43 | // sourcemap: true
44 | }
45 | })
46 |
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
16 |
--------------------------------------------------------------------------------
/src/assets/global.css:
--------------------------------------------------------------------------------
1 | * {
2 | margin: 0;
3 | padding: 0;
4 | }
5 |
6 | body,
7 | html {
8 | height: 100%;
9 | }
10 |
11 | #app {
12 | height: 100%;
13 | display: flex;
14 | align-items: center;
15 | justify-content: center;
16 | }
17 |
18 | .elin-icon {
19 | display: inline-block;
20 | width: 1em;
21 | height: 1em;
22 | color: inherit;
23 | font-style: normal;
24 | vertical-align: -2px;
25 | outline: none;
26 | stroke: currentColor;
27 | }
28 |
--------------------------------------------------------------------------------
/src/assets/icons/checked.vue:
--------------------------------------------------------------------------------
1 |
2 |
12 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/assets/icons/close.vue:
--------------------------------------------------------------------------------
1 |
2 |
12 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/assets/icons/delete.vue:
--------------------------------------------------------------------------------
1 |
2 |
12 |
16 |
20 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/assets/icons/drop-down.vue:
--------------------------------------------------------------------------------
1 |
2 |
12 |
16 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/assets/icons/drop-up.vue:
--------------------------------------------------------------------------------
1 |
2 |
12 |
16 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/assets/icons/edit.vue:
--------------------------------------------------------------------------------
1 |
2 |
12 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/assets/icons/error.vue:
--------------------------------------------------------------------------------
1 |
2 |
12 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/assets/icons/index.ts:
--------------------------------------------------------------------------------
1 | export { default as IconPlus } from './plus.vue'
2 | export { default as IconDelete } from './delete.vue'
3 | export { default as IconClose } from './close.vue'
4 | export { default as IconEdit } from './edit.vue'
5 | export { default as IconLoading } from './loading.vue'
6 | export { default as IconChecked } from './checked.vue'
7 | export { default as IconDropDown } from './drop-down.vue'
8 | export { default as IconDropUp } from './drop-up.vue'
9 | export { default as IconSuccess } from './success.vue'
10 | export { default as IconInfo } from './info.vue'
11 | export { default as IconWarning } from './warning.vue'
12 | export { default as IconError } from './error.vue'
13 | export { default as IconSearch } from './search.vue'
14 |
--------------------------------------------------------------------------------
/src/assets/icons/info.vue:
--------------------------------------------------------------------------------
1 |
2 |
12 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/assets/icons/loading.vue:
--------------------------------------------------------------------------------
1 |
2 |
12 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/assets/icons/plus.vue:
--------------------------------------------------------------------------------
1 |
2 |
12 |
16 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/assets/icons/search.vue:
--------------------------------------------------------------------------------
1 |
2 |
12 |
16 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/assets/icons/success.vue:
--------------------------------------------------------------------------------
1 |
2 |
12 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/assets/icons/warning.vue:
--------------------------------------------------------------------------------
1 |
2 |
12 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/components/Button/_test_/button.test.tsx:
--------------------------------------------------------------------------------
1 | import { render } from '@testing-library/vue'
2 | import { mount } from '@vue/test-utils'
3 | import { describe, expect, it, test } from 'vitest'
4 | import Button from '../index.vue'
5 | import { namespace } from '@/config'
6 |
7 | describe('Button.vue', () => {
8 | it('create', () => {
9 | const wrapper = mount(() => )
10 |
11 | expect(wrapper.classes()).toContain(`${namespace}-button-primary`)
12 | })
13 | })
14 |
--------------------------------------------------------------------------------
/src/components/Button/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
13 |
14 |
56 |
--------------------------------------------------------------------------------
/src/components/Card/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {{ header }}
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
29 |
--------------------------------------------------------------------------------
/src/components/Checkbox/Checkbox.vue:
--------------------------------------------------------------------------------
1 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | {{ label }}
34 |
35 |
36 |
--------------------------------------------------------------------------------
/src/components/Checkbox/Group.vue:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/components/Checkbox/index.ts:
--------------------------------------------------------------------------------
1 | export { default as ECheckbox } from './Checkbox.vue'
2 | export { default as ECheckboxGroup } from './Group.vue'
3 |
--------------------------------------------------------------------------------
/src/components/Checkbox/symbol.ts:
--------------------------------------------------------------------------------
1 | import type { InjectionKey } from 'vue'
2 |
3 | export const $groupModel = Symbol() as InjectionKey
4 |
--------------------------------------------------------------------------------
/src/components/Clear.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
26 |
27 |
34 |
--------------------------------------------------------------------------------
/src/components/ColorPicker/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
22 |
--------------------------------------------------------------------------------
/src/components/Dialog/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
13 |
14 |
15 |
16 |
17 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/src/components/Dropdown/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
13 |
14 |
15 |
16 |
17 |
43 |
--------------------------------------------------------------------------------
/src/components/Form/Form.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
69 |
--------------------------------------------------------------------------------
/src/components/Form/FormItem.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | *
5 | {{ label }}
6 |
7 |
8 |
9 |
10 | {{ rejected.message }}
11 |
12 |
13 |
14 |
15 |
16 |
42 |
--------------------------------------------------------------------------------
/src/components/Form/config.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xinnian999/elin-ui/ed1bb6d9d85e68272f8688fec3930706f0abf2c3/src/components/Form/config.ts
--------------------------------------------------------------------------------
/src/components/Form/index.ts:
--------------------------------------------------------------------------------
1 | export { default as EForm } from './Form.vue'
2 | export { default as EFormItem } from './FormItem.vue'
3 |
--------------------------------------------------------------------------------
/src/components/Input/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
66 |
--------------------------------------------------------------------------------
/src/components/List/Item.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
13 |
--------------------------------------------------------------------------------
/src/components/List/index.ts:
--------------------------------------------------------------------------------
1 | export { default as EList } from './index.vue'
2 | export { default as EListItem } from './Item.vue'
3 |
--------------------------------------------------------------------------------
/src/components/List/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
15 |
--------------------------------------------------------------------------------
/src/components/Menu/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
6 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | {{ item[labelKey] }}
20 |
21 |
22 |
23 |
24 |
25 |
79 |
--------------------------------------------------------------------------------
/src/components/Popover/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {{ content }}
7 |
8 |
9 |
10 |
11 |
21 |
--------------------------------------------------------------------------------
/src/components/Radio/Group.vue:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/components/Radio/Radio.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{ label }}
8 |
9 |
10 |
11 |
40 |
--------------------------------------------------------------------------------
/src/components/Radio/index.ts:
--------------------------------------------------------------------------------
1 | export { default as ERadio } from './Radio.vue'
2 | export { default as ERadioGroup } from './Group.vue'
3 |
--------------------------------------------------------------------------------
/src/components/Radio/symbol.ts:
--------------------------------------------------------------------------------
1 | import type { InjectionKey } from 'vue'
2 |
3 | export const $groupModel = Symbol() as InjectionKey
4 |
--------------------------------------------------------------------------------
/src/components/Select/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
9 |
17 |
21 | {{ placeholder }}
22 |
23 |
24 |
25 |
26 | {{
27 | options.find((item) => item.value === val)?.label
28 | }}
29 |
30 |
31 |
32 |
33 | {{ options.find((item) => item.value === value)?.label }}
34 |
35 |
36 |
37 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
67 |
68 |
69 |
70 |
71 |
157 |
--------------------------------------------------------------------------------
/src/components/Space/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
31 |
--------------------------------------------------------------------------------
/src/components/Switch/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{
4 | offText
5 | }}
6 |
7 |
8 | {{ value ? onText : offText }}
9 |
10 |
11 |
12 |
13 | {{
14 | onText
15 | }}
16 |
17 |
18 |
19 |
69 |
--------------------------------------------------------------------------------
/src/components/Table/Td.tsx:
--------------------------------------------------------------------------------
1 | import { defineComponent, inject } from 'vue'
2 | import type { tableCol } from './type'
3 | import { $configInit, $config } from '@/config'
4 |
5 | type TdProps = {
6 | rowData: { [key: string]: any }
7 | column: tableCol
8 | index: number
9 | }
10 |
11 | const Td = defineComponent({
12 | props: ['rowData', 'column', 'index'],
13 |
14 | setup({ rowData, column, index }: TdProps) {
15 | const { ns } = inject($config, $configInit)!
16 |
17 | const { formatter, prop = '', fixed, width } = column
18 |
19 | const value = formatter ? formatter({ val: rowData[prop], row: rowData, index }) : rowData[prop]
20 |
21 | return () => (
22 |
29 | {value}
30 |
31 | )
32 | }
33 | })
34 |
35 | export default Td
36 |
--------------------------------------------------------------------------------
/src/components/Table/index.ts:
--------------------------------------------------------------------------------
1 | export { default as ETable } from './index.vue'
2 | export * from './type'
3 |
--------------------------------------------------------------------------------
/src/components/Table/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
20 |
21 | {{ label }}
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/src/components/Table/type.ts:
--------------------------------------------------------------------------------
1 | export type tableCol = {
2 | label?: string
3 | prop?: string
4 | width?: number
5 | fixed?: 'left' | 'right'
6 | formatter?: (data: { val: any; row: object; index: number }) => any
7 | }
8 |
9 | export type tableColumns = tableCol[]
10 |
--------------------------------------------------------------------------------
/src/components/Tag/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
36 |
--------------------------------------------------------------------------------
/src/components/Tooltip/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
14 |
15 |
{{ content }}
16 |
17 |
18 |
19 |
20 |
21 |
113 |
--------------------------------------------------------------------------------
/src/components/common.ts:
--------------------------------------------------------------------------------
1 | export type anyObject = { [key: string]: any }
2 |
3 | export type StatusType = 'primary' | 'success' | 'info' | 'warning' | 'danger'
4 |
5 | export type Option = { label: string; value: string; [key: string]: number | string }
6 |
7 | export type Options = Option[]
8 |
9 | export type Direction = 'vertical' | 'horizontal'
10 |
11 | export interface TooltipProps {
12 | placement?:
13 | | 'top'
14 | | 'top-start'
15 | | 'top-end'
16 | | 'bottom'
17 | | 'bottom-start'
18 | | 'bottom-end'
19 | | 'left'
20 | | 'left-start'
21 | | 'left-end'
22 | | 'right'
23 | | 'right-start'
24 | | 'right-end'
25 | content?: string
26 | trigger?: 'hover' | 'click'
27 | followWidth?: boolean
28 | disabled?: boolean
29 | }
30 |
31 | export interface FormItemCommon {
32 | placeholder?: string
33 | disabled?: boolean
34 | readonly?: boolean
35 | clearable?: boolean
36 | }
37 |
--------------------------------------------------------------------------------
/src/components/index.ts:
--------------------------------------------------------------------------------
1 | import { toast } from 'vue3-toastify'
2 |
3 | export { default as EButton } from './Button/index.vue'
4 | export { default as ESpace } from './Space/index.vue'
5 | export { default as EDialog } from './Dialog/index.vue'
6 | export { default as ESelect } from './Select/index.vue'
7 | export { default as EInput } from './Input/index.vue'
8 | export { default as EColorPicker } from './ColorPicker/index.vue'
9 | export { default as EMenu } from './Menu/index.vue'
10 | export { default as EPopover } from './Popover/index.vue'
11 | export { default as EDropdown } from '@/components/Dropdown/index.vue'
12 | export { default as ETooltip } from '@/components/Tooltip/index.vue'
13 | export { default as ECard } from '@/components/Card/index.vue'
14 | export * from './Radio'
15 | export * from './Checkbox'
16 | export { default as EList } from './List/index.vue'
17 | export { default as ETag } from './Tag/index.vue'
18 | export { default as ESwitch } from './Switch/index.vue'
19 | export * from './Table'
20 | export * from './List'
21 | export * from './Form'
22 | export { toast as EMessage }
23 |
--------------------------------------------------------------------------------
/src/config.ts:
--------------------------------------------------------------------------------
1 | import type { InjectionKey } from 'vue'
2 |
3 | //全局配置
4 | export type $Config = {
5 | namespace: string
6 | ns: (className: string) => string
7 | }
8 |
9 | export const namespace = 'elin'
10 |
11 | export const $config = Symbol('$config') as InjectionKey<$Config>
12 |
13 | export const $configInit: $Config = { namespace, ns: (className) => `${namespace}-${className}` }
14 |
15 | //表单组件通用
16 | export type $FormItem = {
17 | validate: () => void
18 | }
19 |
20 | export const $formItem = Symbol('$formItem') as InjectionKey<$FormItem>
21 |
22 | export const $formItemInit: $FormItem = {
23 | validate: () => {}
24 | }
25 |
--------------------------------------------------------------------------------
/src/directive/clickWater.ts:
--------------------------------------------------------------------------------
1 | import { type App, nextTick } from 'vue'
2 | import type { $Config } from '@/config'
3 |
4 | const clickWater = (app: App, config: $Config) => {
5 | const handle = async (el: HTMLElement, { value = true }) => {
6 | if (!value) return
7 | await nextTick()
8 | const { ns } = config
9 |
10 | el.classList.add(ns('click-water'))
11 |
12 | el.addEventListener('mousedown', (e: MouseEvent) => {
13 | const { left, top } = el.getBoundingClientRect()
14 | el.style.cssText = `--x:${e.clientX - left}px;--y:${e.clientY - top}px`
15 | })
16 | }
17 | app.directive('click-water', {
18 | mounted: handle,
19 | updated: handle
20 | })
21 | }
22 |
23 | export default clickWater
24 |
--------------------------------------------------------------------------------
/src/directive/index.ts:
--------------------------------------------------------------------------------
1 | export { default as selectLoadMore } from './clickWater'
2 |
--------------------------------------------------------------------------------
/src/globalComponents.d.ts:
--------------------------------------------------------------------------------
1 | declare module 'vue' {
2 | export interface GlobalComponents {
3 | EButton: (typeof import('@/components'))['EButton']
4 | ESpace: (typeof import('@/components'))['ESpace']
5 | EDialog: (typeof import('@/components'))['EDialog']
6 | ETable: (typeof import('@/components'))['ETable']
7 | ESelect: (typeof import('@/components'))['ESelect']
8 | EInput: (typeof import('@/components'))['EInput']
9 | EColorPicker: (typeof import('@/components'))['EColorPicker']
10 | ECheckbox: (typeof import('@/components'))['ECheckbox']
11 | ECheckboxGroup: (typeof import('@/components'))['ECheckboxGroup']
12 | ERadio: (typeof import('@/components'))['ERadio']
13 | ERadioGroup: (typeof import('@/components'))['ERadioGroup']
14 | ETooltip: (typeof import('@/components'))['ETooltip']
15 | EPopover: (typeof import('@/components'))['EPopover']
16 | EMenu: (typeof import('@/components'))['EMenu']
17 | EList: (typeof import('@/components'))['EList']
18 | EListItem: (typeof import('@/components'))['EListItem']
19 | EForm: (typeof import('@/components'))['EForm']
20 | EFormItem: (typeof import('@/components'))['EFormItem']
21 | EDropdown: (typeof import('@/components'))['EDropdown']
22 | ETag: (typeof import('@/components'))['ETag']
23 | ECard: (typeof import('@/components'))['ECard']
24 | ESwitch: (typeof import('@/components'))['ESwitch']
25 | }
26 | }
27 |
28 | export {}
29 |
--------------------------------------------------------------------------------
/src/hooks/useClickWater.ts:
--------------------------------------------------------------------------------
1 | import { inject, nextTick, onMounted, type Ref } from 'vue'
2 | import { $config, $configInit } from '@/config'
3 |
4 | const useClickWater = (el: Ref) => {
5 | const { ns } = inject($config, $configInit)!
6 |
7 | onMounted(async () => {
8 | await nextTick()
9 | el.value.classList.add(ns('click-water'))
10 |
11 | el.value.addEventListener('mousedown', (e: MouseEvent) => {
12 | const { left, top } = el.value.getBoundingClientRect()
13 | el.value.style.cssText = `--x:${e.clientX - left}px;--y:${e.clientY - top}px`
14 | })
15 | })
16 | }
17 |
18 | export default useClickWater
19 |
--------------------------------------------------------------------------------
/src/main.ts:
--------------------------------------------------------------------------------
1 | import { createApp } from 'vue'
2 | import App from './App.vue'
3 | import UI from './release'
4 | import './assets/global.css'
5 |
6 | createApp(App).use(UI).mount('#app')
7 |
--------------------------------------------------------------------------------
/src/release.ts:
--------------------------------------------------------------------------------
1 | import type { App } from 'vue'
2 | import Vue3Toasity, { toast, type ToastContainerOptions } from 'vue3-toastify'
3 | import 'vue3-toastify/dist/index.css'
4 | import * as components from '@/components'
5 | import * as directives from '@/directive'
6 | import './style/index.scss'
7 | import { $configInit, $config } from './config'
8 | import 'animate.css'
9 |
10 | export * from '@/components'
11 | export * from '@/components/common'
12 | export * from '@/assets/icons'
13 |
14 | export default (app: App) => {
15 | Object.entries(components).forEach(([key, value]) => {
16 | app.component(key, value as any)
17 | })
18 |
19 | app.provide($config, $configInit)
20 |
21 | app.use(Vue3Toasity, {
22 | autoClose: 3000,
23 | position: 'top-center',
24 | transition: toast.TRANSITIONS.FLIP,
25 | toastClassName: `${$configInit.namespace}-message`
26 | } as ToastContainerOptions)
27 |
28 | Object.values(directives).forEach((fn) => fn(app, $configInit))
29 | }
30 |
--------------------------------------------------------------------------------
/src/style/button.scss:
--------------------------------------------------------------------------------
1 | $buttonClass: '#{$namespace}-button-';
2 |
3 | @include ns(button) {
4 | border-radius: getVar('border', 'radius');
5 | height: 40px;
6 | padding: 15px;
7 | display: inline-flex;
8 | gap: 5px;
9 | align-items: center;
10 | justify-content: center;
11 | cursor: pointer;
12 | font-weight: 500;
13 | background-color: getVar('button', 'bg', 'color');
14 | transition-duration: 0.1s;
15 | border: 1px solid getVar('button', 'border', 'color');
16 | color: getVar('button', 'text-color');
17 | font-size: getVar('font-size-base');
18 | vertical-align: middle;
19 | position: relative;
20 | overflow: hidden;
21 |
22 | &:hover:not(.is-disabled, .is-text) {
23 | opacity: getVar('button', 'hover', 'opacity');
24 | background-color: getVar('button', 'hover', 'bg', 'color');
25 | color: getVar('button', 'hover', 'text', 'color');
26 | border-color: getVar('button', 'hover', 'border', 'color');
27 | }
28 |
29 | &.is-click-zoom {
30 | &:active:not(.is-disabled) {
31 | transform: scale(0.95);
32 | }
33 | }
34 |
35 | &.is-text {
36 | background-color: transparent;
37 | border: none;
38 |
39 | &:hover {
40 | background-color: getVar('fill', 'color', 'light');
41 | }
42 | }
43 |
44 | &.is-circle {
45 | border-radius: 50%;
46 | width: 40px;
47 | text-align: center;
48 | padding: 12px;
49 | }
50 |
51 | &.is-round {
52 | border-radius: 20px;
53 | text-align: center;
54 | }
55 |
56 | &.is-disabled {
57 | opacity: 0.5;
58 | cursor: not-allowed;
59 | }
60 |
61 | &-large {
62 | padding: 20px;
63 | height: 50px;
64 | font-size: 16px;
65 | }
66 |
67 | &-small {
68 | padding: 10px;
69 | height: 30px;
70 | font-size: 12px;
71 | }
72 |
73 | & + &:not(.is-text) {
74 | margin-left: 15px;
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/src/style/buttonVar.scss:
--------------------------------------------------------------------------------
1 | @mixin button-type($type) {
2 | @include generate-var-map(
3 | (
4 | 'button-text-color': #fff,
5 | 'button-border-color': getVar($type, 'color'),
6 | 'button-bg-color': getVar($type, 'color'),
7 | 'button-hover-bg-color': getVar($type, 'color'),
8 | 'button-hover-border-color': getVar($type, 'color'),
9 | 'button-hover-text-color': #fff,
10 | 'button-hover-opacity': 0.8,
11 | 'click-water': #fff
12 | )
13 | );
14 | }
15 |
16 | @mixin button-type-plain($type) {
17 | @include generate-var-map(
18 | (
19 | 'button-bg-color': getVar($type, 'color', '9'),
20 | 'button-text-color': getVar($type, 'color'),
21 | 'button-border-color': getVar($type, 'color', '5'),
22 | 'button-hover-bg-color': getVar($type, 'color'),
23 | 'button-hover-text-color': #fff,
24 | 'click-water': #fff
25 | )
26 | );
27 | }
28 |
29 | @include ns(button) {
30 | //初始化变量
31 | @include generate-var-map(
32 | (
33 | 'button-text-color': getVar('text', 'color'),
34 | 'button-border-color': getVar('border', 'color'),
35 | 'button-hover-bg-color': getVar('primary', 'color', '9'),
36 | 'button-hover-border-color': getVar('primary', 'color'),
37 | 'button-hover-text-color': getVar('primary', 'color'),
38 | 'button-hover-opacity': 1,
39 | 'click-water': #333
40 | )
41 | );
42 |
43 | //朴素按钮初始变量
44 | &.is-plain {
45 | @include generate-var-map(
46 | (
47 | 'button-bg-color': getVar('fill', 'color', 'blank'),
48 | 'button-hover-bg-color': getVar('fill', 'color', 'blank'),
49 | 'button-hover-opacity': 1
50 | )
51 | );
52 | }
53 |
54 | //文字按钮变量
55 | &.is-text {
56 | @include setVarFormVar(('button', 'text', 'color'), ('text', 'color', 'regular'));
57 | }
58 |
59 | &-primary {
60 | @include button-type('primary');
61 |
62 | &.is-plain {
63 | @include button-type-plain('primary');
64 | }
65 |
66 | &.is-text {
67 | @include setVarFormVar(('button', 'text', 'color'), ('primary', 'color'));
68 | }
69 | }
70 |
71 | &-success {
72 | @include button-type('success');
73 |
74 | &.is-plain {
75 | @include button-type-plain('success');
76 | }
77 |
78 | &.is-text {
79 | @include setVarFormVar(('button', 'text', 'color'), ('success', 'color'));
80 | }
81 | }
82 |
83 | &-info {
84 | @include button-type('info');
85 | &.is-plain {
86 | @include button-type-plain('info');
87 | }
88 |
89 | &.is-text {
90 | @include setVarFormVar(('button', 'text', 'color'), ('info', 'color'));
91 | }
92 | }
93 |
94 | &-warning {
95 | @include button-type('warning');
96 |
97 | &.is-plain {
98 | @include button-type-plain('warning');
99 | }
100 |
101 | &.is-text {
102 | @include setVarFormVar(('button', 'text', 'color'), ('warning', 'color'));
103 | }
104 | }
105 |
106 | &-danger {
107 | @include button-type('danger');
108 |
109 | &.is-plain {
110 | @include button-type-plain('danger');
111 | }
112 |
113 | &.is-text {
114 | @include setVarFormVar(('button', 'text', 'color'), ('danger', 'color'));
115 | }
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/src/style/card.scss:
--------------------------------------------------------------------------------
1 | @include ns(card) {
2 | $padding: 15px;
3 | border-radius: getVar('border', 'radius');
4 | border: 1px solid getVar('border', 'color');
5 | box-shadow: getVar('box-shadow');
6 | background-color: getVar('bg-color');
7 |
8 | &-header {
9 | padding: $padding;
10 | border-bottom: 1px solid getVar('border', 'color');
11 | }
12 | &-body {
13 | padding: $padding;
14 | }
15 | &-footer {
16 | padding: $padding;
17 | border-top: 1px solid getVar('border', 'color');
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/style/checkbox.scss:
--------------------------------------------------------------------------------
1 | @include ns(checkbox) {
2 | display: inline-flex;
3 | align-items: center;
4 | gap: 5px;
5 | cursor: pointer;
6 | user-select: none;
7 | font-weight: 500;
8 | &-box {
9 | display: inline-block;
10 | height: 20px;
11 | width: 20px;
12 | border-radius: getVar('border', 'radius');
13 | position: relative;
14 | border: 1px solid getVar('border', 'color');
15 | overflow: hidden;
16 |
17 | &:hover {
18 | border-color: getVar('primary', 'color');
19 | }
20 |
21 | &-inner {
22 | display: inline-block;
23 | width: 100%;
24 | height: 100%;
25 | background-color: getVar('primary-color');
26 | position: absolute;
27 | top: 0;
28 | left: 0;
29 | animation: fadeInUp;
30 | animation-duration: 0.1s;
31 | }
32 | .checked-ico {
33 | position: absolute;
34 | top: 50%;
35 | left: 50%;
36 | color: #fff;
37 | transform: translate(-50%, -50%);
38 | }
39 |
40 | input {
41 | opacity: 0;
42 | cursor: pointer;
43 | }
44 | }
45 | }
46 |
47 | @include ns(checkbox-group) {
48 | display: flex;
49 | gap: 20px;
50 | }
51 |
--------------------------------------------------------------------------------
/src/style/colorPicker.scss:
--------------------------------------------------------------------------------
1 | @include ns(color-picker) {
2 | border-radius: getVar('border', 'radius');
3 | border: 1px solid getVar('border', 'color');
4 | padding: 3px 5px;
5 | position: relative;
6 | width: 50px;
7 | cursor: pointer;
8 | &-inner {
9 | width: 100%;
10 | cursor: pointer;
11 | }
12 |
13 | &:hover {
14 | border-color: getVar('border', 'color', 'darker');
15 | }
16 |
17 | &:focus-within {
18 | border-color: getVar('primary', 'color');
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/style/dialog.scss:
--------------------------------------------------------------------------------
1 | @include ns(overlay) {
2 | position: fixed;
3 | height: 100%;
4 | width: 100%;
5 | left: 0;
6 | top: 0;
7 | background-color: getVar('overlay', 'color', 'lighter');
8 | z-index: 2024;
9 | }
10 |
11 | @include ns(dialog) {
12 | width: getVar('dialog', 'width');
13 | margin: getVar('dialog', 'top') auto 0;
14 | background-color: getVar('bg', 'color');
15 | padding: 25px;
16 | border-radius: getVar('border', 'radius');
17 | display: flex;
18 | flex-direction: column;
19 | gap: 15px;
20 | animation: zoomIn;
21 | animation-duration: 0.3s;
22 | position: relative;
23 | box-shadow: getVar('box-shadow');
24 |
25 | &-close {
26 | position: absolute;
27 | right: 15px;
28 | top: 15px;
29 | cursor: pointer;
30 | width: 35px;
31 | height: 35px;
32 | border-radius: 50%;
33 | display: flex;
34 | justify-content: center;
35 | align-items: center;
36 |
37 | &:hover {
38 | background-color: getVar('fill', 'color', 'light');
39 | }
40 | }
41 |
42 | &-header {
43 | font-size: 18px;
44 | font-weight: bold;
45 | }
46 |
47 | &-footer {
48 | text-align: right;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/style/form.scss:
--------------------------------------------------------------------------------
1 | @include ns(form) {
2 | }
3 |
4 | @include ns(form-item) {
5 | margin-bottom: 20px;
6 | display: flex;
7 | align-items: center;
8 | gap: 10px;
9 | &-label {
10 | font-size: getVar('font-size-base');
11 | text-align: right;
12 | width: 70px;
13 | position: relative;
14 | &-rule {
15 | color: getVar('danger-color');
16 | margin-right: 5px;
17 | }
18 | }
19 | &-content {
20 | flex: 1;
21 | position: relative;
22 | &-message {
23 | position: absolute;
24 | left: 0;
25 | bottom: -22px;
26 | font-size: 12px;
27 | color: getVar('danger-color');
28 | animation: fadeIn 0.2s;
29 | }
30 | }
31 |
32 | &.is-reject {
33 | .#{$namespace}-input {
34 | border-color: getVar('danger', 'color');
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/style/functions.scss:
--------------------------------------------------------------------------------
1 | @function get-colors($color-primary, $steps: 10, $increment: 5%) {
2 | $color-map: (); // 创建一个空 map
3 |
4 | @for $i from 2 through $steps {
5 | $lighter-color: darken($color-primary, $i * $increment); // 计算颜色
6 |
7 | $color-name: '#{$i}'; // 设置变量名
8 | $var-name: '--#{$color-name}'; // CSS 自定义属性名称
9 |
10 | $color-map: map-merge(
11 | $color-map,
12 | (
13 | $i: $lighter-color
14 | )
15 | ); // 将变量设置到 map 中
16 | }
17 |
18 | @return $color-map; // 返回颜色 map
19 | }
20 |
21 | @function joinVarName($list) {
22 | $name: '--' + $namespace;
23 | @each $item in $list {
24 | @if $item != '' {
25 | $name: $name + '-' + $item;
26 | }
27 | }
28 | @return $name;
29 | }
30 |
31 | @function getVar($args...) {
32 | @return var(#{joinVarName($args)});
33 | }
34 |
35 | @function get-var-with-default($name, $default) {
36 | @return var(#{joinVarName($name)}, $default);
37 | }
38 |
--------------------------------------------------------------------------------
/src/style/global.scss:
--------------------------------------------------------------------------------
1 | @include ns(icon) {
2 | display: inline-block;
3 | width: 1em;
4 | height: 1em;
5 | color: inherit;
6 | font-style: normal;
7 | vertical-align: -2px;
8 | outline: none;
9 | stroke: currentColor;
10 | fill: currentColor;
11 | }
12 |
13 | @include ns(icon-loading) {
14 | @keyframes rotate {
15 | from {
16 | transform: rotate(0deg);
17 | }
18 | to {
19 | transform: rotate(360deg);
20 | }
21 | }
22 |
23 | animation: rotate 2s linear infinite;
24 | }
25 |
26 | @include ns(click-water) {
27 | $imageColor: get-var-with-default('click-water', #fff);
28 |
29 | @debug $imageColor;
30 | &::before {
31 | content: '';
32 | display: block;
33 | position: absolute;
34 | width: 100%;
35 | height: 100%;
36 | left: 0;
37 | top: 0;
38 | transition: 0.3s;
39 | background: #fff;
40 | opacity: 0;
41 | }
42 |
43 | &:active::before {
44 | opacity: 0.2;
45 | }
46 |
47 | &::after {
48 | content: '';
49 | display: block;
50 | position: absolute;
51 | width: 200%;
52 | height: 100%;
53 | left: var(--x, 0);
54 | top: var(--y, 0);
55 | background-image: radial-gradient(circle, $imageColor 10%, transparent 10.01%);
56 | background-repeat: no-repeat;
57 | background-position: 50%;
58 | transform: translate(-50%, -50%) scale(10);
59 | opacity: 0;
60 | transition:
61 | transform 0.8s,
62 | opacity 0.8s;
63 | }
64 |
65 | &:active::after {
66 | transform: translate(-50%, -50%) scale(0);
67 | opacity: 0.3;
68 | transition: 0s;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/src/style/index.scss:
--------------------------------------------------------------------------------
1 | $namespace: 'elin';
2 |
3 | @import 'functions', 'mixins', 'var', 'button', 'global', 'buttonVar', 'dialog', 'table', 'input',
4 | 'checkbox', 'tooltip', 'popover', 'select', 'menu', 'list', 'tag', 'space', 'message',
5 | 'colorPicker', 'card', 'form', 'radio', 'switch';
6 |
--------------------------------------------------------------------------------
/src/style/input.scss:
--------------------------------------------------------------------------------
1 | @include ns(input) {
2 | border-radius: getVar('border', 'radius');
3 | border: 1px solid getVar('border', 'color');
4 | position: relative;
5 | cursor: getVar('input-cursor');
6 | display: flex;
7 | align-items: center;
8 | overflow: hidden;
9 |
10 | .clear-bar {
11 | display: none;
12 | }
13 |
14 | &-inner {
15 | width: 100%;
16 | cursor: inherit;
17 | border: none;
18 | background: none;
19 | outline: none;
20 | padding: 5px 10px;
21 | }
22 |
23 | &:hover {
24 | border-color: getVar('border', 'color', 'darker');
25 | .clear-bar {
26 | margin: 0 10px;
27 | display: block;
28 | }
29 | }
30 |
31 | &:focus-within {
32 | border-color: getVar('primary', 'color');
33 | }
34 |
35 | &.is-disabled {
36 | background-color: getVar('disabled-bg-color');
37 | border-color: getVar('border', 'color');
38 | cursor: not-allowed;
39 | }
40 |
41 | &.is-textarea {
42 | // padding: 5px 0 0 10px;
43 | }
44 |
45 | .prefix-icon {
46 | padding-left: 10px;
47 | }
48 |
49 | .suffix-icon {
50 | padding-right: 10px;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/src/style/list.scss:
--------------------------------------------------------------------------------
1 | @include ns(list) {
2 | margin: 0;
3 | padding: 0;
4 | list-style: none;
5 | display: flex;
6 | flex-direction: column;
7 | gap: 5px;
8 |
9 | &-item {
10 | padding: 10px 12px;
11 | cursor: pointer;
12 | font-size: getVar('font-size-base');
13 | font-weight: 500;
14 | border-radius: getVar('border', 'radius');
15 |
16 | &:hover {
17 | background-color: getVar('primary-color-8');
18 | }
19 |
20 | &.is-active {
21 | background-color: getVar('primary-color-8');
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/style/menu.scss:
--------------------------------------------------------------------------------
1 | @include ns(menu) {
2 | margin: 0;
3 | padding: 0;
4 | list-style: none;
5 | display: flex;
6 | flex-direction: column;
7 | gap: 5px;
8 |
9 | &-item {
10 | padding: 10px 12px;
11 | cursor: pointer;
12 | font-size: getVar('font-size-base');
13 | font-weight: 500;
14 | position: relative;
15 | overflow: hidden;
16 | border-radius: getVar('border', 'radius');
17 | @include setVar('click-water', #333);
18 |
19 | &:hover {
20 | background-color: getVar('primary-color-8');
21 | }
22 |
23 | &.is-active {
24 | color: getVar('primary-color');
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/style/message.scss:
--------------------------------------------------------------------------------
1 | @include ns(message) {
2 | $name: &;
3 | &-success {
4 | }
5 |
6 | &-warning {
7 | }
8 |
9 | &-error {
10 | }
11 |
12 | &-info {
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/style/mixins.scss:
--------------------------------------------------------------------------------
1 | @mixin ns($cls) {
2 | $NS: $namespace + '-' + $cls;
3 |
4 | .#{$NS} {
5 | @content;
6 | }
7 | }
8 |
9 | //设置全局var
10 | @mixin setVar($var, $value) {
11 | $varName: joinVarName($var);
12 |
13 | #{$varName}: $value;
14 | }
15 |
16 | //设置全局var,根据var名map取值
17 | @mixin setVarFormVar($var, $gVar) {
18 | $varName: joinVarName($var);
19 | $gVarName: joinVarName($gVar);
20 | // @debug $varName, $gVarName;
21 |
22 | #{$varName}: var(#{$gVarName});
23 | }
24 |
25 | //根据map生成全局var
26 | @mixin generate-var-map($varMap, $key-prefix: '', $key-suffix: '') {
27 | @each $key, $value in $varMap {
28 | //根据值是不是map调用不同的方法
29 | @include setVar(($key-prefix, $key, $key-suffix), $value);
30 | }
31 | }
32 |
33 | @mixin generate-colors($colors, $type) {
34 | @each $key, $value in $colors {
35 | @include setVar(($key, 'color'), $value);
36 |
37 | $color-map: (); // 创建一个空 map
38 |
39 | @for $i from 2 through 10 {
40 | $color: '';
41 | @if ($type== 'light') {
42 | $color: lighten($value, $i * 5%); // 计算颜色
43 | } @else {
44 | $color: darken($value, $i * 5%); // 计算颜色
45 | }
46 |
47 | $color-name: '#{$i}'; // 设置变量名
48 | $var-name: '--#{$color-name}'; // CSS 自定义属性名称
49 |
50 | $color-map: map-merge(
51 | $color-map,
52 | (
53 | $i: $color
54 | )
55 | );
56 | }
57 |
58 | @each $colorKey, $colorValue in $color-map {
59 | @include setVar(($key, 'color', $colorKey), $colorValue);
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/style/popover.scss:
--------------------------------------------------------------------------------
1 | @include ns(popover) {
2 | @extend .#{$namespace}-tooltip;
3 | background-color: getVar('bg', 'color');
4 | min-width: 100px;
5 | color: getVar('text-color');
6 | }
7 |
--------------------------------------------------------------------------------
/src/style/radio.scss:
--------------------------------------------------------------------------------
1 | @include ns(radio) {
2 | display: inline-flex;
3 | align-items: center;
4 | gap: 5px;
5 | cursor: pointer;
6 | user-select: none;
7 | font-weight: 500;
8 | &-box {
9 | display: inline-block;
10 | height: 20px;
11 | width: 20px;
12 | border-radius: 50%;
13 | position: relative;
14 | border: 1px solid getVar('border', 'color');
15 | overflow: hidden;
16 |
17 | &:hover {
18 | border-color: getVar('primary', 'color');
19 | }
20 |
21 | &.is-checked {
22 | border-color: getVar('primary', 'color');
23 | }
24 |
25 | &-inner {
26 | display: inline-block;
27 | width: 12px;
28 | height: 12px;
29 | background-color: getVar('primary-color');
30 | position: absolute;
31 | top: 50%;
32 | left: 50%;
33 | margin-left: -6px;
34 | margin-top: -6px;
35 | border-radius: 50%;
36 | animation: zoomIn;
37 | animation-duration: 0.1s;
38 | }
39 |
40 | input {
41 | opacity: 0;
42 | cursor: pointer;
43 | }
44 | }
45 | }
46 |
47 | @include ns(radio-group) {
48 | display: flex;
49 | gap: 20px;
50 | }
51 |
--------------------------------------------------------------------------------
/src/style/select.scss:
--------------------------------------------------------------------------------
1 | @include ns(select) {
2 | $name: &;
3 | border-radius: getVar('border', 'radius');
4 | border: 1px solid getVar('border', 'color');
5 | padding: 5px 10px;
6 | position: relative;
7 | min-height: 36px;
8 | cursor: pointer;
9 | font-size: getVar('font-size-base');
10 | font-weight: 500;
11 | display: flex;
12 | padding-right: 30px;
13 | &-placeholder {
14 | color: getVar('text', 'color', 'placeholder');
15 | user-select: none;
16 | flex: 1;
17 | position: absolute;
18 | left: 10px;
19 | }
20 |
21 | &-value {
22 | user-select: none;
23 | flex: 1;
24 | display: flex;
25 | flex-wrap: wrap;
26 | position: relative;
27 | &-multiple {
28 | display: inline-flex;
29 | flex-wrap: wrap;
30 | gap: 5px;
31 | }
32 | &-radio {
33 | position: absolute;
34 | left: 0;
35 | }
36 | }
37 |
38 | .filter-input {
39 | flex: 1;
40 | z-index: 10;
41 | }
42 |
43 | &.is-multiple {
44 | .filter-input {
45 | margin-top: 5px;
46 | }
47 | }
48 |
49 | &-suffix {
50 | position: absolute;
51 | right: 10px;
52 | top: 50%;
53 | transform: translateY(-50%);
54 | transition: transform 0.2s;
55 | }
56 |
57 | &.is-focus {
58 | border-color: getVar('primary', 'color');
59 | #{$name}-suffix {
60 | transform: translateY(-50%) rotate(180deg);
61 | }
62 | #{$name}-value {
63 | color: getVar('text', 'color', 'placeholder');
64 | }
65 | }
66 |
67 | &.is-disabled {
68 | background-color: getVar('disabled-bg-color');
69 | border-color: getVar('border', 'color');
70 | cursor: not-allowed;
71 | }
72 |
73 | .clear-bar {
74 | display: none;
75 | }
76 |
77 | &:hover:not(.is-disabled) {
78 | border-color: getVar('border', 'color', 'darker');
79 | .clear-bar {
80 | margin: 0 5px;
81 | display: flex;
82 | align-items: center;
83 | }
84 | }
85 | }
86 |
87 | @include ns(select-drop) {
88 | background-color: getVar('bg', 'color');
89 | color: getVar('text-color');
90 | }
91 |
--------------------------------------------------------------------------------
/src/style/space.scss:
--------------------------------------------------------------------------------
1 | @include ns(space) {
2 | //@include generate-var-map(
3 | // (
4 | // 'space-direction': row,
5 | // 'space-wrap': nowrap,
6 | // 'space-wrap': 20,
7 | // )
8 | //);
9 |
10 | display: flex;
11 | gap: getVar('space-gap');
12 | flex-direction: getVar('space-direction');
13 | flex-wrap: getVar('space-wrap');
14 | }
15 |
--------------------------------------------------------------------------------
/src/style/switch.scss:
--------------------------------------------------------------------------------
1 | @include ns(switch) {
2 | display: inline-flex;
3 | gap: 10px;
4 | align-items: center;
5 | position: relative;
6 |
7 | &-inner {
8 | font-size: 12px;
9 | position: relative;
10 | display: inline-block;
11 | min-width: 3.5em;
12 | height: 2em;
13 | .inline-text {
14 | z-index: 10;
15 | position: relative;
16 | padding: 0 5px 0 25px;
17 | color: #fff;
18 | user-select: none;
19 | cursor: pointer;
20 | }
21 |
22 | input {
23 | opacity: 0;
24 | width: 0;
25 | height: 0;
26 | }
27 |
28 | .slider {
29 | position: absolute;
30 | cursor: pointer;
31 | inset: 0;
32 | background: getVar('primary-color-5');
33 | border-radius: 50px;
34 | transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
35 | }
36 |
37 | .slider:before {
38 | position: absolute;
39 | content: '';
40 | height: 1.4em;
41 | width: 1.4em;
42 | left: 0.3em;
43 | bottom: 0.3em;
44 | background-color: white;
45 | border-radius: 50px;
46 | box-shadow: 0 0px 20px rgba(0, 0, 0, 0.4);
47 | transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
48 | }
49 |
50 | input:checked + .slider {
51 | background: getVar('primary-color');
52 | }
53 |
54 | input:focus + .slider {
55 | box-shadow: 0 0 1px #b84fce;
56 | }
57 |
58 | input:checked + .slider:before {
59 | transform: translateX(1.6em);
60 | width: 2em;
61 | height: 2em;
62 | bottom: 0;
63 | right: 1.2em;
64 | left: auto;
65 | }
66 | }
67 |
68 | .off-text,
69 | .on-text {
70 | font-size: 14px;
71 | font-weight: 500;
72 | }
73 |
74 | .on-text.is-active,
75 | .off-text.is-active {
76 | color: getVar('primary-color');
77 | }
78 |
79 | &.is-on {
80 | .inline-text {
81 | padding: 0 18px 0 10px;
82 | }
83 | }
84 |
85 | &.is-disabled {
86 | border-color: getVar('border', 'color');
87 | cursor: not-allowed;
88 | pointer-events: none;
89 | .slider {
90 | background-color: #eee;
91 | box-shadow: 0px 0px 1px #999;
92 | }
93 | .slider:before {
94 | //box-shadow: none;
95 | }
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/src/style/table.scss:
--------------------------------------------------------------------------------
1 | @include ns(table-wrapper) {
2 | overflow-x: hidden;
3 | &:hover {
4 | overflow-x: auto;
5 | }
6 |
7 | &.is-scroll {
8 | .is-fixed {
9 | position: sticky;
10 | z-index: 20;
11 | background-color: getVar('bg', 'color');
12 | &::after {
13 | content: '';
14 | position: absolute;
15 | top: 0;
16 | width: 10px;
17 | bottom: -1px;
18 | touch-action: none;
19 | }
20 | }
21 |
22 | .is-fixed-left {
23 | &::after {
24 | box-shadow: inset 10px 0 10px -10px #00000026;
25 | right: -10px;
26 | }
27 | }
28 |
29 | .is-fixed-right {
30 | &::after {
31 | box-shadow: inset -10px 0 10px -10px #00000026;
32 | left: -10px;
33 | }
34 | }
35 | }
36 | }
37 |
38 | @include ns(table) {
39 | width: 100%;
40 | border-collapse: collapse;
41 |
42 | &-body {
43 | }
44 |
45 | &-th {
46 | padding: 12px 16px;
47 | text-align: left;
48 | color: getVar('text', 'color');
49 | position: relative;
50 | font-size: 12px;
51 | }
52 |
53 | &-tr {
54 | //padding: 10px;
55 | border-bottom: 1px solid getVar('border', 'color', 'lighter');
56 | overflow: auto;
57 | position: relative;
58 | }
59 |
60 | &-td {
61 | padding: 12px 16px;
62 | position: relative;
63 | font-size: getVar('font-size-base');
64 | }
65 |
66 | &-cell {
67 | display: inline-block;
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/src/style/tag.scss:
--------------------------------------------------------------------------------
1 | @mixin tag-type($type) {
2 | @include generate-var-map(
3 | (
4 | 'tag-bg-color': getVar($type, 'color', '8'),
5 | 'tag-border-color': getVar($type, 'color', 5),
6 | 'tag-text-color': getVar($type, 'color')
7 | )
8 | );
9 | }
10 |
11 | @include ns(tag) {
12 | @include tag-type(primary);
13 |
14 | background-color: getVar('tag-bg-color');
15 | border-color: getVar('tag-border-color');
16 | color: getVar('tag-text-color');
17 | display: inline-flex;
18 | justify-content: center;
19 | font-weight: 500;
20 | gap: 5px;
21 | align-items: center;
22 | vertical-align: middle;
23 | height: 24px;
24 | padding: 0 9px;
25 | font-size: getVar('font-size-base');
26 | line-height: 1;
27 | border-width: 1px;
28 | border-style: solid;
29 | border-radius: getVar('border', 'radius');
30 | box-sizing: border-box;
31 | white-space: nowrap;
32 | animation: zoomIn 0.3s;
33 |
34 | .close-ico {
35 | font-size: 14px;
36 | cursor: pointer;
37 | border-radius: 50%;
38 | padding: 2px;
39 | &:hover {
40 | color: #fff;
41 | background-color: getVar('tag-text-color');
42 | }
43 | }
44 |
45 | &-success {
46 | @include tag-type(success);
47 | }
48 |
49 | &-warning {
50 | @include tag-type(warning);
51 | }
52 |
53 | &-danger {
54 | @include tag-type(danger);
55 | }
56 |
57 | &-info {
58 | @include tag-type(info);
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/src/style/tooltip.scss:
--------------------------------------------------------------------------------
1 | @include ns(tooltip) {
2 | position: absolute;
3 | left: 0;
4 | top: 0;
5 | background-color: getVar('text', 'color');
6 | color: getVar('bg', 'color');
7 | font-size: getVar('font', 'size', 'small');
8 | border-radius: getVar('border', 'radius');
9 | box-shadow: getVar('box-shadow');
10 | min-width: 60px;
11 | padding: 8px;
12 | z-index: 200;
13 | border: 1px solid getVar('border', 'color', 'lighter');
14 | animation: fadeIn 0.3s;
15 | }
16 |
--------------------------------------------------------------------------------
/src/style/var.scss:
--------------------------------------------------------------------------------
1 | $themeColor: (
2 | 'primary': #2563eb,
3 | 'success': #67c23a,
4 | 'info': #607d8b,
5 | 'warning': #efa314,
6 | 'danger': #ee0a24
7 | );
8 |
9 | $lights: (
10 | 'bg-color': #fff,
11 | 'text-color': #303133,
12 | 'text-color-regular': #606266,
13 | 'text-color-placeholder': #a8abb2,
14 | 'border-color': #dcdfe6,
15 | 'border-color-lighter': #ebeef5,
16 | 'border-color-darker': #babec7,
17 |
18 | 'fill-color': #f0f2f5,
19 | 'fill-color-light': #f5f7fa,
20 | 'fill-color-blank': #ffffff,
21 | 'overlay-color': rgba(0, 0, 0, 0.8),
22 | 'overlay-color-light': rgba(0, 0, 0, 0.7),
23 | 'overlay-color-lighter': rgba(0, 0, 0, 0.5),
24 | 'box-shadow': (
25 | 0px 12px 32px 4px rgba(0, 0, 0, 0.04),
26 | 0px 8px 20px rgba(0, 0, 0, 0.08)
27 | ),
28 | 'disabled-bg-color': #f5f7fa
29 | );
30 |
31 | $darks: (
32 | 'bg-color': #1b1b1f,
33 | 'text-color': #e5eaf3,
34 | 'text-color-regular': #cfd3dc,
35 | 'text-color-placeholder': #8d9095,
36 | 'border-color': #4c4d4f,
37 | 'border-color-lighter': #363637,
38 | 'fill-color': #303030,
39 | 'fill-color-light': #262727,
40 | 'fill-color-blank': transparent,
41 | 'box-shadow': (
42 | 0px 12px 32px 4px rgba(0, 0, 0, 0.36),
43 | 0px 8px 20px rgba(0, 0, 0, 0.72)
44 | ),
45 | 'disabled-bg-color': #262727
46 | );
47 |
48 | :root {
49 | @include setVar('border-radius', 7px);
50 | @include setVar('font-size-small', 13px);
51 | @include setVar('font-size-base', 14px);
52 |
53 | @include generate-colors($themeColor, light);
54 | @include generate-var-map($lights);
55 | &.dark {
56 | @include generate-colors($themeColor, dark);
57 | @include generate-var-map($darks);
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@vue/tsconfig/tsconfig.dom.json",
3 | "include": ["env.d.ts", "src/**/*", "src/**/*.vue", "src/**/*.ts","docs/**/*.vue","docs/**/*.ts"],
4 | "exclude": ["src/**/__tests__/*"],
5 | "compilerOptions": {
6 | "composite": true,
7 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
8 |
9 | "baseUrl": ".",
10 | "paths": {
11 | "@/*": ["./src/*"]
12 | },
13 | "types": ["vitest/globals"]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/vite.config.ts:
--------------------------------------------------------------------------------
1 | ///
2 | import { fileURLToPath, URL } from 'node:url'
3 |
4 | import { defineConfig } from 'vite'
5 | import vue from '@vitejs/plugin-vue'
6 | import vueJsx from '@vitejs/plugin-vue-jsx'
7 |
8 | // https://vitejs.dev/config/
9 | export default defineConfig({
10 | plugins: [vue(), vueJsx()],
11 | resolve: {
12 | alias: {
13 | '@': fileURLToPath(new URL('./src', import.meta.url)),
14 | 'elin-ui': fileURLToPath(new URL('./src/release', import.meta.url))
15 | }
16 | },
17 | test: {
18 | // 启用类似 jest 的全局测试 API
19 | globals: true,
20 | // 使用 happy-dom 模拟 DOM
21 | // 这需要你安装 happy-dom 作为对等依赖(peer dependency)
22 | environment: 'happy-dom'
23 | }
24 | })
25 |
--------------------------------------------------------------------------------