├── .editorconfig ├── .eslintrc.js ├── .github └── workflows │ └── deploy.yml ├── .gitignore ├── .prettierrc ├── .stylelintrc ├── LICENSE ├── README.md ├── alias.js ├── babel.config.js ├── components.d.ts ├── docs ├── .vuepress │ ├── .DS_Store │ ├── client.js │ ├── config.js │ ├── dist │ │ ├── 404.html │ │ ├── assets │ │ │ ├── 404.e222bc2a.js │ │ │ ├── 404.html.4f8e6760.js │ │ │ ├── 404.html.c3886853.js │ │ │ ├── Layout.e6bb4246.js │ │ │ ├── app.67122b30.js │ │ │ ├── back-to-top.8efcbe56.svg │ │ │ ├── element-icons.9c88a535.woff │ │ │ ├── element-icons.de5eb258.ttf │ │ │ ├── iconfont.5b2375f1.svg │ │ │ ├── index.html.1089cbd5.js │ │ │ ├── index.html.ae40c818.js │ │ │ ├── install.html.6986468a.js │ │ │ ├── install.html.e44d4a3a.js │ │ │ ├── layout.html.1dce1f5f.js │ │ │ ├── layout.html.6fd5e2b4.js │ │ │ ├── start.html.26ce266d.js │ │ │ ├── start.html.592580ad.js │ │ │ ├── style.ebc8fdd8.css │ │ │ ├── table.html.01d9d730.js │ │ │ └── table.html.74858bb0.js │ │ ├── components │ │ │ ├── layout.html │ │ │ └── table.html │ │ ├── guide │ │ │ ├── install.html │ │ │ └── start.html │ │ └── index.html │ └── theme │ │ └── styles │ │ └── index.styl ├── components │ ├── layout.md │ └── table.md ├── guide │ ├── install.md │ └── start.md └── index.md ├── jest.config.js ├── lerna.json ├── main.css ├── package.json ├── packages ├── layout │ ├── .gitignore │ ├── README.md │ ├── __tests__ │ │ └── layout.spec.ts │ ├── package.json │ ├── src │ │ ├── Index.vue │ │ ├── components │ │ │ └── Render.vue │ │ └── main.ts │ └── typings │ │ └── sum-ui.d.ts └── table │ ├── .gitignore │ ├── README.md │ ├── __tests__ │ └── table.spec.ts │ ├── package.json │ ├── src │ ├── Index.vue │ ├── components │ │ └── Render.vue │ └── main.ts │ └── typings │ └── sum-ui.d.ts ├── plopfile.js ├── rollup.config.js ├── tailwind.config.js ├── templates ├── .gitignore ├── README.hbs ├── __tests__ │ └── index.spec.hbs ├── package.hbs ├── src │ ├── Index.vue │ └── main.hbs └── typings │ └── sum-ui.d.ts ├── tsconfig.json ├── typings ├── vue-shim.d.ts └── vue-test-utils.d.ts └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | quote_type = single -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true, 5 | browser: true, 6 | es6: true 7 | }, 8 | extends: [ 9 | 'plugin:vue/vue3-essential', 10 | 'eslint:recommended', 11 | '@vue/typescript/recommended', 12 | '@vue/prettier', 13 | '@vue/prettier/@typescript-eslint' 14 | ], 15 | parserOptions: { 16 | ecmaVersion: 2020 17 | }, 18 | rules: { 19 | 'prettier/prettier': 'error', 20 | 'no-console': process.env.NODE_ENV === 'prod' ? 'warn' : 'off', 21 | 'no-debugger': process.env.NODE_ENV === 'prod' ? 'warn' : 'off', 22 | '@typescript-eslint/no-var-requires': 'off' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Build and Deploy 2 | on: 3 | push: 4 | branches: 5 | - master 6 | jobs: 7 | build-and-deploy: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Checkout 🛎️ 11 | uses: actions/checkout@v2.3.1 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly. 12 | with: 13 | persist-credentials: false 14 | 15 | - name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built. 16 | run: | 17 | npm install 18 | npm run docs:build 19 | - name: Deploy 🚀 20 | uses: JamesIves/github-pages-deploy-action@3.6.2 21 | with: 22 | GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }} 23 | BRANCH: gh-pages # The branch the action should deploy to. 24 | FOLDER: docs/.vuepress/dist # The folder the action should deploy. 25 | CLEAN: true # Automatically remove deleted files from the deploy branch 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # packages 3 | .temp 4 | .cache 5 | .DS_Store 6 | ./**/.DS_Store 7 | node_modules 8 | /dist 9 | /deploy 10 | 11 | # test coverage 12 | coverage 13 | 14 | # local env files 15 | .env.local 16 | .env.*.local 17 | 18 | # Log files 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | pnpm-debug.log* 23 | 24 | # Editor directories and files 25 | .idea 26 | .vscode 27 | *.suo 28 | *.ntvs* 29 | *.njsproj 30 | *.sln 31 | *.sw? -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 120, 3 | "semi": false, 4 | "singleQuote": true, 5 | "trailingComma": "none", 6 | "jsxBracketSameLine": true, 7 | "arrowParens": "avoid", 8 | "insertPragma": false, 9 | "tabWidth": 4, 10 | "useTabs": false, 11 | "bracketSpacing": true 12 | } 13 | -------------------------------------------------------------------------------- /.stylelintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["stylelint-config-standard", "stylelint-config-recess-order"], 3 | "plugins": ["stylelint-order"], 4 | "rules": { 5 | "font-family-no-missing-generic-family-keyword": null 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Summer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # sum-ui 2 | 3 | vue3.0 UI 4 | 5 | 基于 Vue3.x + element-plus + Scss 封装的基础组件库 6 | 7 | 添加了 tailwindcss 支持 8 | ## install 9 | 10 | ```bash 11 | npm install 12 | # OR 13 | yarn install 14 | ``` 15 | 16 | ## dev 17 | 18 | ```bash 19 | npm run docs:dev 20 | # OR 21 | yarn docs:dev 22 | ``` 23 | 24 | ## build docs 25 | 26 | ```bash 27 | npm run docs:build 28 | # OR 29 | yarn docs:build 30 | ``` 31 | 32 | ## build components 33 | 34 | ```bash 35 | npm run build 36 | # OR 37 | yarn build 38 | ``` 39 | 40 | [组件库交互文档](https://leitingting08.github.io/sum-ui/) 41 | 42 | TODO: 43 | 44 | - [x] @sum-ui/layout 布局组件 45 | - [x] @sum-ui/table 表格组件 46 | - [ ] @sum-ui/upload 文件上传组件 47 | - [ ] @sum-ui/form 表单组件 48 | -------------------------------------------------------------------------------- /alias.js: -------------------------------------------------------------------------------- 1 | const { readdirSync } = require('fs') 2 | const { join } = require('path') 3 | const chalk = require('chalk') 4 | const headPkgList = [] // 非 @sum-ui/开头的组件 5 | 6 | const pkgList = readdirSync(join(__dirname, './packages')).filter( 7 | pkg => pkg.charAt(0) !== '.' && !headPkgList.includes(pkg) 8 | ) 9 | const alias = pkgList.reduce((pre, pkg) => { 10 | pre[`@sum-ui/${pkg}`] = join(__dirname, './packages', pkg, 'src/main.ts') 11 | return { 12 | ...pre 13 | } 14 | }, {}) 15 | 16 | console.log(`🌼 alias list \n${chalk.blue(Object.keys(alias).join('\n'))}`) 17 | 18 | module.exports = alias 19 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // ATTENTION!! 3 | // Preset ordering is reversed, so `@babel/typescript` will called first 4 | // Do not put `@babel/typescript` before `@babel/env`, otherwise will cause a compile error 5 | // See https://github.com/babel/babel/issues/12066 6 | presets: [ 7 | '@vue/cli-plugin-babel/preset', 8 | [ 9 | '@babel/typescript', 10 | { 11 | isTSX: true, 12 | allExtensions: true 13 | } 14 | ] 15 | ], 16 | plugins: ['@babel/transform-runtime'], 17 | env: { 18 | utils: { 19 | ignore: ['**/*.test.ts', '**/*.spec.ts'], 20 | presets: [ 21 | [ 22 | '@babel/env', 23 | { 24 | loose: true, 25 | modules: false 26 | } 27 | ] 28 | ] 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /components.d.ts: -------------------------------------------------------------------------------- 1 | // generated by unplugin-vue-components 2 | // We suggest you to commit this file into source control 3 | // Read more: https://github.com/vuejs/vue-next/pull/3399 4 | 5 | declare module 'vue' { 6 | export interface GlobalComponents { 7 | ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] 8 | ElPagination: typeof import('element-plus/es')['ElPagination'] 9 | ElTable: typeof import('element-plus/es')['ElTable'] 10 | ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] 11 | } 12 | } 13 | 14 | export { } 15 | -------------------------------------------------------------------------------- /docs/.vuepress/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leitingting08/sum-ui/2830dd3be4f3096eac054f72d472ea1ffdcf1802/docs/.vuepress/.DS_Store -------------------------------------------------------------------------------- /docs/.vuepress/client.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 全局注册组件 下文注释:重要、勿删,plop在自动新增组件的时候注入,不需要手动添加 3 | */ 4 | import { defineClientConfig } from '@vuepress/client' 5 | import 'element-plus/theme-chalk/src/index.scss' 6 | // -- APPSTART ITEMS HERE -- 7 | import SumTable from '@sum-ui/table' 8 | import SumLayout from '@sum-ui/layout' 9 | export default defineClientConfig({ 10 | enhance({ app, router, siteData }) { 11 | // -- APPEND ITEMS HERE -- 12 | app.component(SumTable.name, SumTable) 13 | app.component(SumLayout.name, SumLayout) 14 | }, 15 | setup() {}, 16 | rootComponents: [] 17 | }) 18 | -------------------------------------------------------------------------------- /docs/.vuepress/config.js: -------------------------------------------------------------------------------- 1 | const alias = require('../../alias') 2 | const { viteBundler } = require('@vuepress/bundler-vite') 3 | const { defaultTheme } = require('@vuepress/theme-default') 4 | const demoblockPlugin = require('vuepress-plugin-demoblock-plus') 5 | 6 | module.exports = { 7 | title: 'sum-ui', // 顶部左侧标题 8 | description: 'Vue3 + ElementPlus 组件库', 9 | base: '/sum-ui/', 10 | bundler: viteBundler({ 11 | viteOptions: { 12 | css: { 13 | postcss: { 14 | plugins: [require('tailwindcss'), require('autoprefixer')] 15 | } 16 | } 17 | } 18 | }), 19 | alias, 20 | head: [ 21 | // 设置 描述 和 关键词 22 | ['meta', { name: 'keywords', content: 'Vue3 UI 组件库' }], 23 | [ 24 | 'meta', 25 | { 26 | name: 'description', 27 | content: 28 | '此框架使用与二次开发,前端框架使用 Vue3,UI 框架使用 element-plus,全局数据状态管理使用 vuex,ajax 使用库为 axios。用于快速搭建中后台页面。' 29 | } 30 | ], 31 | // 添加百度统计 32 | [ 33 | 'script', 34 | {}, 35 | ` 36 | var _hmt = _hmt || []; 37 | (function() { 38 | var hm = document.createElement("script"); 39 | hm.src = "https://hm.baidu.com/hm.js?09606fe130f768bfb1c3be82fdf56339"; 40 | var s = document.getElementsByTagName("script")[0]; 41 | s.parentNode.insertBefore(hm, s); 42 | })(); 43 | ` 44 | ] 45 | ], 46 | theme: defaultTheme({ 47 | sidebar: { 48 | // 侧边栏 49 | '/': [ 50 | { 51 | text: '介绍', 52 | children: [ 53 | { text: '安装', link: '/guide/install' }, 54 | { text: '快速上手', link: '/guide/start' } 55 | ] 56 | }, 57 | { 58 | text: '组件', 59 | children: [ 60 | { text: 'Layout 布局', link: '/components/layout' }, 61 | { text: 'Table 表格', link: '/components/table' } 62 | ] 63 | } 64 | ] 65 | }, 66 | navbar: [ 67 | // 顶部右侧导航栏 68 | { text: '介绍', link: '/', activeMatch: '^/$|^/guide/' }, 69 | { 70 | text: '组件', 71 | link: '/components/layout.html', 72 | activeMatch: '^/$|^/components/' 73 | } 74 | ], 75 | // page meta 76 | editLinkText: '在 GitHub 上编辑此页', 77 | lastUpdatedText: '上次更新', 78 | contributorsText: '贡献者' 79 | }), 80 | plugins: [ 81 | demoblockPlugin({ 82 | customClass: 'demoblock-custom', 83 | theme: 'github-light', 84 | cssPreprocessor: 'scss', 85 | scriptReplaces: [ 86 | { 87 | searchValue: /const ({ defineComponent as _defineComponent }) = Vue/g, 88 | replaceValue: 'const { defineComponent: _defineComponent } = Vue' 89 | } 90 | ] 91 | }) 92 | ] 93 | } 94 | -------------------------------------------------------------------------------- /docs/.vuepress/dist/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | sum-ui 16 | 17 | 18 | 19 | 20 |

404

Looks like we've got some broken links.
Take me home
21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /docs/.vuepress/dist/assets/404.e222bc2a.js: -------------------------------------------------------------------------------- 1 | import{f as a,u as t,g as o,r as e,c as l,a as s,t as n,b as u,w as r,h as c,o as d,d as h}from"./app.67122b30.js";const m={class:"theme-container"},v={class:"theme-default-content"},f=s("h1",null,"404",-1);var i=a({setup(a){var i,p,b;const k=t(),g=o(),F=null!=(i=g.value.notFound)?i:["Not Found"],M=null!=(p=g.value.home)?p:k.value,j=null!=(b=g.value.backToHome)?b:"Back to home";return(a,t)=>{const o=e("RouterLink");return d(),l("div",m,[s("div",v,[f,s("blockquote",null,n(F[Math.floor(Math.random()*F.length)]),1),u(o,{to:c(M)},{default:r((()=>[h(n(c(j)),1)])),_:1},8,["to"])])])}}});export{i as default}; 2 | -------------------------------------------------------------------------------- /docs/.vuepress/dist/assets/404.html.4f8e6760.js: -------------------------------------------------------------------------------- 1 | const t={key:"v-3706649a",path:"/404.html",title:"",lang:"en-US",frontmatter:{layout:"404"},excerpt:"",headers:[],filePathRelative:null,git:{}};export{t as data}; 2 | -------------------------------------------------------------------------------- /docs/.vuepress/dist/assets/404.html.c3886853.js: -------------------------------------------------------------------------------- 1 | const n={};n.render=function(n,e){return null};export{n as default}; 2 | -------------------------------------------------------------------------------- /docs/.vuepress/dist/assets/Layout.e6bb4246.js: -------------------------------------------------------------------------------- 1 | var e=Object.defineProperty,t=Object.defineProperties,l=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,r=(t,l,a)=>l in t?e(t,l,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[l]=a,o=(e,t)=>{for(var l in t||(t={}))n.call(t,l)&&r(e,l,t[l]);if(a)for(var l of a(t))s.call(t,l)&&r(e,l,t[l]);return e},u=(e,a)=>t(e,l(a));"undefined"!=typeof require&&require;import{f as i,i as c,j as v,k as d,l as p,m as h,n as b,r as m,h as f,o as g,p as k,w as y,q as x,d as w,t as L,s as $,c as C,v as M,x as T,y as O,z as R,A as B,B as P,a as j,F as z,C as E,D,b as _,E as H,G as N,T as S,H as q,I as A,J as F,K as G,L as I,u as W,g as U,M as X,N as Y,O as V,e as J,P as K,Q,R as Z,S as ee,U as te,W as le,X as ae,Y as ne}from"./app.67122b30.js";const se=["href","rel","target","aria-label"],re=i({inheritAttrs:!1});var oe=i(u(o({},re),{props:{item:{type:Object,required:!0}},setup:function(e){const t=e,l=c(),a=T(),{item:n}=v(t),s=d((()=>p(n.value.link))),r=d((()=>h(n.value.link)||b(n.value.link))),o=d((()=>{if(!r.value)return n.value.target?n.value.target:s.value?"_blank":void 0})),u=d((()=>"_blank"===o.value)),i=d((()=>!s.value&&!r.value&&!u.value)),O=d((()=>{if(!r.value)return n.value.rel?n.value.rel:u.value?"noopener noreferrer":void 0})),R=d((()=>n.value.ariaLabel||n.value.text)),B=d((()=>{const e=Object.keys(a.value.locales);return e.length?!e.some((e=>e===n.value.link)):"/"!==n.value.link})),P=d((()=>!!B.value&&l.path.startsWith(n.value.link))),j=d((()=>!!i.value&&(n.value.activeMatch?new RegExp(n.value.activeMatch).test(l.path):P.value)));return(e,t)=>{const l=m("RouterLink"),a=m("OutboundLink");return f(i)?(g(),k(l,$({key:0,class:["nav-link",{"router-link-active":f(j)}],to:f(n).link,"aria-label":f(R)},e.$attrs),{default:y((()=>[x(e.$slots,"before"),w(" "+L(f(n).text)+" ",1),x(e.$slots,"after")])),_:3},16,["class","to","aria-label"])):(g(),C("a",$({key:1,class:"nav-link external",href:f(n).link,rel:f(O),target:f(o),"aria-label":f(R)},e.$attrs),[x(e.$slots,"before"),w(" "+L(f(n).text)+" ",1),f(u)?(g(),k(a,{key:0})):M("",!0),x(e.$slots,"after")],16,se))}}}));const ue=["aria-labelledby"],ie={class:"hero"},ce=["src","alt"],ve={key:1,id:"main-title"},de={key:2,class:"description"},pe={key:3,class:"actions"},he={key:0,class:"features"},be={class:"theme-default-content custom"},me=["innerHTML"],fe=["textContent"];var ge=i({setup(e){const t=O(),l=R(),a=d((()=>t.value.heroImage?B(t.value.heroImage):null)),n=d((()=>null===t.value.heroText?null:t.value.heroText||l.value.title||"Hello")),s=d((()=>t.value.heroAlt||n.value||"hero")),r=d((()=>null===t.value.tagline?null:t.value.tagline||l.value.description||"Welcome to your VuePress site")),o=d((()=>P(t.value.actions)?t.value.actions.map((({text:e,link:t,type:l="primary"})=>({text:e,link:t,type:l}))):[])),u=d((()=>P(t.value.features)?t.value.features:[])),i=d((()=>t.value.footer)),c=d((()=>t.value.footerHtml));return(e,t)=>{const l=m("Content");return g(),C("main",{class:"home","aria-labelledby":f(n)?"main-title":void 0},[j("header",ie,[f(a)?(g(),C("img",{key:0,src:f(a),alt:f(s)},null,8,ce)):M("",!0),f(n)?(g(),C("h1",ve,L(f(n)),1)):M("",!0),f(r)?(g(),C("p",de,L(f(r)),1)):M("",!0),f(o).length?(g(),C("p",pe,[(g(!0),C(z,null,E(f(o),(e=>(g(),k(oe,{key:e.text,class:D(["action-button",[e.type]]),item:e},null,8,["class","item"])))),128))])):M("",!0)]),f(u).length?(g(),C("div",he,[(g(!0),C(z,null,E(f(u),(e=>(g(),C("div",{key:e.title,class:"feature"},[j("h2",null,L(e.title),1),j("p",null,L(e.details),1)])))),128))])):M("",!0),j("div",be,[_(l)]),f(i)?(g(),C(z,{key:1},[f(c)?(g(),C("div",{key:0,class:"footer",innerHTML:f(i)},null,8,me)):(g(),C("div",{key:1,class:"footer",textContent:L(f(i))},null,8,fe))],64)):M("",!0)],8,ue)}}});const ke=e=>!p(e)||/github\.com/.test(e)?"GitHub":/bitbucket\.org/.test(e)?"Bitbucket":/gitlab\.com/.test(e)?"GitLab":/gitee\.com/.test(e)?"Gitee":null,ye={GitHub:":repo/edit/:branch/:path",GitLab:":repo/-/edit/:branch/:path",Gitee:":repo/edit/:branch/:path",Bitbucket:":repo/src/:branch/:path?mode=edit&spa=0&at=:branch&fileviewer=file-view-default"};var xe=i({setup(e){const t=e=>{e.style.height=e.scrollHeight+"px"},l=e=>{e.style.height=""};return(e,a)=>(g(),k(S,{name:"dropdown",onEnter:t,onAfterEnter:l,onBeforeLeave:t},{default:y((()=>[x(e.$slots,"default")])),_:3}))}});const we=["aria-label"],Le={class:"title"},$e=j("span",{class:"arrow down"},null,-1),Ce=["aria-label"],Me={class:"title"},Te={class:"nav-dropdown"},Oe={class:"dropdown-subtitle"},Re={key:1},Be={class:"dropdown-subitem-wrapper"};var Pe=i({props:{item:{type:Object,required:!0}},setup(e){const t=e,{item:l}=v(t),a=d((()=>l.value.ariaLabel||l.value.text)),n=q(!1),s=c();A((()=>s.path),(()=>{n.value=!1}));const r=e=>{const t=0===e.detail;n.value=!!t&&!n.value},o=(e,t)=>t[t.length-1]===e;return(e,t)=>(g(),C("div",{class:D(["dropdown-wrapper",{open:n.value}])},[j("button",{class:"dropdown-title",type:"button","aria-label":f(a),onClick:r},[j("span",Le,L(f(l).text),1),$e],8,we),j("button",{class:"mobile-dropdown-title",type:"button","aria-label":f(a),onClick:t[0]||(t[0]=e=>n.value=!n.value)},[j("span",Me,L(f(l).text),1),j("span",{class:D(["arrow",n.value?"down":"right"])},null,2)],8,Ce),_(xe,null,{default:y((()=>[F(j("ul",Te,[(g(!0),C(z,null,E(f(l).children,((e,t)=>(g(),C("li",{key:e.link||t,class:"dropdown-item"},[e.children?(g(),C(z,{key:0},[j("h4",Oe,[e.link?(g(),k(oe,{key:0,item:e,onFocusout:t=>o(e,f(l).children)&&0===e.children.length&&(n.value=!1)},null,8,["item","onFocusout"])):(g(),C("span",Re,L(e.text),1))]),j("ul",Be,[(g(!0),C(z,null,E(e.children,(t=>(g(),C("li",{key:t.link,class:"dropdown-subitem"},[_(oe,{item:t,onFocusout:a=>o(t,e.children)&&o(e,f(l).children)&&(n.value=!1)},null,8,["item","onFocusout"])])))),128))])],64)):(g(),k(oe,{key:1,item:e,onFocusout:t=>o(e,f(l).children)&&(n.value=!1)},null,8,["item","onFocusout"]))])))),128))],512),[[G,n.value]])])),_:1})],2))}});const je={key:0,class:"navbar-links"};var ze=i({setup(e){const t=e=>X(e)?Y(e):e.children?u(o({},e),{children:e.children.map(t)}):e,l=(()=>{const e=U();return d((()=>(e.value.navbar||[]).map(t)))})(),a=(()=>{const e=I(),t=W(),l=R(),a=U();return d((()=>{var n,s;const r=Object.keys(l.value.locales);if(r.length<2)return[];const o=e.currentRoute.value.path,u=e.currentRoute.value.fullPath;return[{text:null!=(n=a.value.selectLanguageText)?n:"unkown language",ariaLabel:null!=(s=a.value.selectLanguageAriaLabel)?s:"unkown language",children:r.map((n=>{var s,r,i,c,v,d;const p=null!=(r=null==(s=l.value.locales)?void 0:s[n])?r:{},h=null!=(c=null==(i=a.value.locales)?void 0:i[n])?c:{},b=`${p.lang}`,m=null!=(v=h.selectLanguageName)?v:b;let f;if(b===l.value.lang)f=u;else{const l=o.replace(t.value,n);f=e.getRoutes().some((e=>e.path===l))?l:null!=(d=h.home)?d:n}return{text:m,link:f}}))}]}))})(),n=(()=>{const e=U(),t=d((()=>e.value.repo)),l=d((()=>t.value?ke(t.value):null)),a=d((()=>t.value&&!p(t.value)?`https://github.com/${t.value}`:t.value)),n=d((()=>a.value?e.value.repoLabel?e.value.repoLabel:null===l.value?"Source":l.value:null));return d((()=>a.value&&n.value?[{text:n.value,link:a.value}]:[]))})(),s=d((()=>[...l.value,...a.value,...n.value]));return(e,t)=>f(s).length?(g(),C("nav",je,[(g(!0),C(z,null,E(f(s),(e=>(g(),C("div",{key:e.text,class:"navbar-links-item"},[e.children?(g(),k(Pe,{key:0,item:e},null,8,["item"])):(g(),k(oe,{key:1,item:e},null,8,["item"]))])))),128))])):M("",!0)}});const Ee=["title"],De={class:"icon",focusable:"false",viewBox:"0 0 32 32"},_e=[J('',9)],He={class:"icon",focusable:"false",viewBox:"0 0 32 32"},Ne=[j("path",{d:"M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z",fill:"currentColor"},null,-1)];var Se=i({setup(e){const t=U(),l=V(),a=()=>{l.value=!l.value};return(e,n)=>(g(),C("button",{class:"toggle-dark-button",title:f(t).toggleDarkMode,onClick:a},[F((g(),C("svg",De,_e,512)),[[G,!f(l)]]),F((g(),C("svg",He,Ne,512)),[[G,f(l)]])],8,Ee))}});const qe=["title"],Ae=[j("div",{class:"icon","aria-hidden":"true"},[j("span"),j("span"),j("span")],-1)];var Fe=i({emits:["toggle"],setup(e){const t=U();return(e,l)=>(g(),C("div",{class:"toggle-sidebar-button",title:f(t).toggleSidebar,"aria-expanded":"false",role:"button",tabindex:"0",onClick:l[0]||(l[0]=t=>e.$emit("toggle"))},Ae,8,qe))}});const Ge=["src","alt"];var Ie=i({emits:["toggle-sidebar"],setup(e){const t=W(),l=R(),a=U(),n=V(),s=q(null),r=q(null),o=d((()=>a.value.home||t.value)),u=d((()=>n.value&&void 0!==a.value.logoDark?a.value.logoDark:a.value.logo)),i=d((()=>l.value.title)),c=q(0),v=d((()=>c.value?{maxWidth:c.value+"px"}:{})),p=d((()=>a.value.darkMode));function h(e,t){var l,a,n;const s=null==(n=null==(a=null==(l=null==e?void 0:e.ownerDocument)?void 0:l.defaultView)?void 0:a.getComputedStyle(e,null))?void 0:n[t],r=Number.parseInt(s,10);return Number.isNaN(r)?0:r}return K((()=>{const e=h(s.value,"paddingLeft")+h(s.value,"paddingRight"),t=()=>{var t;window.innerWidth<=719?c.value=0:c.value=s.value.offsetWidth-e-((null==(t=r.value)?void 0:t.offsetWidth)||0)};t(),window.addEventListener("resize",t,!1),window.addEventListener("orientationchange",t,!1)})),(e,t)=>{const l=m("RouterLink"),a=m("NavbarSearch");return g(),C("header",{ref:(e,t)=>{t.navbar=e,s.value=e},class:"navbar"},[_(Fe,{onToggle:t[0]||(t[0]=t=>e.$emit("toggle-sidebar"))}),j("span",{ref:(e,t)=>{t.siteBrand=e,r.value=e}},[_(l,{to:f(o)},{default:y((()=>[f(u)?(g(),C("img",{key:0,class:"logo",src:f(B)(f(u)),alt:f(i)},null,8,Ge)):M("",!0),f(i)?(g(),C("span",{key:1,class:D(["site-name",{"can-hide":f(u)}])},L(f(i)),3)):M("",!0)])),_:1},8,["to"])],512),j("div",{class:"navbar-links-wrapper",style:Q(f(v))},[x(e.$slots,"before"),_(ze,{class:"can-hide"}),x(e.$slots,"after"),f(p)?(g(),k(Se,{key:0})):M("",!0),_(a)],4)],512)}}});const We={class:"page-meta"},Ue={key:0,class:"meta-item edit-link"},Xe={key:1,class:"meta-item last-updated"},Ye={class:"meta-item-label"},Ve={class:"meta-item-info"},Je={key:2,class:"meta-item contributors"},Ke={class:"meta-item-label"},Qe={class:"meta-item-info"},Ze=["title"],et=w(", ");var tt=i({setup(e){const t=U(),l=(()=>{const e=U(),t=Z(),l=O();return d((()=>{var a,n;if(!(null==(n=null!=(a=l.value.editLink)?a:e.value.editLink)||n))return null;const{repo:s,docsRepo:r=s,docsBranch:o="main",docsDir:u="",editLinkText:i}=e.value;if(!r)return null;const c=(({docsRepo:e,docsBranch:t,docsDir:l,filePathRelative:a,editLinkPattern:n})=>{const s=ke(e);let r;return n?r=n:null!==s&&(r=ye[s]),r?r.replace(/:repo/,p(e)?e:`https://github.com/${e}`).replace(/:branch/,t).replace(/:path/,H(`${N(l)}/${a}`)):null})({docsRepo:r,docsBranch:o,docsDir:u,filePathRelative:t.value.filePathRelative,editLinkPattern:e.value.editLinkPattern});return c?{text:null!=i?i:"Edit this page",link:c}:null}))})(),a=(()=>{const e=R(),t=U(),l=Z(),a=O();return d((()=>{var n,s,r,o;if(!(null==(s=null!=(n=a.value.lastUpdated)?n:t.value.lastUpdated)||s))return null;if(!(null==(r=l.value.git)?void 0:r.updatedTime))return null;return new Date(null==(o=l.value.git)?void 0:o.updatedTime).toLocaleString(e.value.lang)}))})(),n=(()=>{const e=U(),t=Z(),l=O();return d((()=>{var a,n,s,r;return(null==(n=null!=(a=l.value.contributors)?a:e.value.contributors)||n)&&null!=(r=null==(s=t.value.git)?void 0:s.contributors)?r:null}))})();return(e,s)=>(g(),C("footer",We,[f(l)?(g(),C("div",Ue,[_(oe,{class:"meta-item-label",item:f(l)},null,8,["item"])])):M("",!0),f(a)?(g(),C("div",Xe,[j("span",Ye,L(f(t).lastUpdatedText)+": ",1),j("span",Ve,L(f(a)),1)])):M("",!0),f(n)&&f(n).length?(g(),C("div",Je,[j("span",Ke,L(f(t).contributorsText)+": ",1),j("span",Qe,[(g(!0),C(z,null,E(f(n),((e,t)=>(g(),C(z,{key:t},[j("span",{class:"contributor",title:`email: ${e.email}`},L(e.name),9,Ze),t!==f(n).length-1?(g(),C(z,{key:0},[et],64)):M("",!0)],64)))),128))])])):M("",!0)]))}});const lt={key:0,class:"page-nav"},at={class:"inner"},nt={key:0,class:"prev"},st=w(" ← "),rt={key:1,class:"next"},ot=w(" → ");var ut=i({setup(e){const t=e=>!1===e?null:X(e)?Y(e):!!te(e)&&e,l=(e,t,a)=>{const n=e.findIndex((e=>e.link===t));if(-1!==n){const t=e[n+a];return(null==t?void 0:t.link)?t:null}for(const s of e)if(s.children){const e=l(s.children,t,a);if(e)return e}return null},a=O(),n=ee(),s=c(),r=d((()=>{const e=t(a.value.prev);return!1!==e?e:l(n.value,s.path,-1)})),o=d((()=>{const e=t(a.value.next);return!1!==e?e:l(n.value,s.path,1)}));return(e,t)=>f(r)||f(o)?(g(),C("nav",lt,[j("p",at,[f(r)?(g(),C("span",nt,[st,_(oe,{item:f(r)},null,8,["item"])])):M("",!0),f(o)?(g(),C("span",rt,[_(oe,{item:f(o)},null,8,["item"]),ot])):M("",!0)])])):M("",!0)}});const it={class:"page"},ct={class:"theme-default-content"};var vt=i({setup:e=>(e,t)=>{const l=m("Content");return g(),C("main",it,[x(e.$slots,"top"),j("div",ct,[_(l)]),_(tt),_(ut),x(e.$slots,"bottom")])}});const dt=e=>decodeURI(e).replace(/#.*$/,"").replace(/(index)?\.(md|html)$/,""),pt=(e,t)=>!!((e,t)=>void 0!==t&&(e.hash===t||dt(e.path)===dt(t)))(e,t.link)||!!t.children&&t.children.some((t=>pt(e,t))),ht=(e,t)=>e.link?le(oe,u(o({},t),{item:e})):le("p",t,e.text),bt=(e,t)=>{var l;return(null===(l=e.children)||void 0===l?void 0:l.length)?le("ul",{class:{"sidebar-sub-items":t>0}},e.children.map((e=>le("li",le(mt,{item:e,depth:t+1}))))):null},mt=({item:e,depth:t=0})=>{const l=c(),a=pt(l,e);return[ht(e,{class:{"sidebar-heading":0===t,"sidebar-item":!0,active:a}}),bt(e,t)]};mt.displayName="SidebarChild",mt.props={item:{type:Object,required:!0},depth:{type:Number,required:!1}};const ft={class:"sidebar"},gt={class:"sidebar-links"};var kt=i({setup(e){const t=ee();return(e,l)=>(g(),C("aside",ft,[_(ze),x(e.$slots,"top"),j("ul",gt,[(g(!0),C(z,null,E(f(t),(e=>(g(),k(f(mt),{key:e.link||e.text,item:e},null,8,["item"])))),128))]),x(e.$slots,"bottom")]))}}),yt=i({setup(e){const t=Z(),l=O(),a=U(),n=d((()=>!1!==l.value.navbar&&!1!==a.value.navbar)),s=ee(),r=q(!1),o=e=>{r.value="boolean"==typeof e?e:!r.value},u={x:0,y:0},i=e=>{u.x=e.changedTouches[0].clientX,u.y=e.changedTouches[0].clientY},c=e=>{const t=e.changedTouches[0].clientX-u.x,l=e.changedTouches[0].clientY-u.y;Math.abs(t)>Math.abs(l)&&Math.abs(t)>40&&(t>0&&u.x<=80?o(!0):o(!1))},v=d((()=>[{"no-navbar":!n.value,"no-sidebar":!s.value.length,"sidebar-open":r.value},l.value.pageClass]));let p;K((()=>{const e=I();p=e.afterEach((()=>{o(!1)}))})),ae((()=>{p()}));const h=ne(),b=h.resolve,m=h.pending;return(e,a)=>(g(),C("div",{class:D(["theme-container",f(v)]),onTouchstart:i,onTouchend:c},[x(e.$slots,"navbar",{},(()=>[f(n)?(g(),k(Ie,{key:0,onToggleSidebar:o},{before:y((()=>[x(e.$slots,"navbar-before")])),after:y((()=>[x(e.$slots,"navbar-after")])),_:3})):M("",!0)])),j("div",{class:"sidebar-mask",onClick:a[0]||(a[0]=e=>o(!1))}),x(e.$slots,"sidebar",{},(()=>[_(kt,null,{top:y((()=>[x(e.$slots,"sidebar-top")])),bottom:y((()=>[x(e.$slots,"sidebar-bottom")])),_:3})])),x(e.$slots,"page",{},(()=>[f(l).home?(g(),k(ge,{key:0})):(g(),k(S,{key:1,name:"fade-slide-y",mode:"out-in",onBeforeEnter:f(b),onBeforeLeave:f(m)},{default:y((()=>[_(vt,{key:f(t).path},{top:y((()=>[x(e.$slots,"page-top")])),bottom:y((()=>[x(e.$slots,"page-bottom")])),_:3})])),_:3},8,["onBeforeEnter","onBeforeLeave"]))]))],34))}});export{yt as default}; 2 | -------------------------------------------------------------------------------- /docs/.vuepress/dist/assets/back-to-top.8efcbe56.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/.vuepress/dist/assets/element-icons.9c88a535.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leitingting08/sum-ui/2830dd3be4f3096eac054f72d472ea1ffdcf1802/docs/.vuepress/dist/assets/element-icons.9c88a535.woff -------------------------------------------------------------------------------- /docs/.vuepress/dist/assets/element-icons.de5eb258.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leitingting08/sum-ui/2830dd3be4f3096eac054f72d472ea1ffdcf1802/docs/.vuepress/dist/assets/element-icons.de5eb258.ttf -------------------------------------------------------------------------------- /docs/.vuepress/dist/assets/iconfont.5b2375f1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | Created by iconfont 9 | 10 | 11 | 12 | 13 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /docs/.vuepress/dist/assets/index.html.1089cbd5.js: -------------------------------------------------------------------------------- 1 | import{r as l,o as e,c as t,a,b as s,F as r,d as u}from"./app.67122b30.js";const n={},m=a("h2",{id:"组件看板",tabindex:"-1"},[a("a",{class:"header-anchor",href:"#组件看板","aria-hidden":"true"},"#"),u(" 组件看板")],-1),o=a("thead",null,[a("tr",null,[a("th",null,"组件"),a("th",null,"下载量"),a("th",null,"版本")])],-1),p=a("td",null,"@sum-ui/layout",-1),i={href:"https://www.npmjs.com/package/@sum-ui/layout",target:"_blank",rel:"noopener noreferrer"},g=a("img",{src:"https://img.shields.io/npm/dw/@sum-ui/layout.svg",alt:"layout"},null,-1),d={href:"https://www.npmjs.com/package/@sum-ui/layout",target:"_blank",rel:"noopener noreferrer"},h=a("img",{src:"https://img.shields.io/npm/v/@sum-ui/layout.svg?style=flat-square?style=flat-square",alt:"npm package"},null,-1),c=a("td",null,"@sum-ui/table",-1),f={href:"https://www.npmjs.com/package/@sum-ui/table",target:"_blank",rel:"noopener noreferrer"},w=a("img",{src:"https://img.shields.io/npm/dw/@sum-ui/table.svg",alt:"table"},null,-1),k={href:"https://www.npmjs.com/package/@sum-ui/table",target:"_blank",rel:"noopener noreferrer"},b=a("img",{src:"https://img.shields.io/npm/v/@sum-ui/table.svg?style=flat-square?style=flat-square",alt:"npm package"},null,-1),y=a("td",null,"@sum-ui/upload",-1),v={href:"https://www.npmjs.com/package/@sum-ui/upload",target:"_blank",rel:"noopener noreferrer"},j=a("img",{src:"https://img.shields.io/npm/dw/@sum-ui/upload.svg",alt:"upload"},null,-1),q={href:"https://www.npmjs.com/package/@sum-ui/upload",target:"_blank",rel:"noopener noreferrer"},_=a("img",{src:"https://img.shields.io/npm/v/@sum-ui/upload.svg?style=flat-square?style=flat-square",alt:"npm package"},null,-1),x=a("td",null,"@sum-ui/form",-1),F={href:"https://www.npmjs.com/package/@sum-ui/form",target:"_blank",rel:"noopener noreferrer"},L=a("img",{src:"https://img.shields.io/npm/dw/@sum-ui/form.svg",alt:"form"},null,-1),O={href:"https://www.npmjs.com/package/@sum-ui/form",target:"_blank",rel:"noopener noreferrer"},z=a("img",{src:"https://img.shields.io/npm/v/@sum-ui/layout.svg?style=flat-square?style=flat-square",alt:"npm package"},null,-1);n.render=function(u,n){const A=l("OutboundLink");return e(),t(r,null,[m,a("table",null,[o,a("tbody",null,[a("tr",null,[p,a("td",null,[a("a",i,[g,s(A)])]),a("td",null,[a("a",d,[h,s(A)])])]),a("tr",null,[c,a("td",null,[a("a",f,[w,s(A)])]),a("td",null,[a("a",k,[b,s(A)])])]),a("tr",null,[y,a("td",null,[a("a",v,[j,s(A)])]),a("td",null,[a("a",q,[_,s(A)])])]),a("tr",null,[x,a("td",null,[a("a",F,[L,s(A)])]),a("td",null,[a("a",O,[z,s(A)])])])])])],64)};export{n as default}; 2 | -------------------------------------------------------------------------------- /docs/.vuepress/dist/assets/index.html.ae40c818.js: -------------------------------------------------------------------------------- 1 | const e={key:"v-8daa1a0e",path:"/",title:"",lang:"en-US",frontmatter:{home:!0,actions:[{text:"Get Started",link:"/guide/install.html",type:"primary"},{text:"Components",link:"/components/layout.html",type:"secondary"}],features:[{title:"💡 Instant Server Start",details:"On demand file serving over native ESM, no bundling required!"},{title:"⚡️ Lightning Fast HMR",details:"Hot Module Replacement (HMR) that stays fast regardless of app size."},{title:"🛠️ Rich Features",details:"Out-of-the-box support for TypeScript, JSX, CSS and more."},{title:"📦 Optimized Build",details:"Pre-configured Rollup build with multi-page and library mode support."},{title:"🔩 Universal Plugins",details:"Rollup-superset plugin interface shared between dev and build."},{title:"🔑 Fully Typed APIs",details:"Flexible programmatic APIs with full TypeScript typing."}],footer:"MIT Licensed | Copyright © 2021-present Summer"},excerpt:"",headers:[{level:2,title:"组件看板",slug:"组件看板",children:[]}],filePathRelative:"index.md",git:{updatedTime:1630573967e3,contributors:[{name:"ltt",email:"leitingting08@gmail.com",commits:2}]}};export{e as data}; 2 | -------------------------------------------------------------------------------- /docs/.vuepress/dist/assets/install.html.6986468a.js: -------------------------------------------------------------------------------- 1 | const e={key:"v-e45cc9ec",path:"/guide/install.html",title:"安装",lang:"en-US",frontmatter:{title:"安装"},excerpt:"",headers:[{level:2,title:"sum-ui 简介",slug:"sum-ui-简介",children:[]},{level:2,title:"@sum-ui/layout",slug:"sum-ui-layout",children:[]},{level:2,title:"@sum-ui/table",slug:"sum-ui-table",children:[]}],filePathRelative:"guide/install.md",git:{updatedTime:1630573967e3,contributors:[{name:"ltt",email:"leitingting08@gmail.com",commits:2}]}};export{e as data}; 2 | -------------------------------------------------------------------------------- /docs/.vuepress/dist/assets/install.html.e44d4a3a.js: -------------------------------------------------------------------------------- 1 | import{e as s}from"./app.67122b30.js";const a={},n=s('

sum-ui 简介

sum-ui 是基于 Vue3 + ElementPlus 二次开发的组合组件库集合,包含通用场景,如 layout 布局,table 表格等等

@sum-ui/layout

npm i @sum-ui/layout\n# or\nyarn add @sum-ui/layout\n
1
2
3

@sum-ui/table

npm i @sum-ui/table\n# or\nyarn add @sum-ui/table\n
1
2
3
',6);a.render=function(s,a){return n};export{a as default}; 2 | -------------------------------------------------------------------------------- /docs/.vuepress/dist/assets/layout.html.1dce1f5f.js: -------------------------------------------------------------------------------- 1 | var s=Object.defineProperty,t=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,e=(t,l,n)=>l in t?s(t,l,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[l]=n,o=(s,o)=>{for(var a in o||(o={}))l.call(o,a)&&e(s,a,o[a]);if(t)for(var a of t(o))n.call(o,a)&&e(s,a,o[a]);return s};"undefined"!=typeof require&&require;import{V as a,r,o as c,c as p,b as y,w as i,F as d,a as L,d as M,e as E}from"./app.67122b30.js";var u={name:"component-doc",components:{"render-demo-0":function(){const{createElementVNode:s,resolveComponent:t,withCtx:l,openBlock:n,createBlock:e}=a,r=s("div",{class:"title"},[s("img",{style:{height:"50px","margin-right":"10px"},src:"data:image/svg+xml;base64,PHN2ZyBpZD0i5Zu+5bGCXzEiIGRhdGEtbmFtZT0i5Zu+5bGCIDEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDQ0IDQ0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzQwOWVmZjtmaWxsLXJ1bGU6ZXZlbm9kZDt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPmVsZW1lbnQgcGx1cy1sb2dvLXNtYWxsIOWJr+acrDwvdGl0bGU+PHBhdGggaWQ9ImVsZW1lbnRfcGx1cy1sb2dvLXNtYWxsIiBkYXRhLW5hbWU9ImVsZW1lbnQgcGx1cy1sb2dvLXNtYWxsIiBjbGFzcz0iY2xzLTEiIGQ9Ik0zNy40MSwzMi4zN2MwLDEuNTctLjgzLDEuOTMtLjgzLDEuOTNMMjEuNTEsNDNBMS42OSwxLjY5LDAsMCwxLDIwLDQzUzUuMiwzNC40LDQuNjYsMzRhMS4yOSwxLjI5LDAsMCwxLS41NS0xVjE1LjI0YzAtLjc4LDEtMS4zMywxLTEuMzNMMTkuODYsNS4zNmEyLDIsMCwwLDEsMS43OSwwbDE0LjQ2LDguNDFhMi4wNiwyLjA2LDAsMCwxLDEuMjUsMi4wNlYzMi4zN1ptLTUuOS0xN0wyMS4zNSw5LjVhMS41OSwxLjU5LDAsMCwwLTEuNDEsMEw4LjMzLDE2LjE1cy0uNzcuNDYtLjc2LDEuMDgsMCwxMy45MiwwLDEzLjkyQTEsMSwwLDAsMCw4LDMxLjljLjQzLjMsMTIsNywxMiw3YTEuMzEsMS4zMSwwLDAsMCwxLjE5LDBDMjEuOTEsMzguNSwzMywzMi4xMSwzMywzMi4xMXMuNjUtLjI4LjY1LTEuNTFWMjcuMTNsLTEzLDcuOVYzMmEzLjA1LDMuMDUsMCwwLDEsMS0yLjA3TDMzLjIsMjNhMi40NCwyLjQ0LDAsMCwwLC41NS0xLjQ2VjE4LjQzTDIwLjY0LDI2LjM1di0zLjJhMi4yMiwyLjIyLDAsMCwxLC44My0xLjc5Wk00MS4wNyw0LjIyYS4zOS4zOSwwLDAsMC0uMzctLjQySDM4VjEuMDZjMC0uMTYtLjI2LS4yMi0uNTMtLjIyTDM2LDEuMDhjLS4xOCwwLS4zMS4xMi0uMzEuMjNWMy44SDMzYS40LjQsMCwwLDAtLjM2LjM3djJoM1Y5YzAsLjE2LjI2LjI3LjU0LjIzbDEuNTEtLjI1Yy4xOCwwLC4yOS0uMTMuMjktLjIzVjYuMTRoM1oiLz48L3N2Zz4="}),s("div",null,"测试标题")],-1),c=s("div",null,"admin",-1),p=s("div",null,"container",-1);const{defineComponent:y,reactive:i,toRefs:d}=a,L=y({setup(){const s=i({headerTitle:{slot:"title"},headerRight:{slot:"right"},menuData:[{title:"菜单列表",icon:"el-icon-s-goods",auth:"menu",path:"/menu",children:[{title:"数据",auth:"menu/data"},{title:"分析",auth:"menu/analysis"}]}],headerStyles:{backgroundColor:"#545c64",padding:"10px",color:"#fff"},menuProps:{backgroundColor:"#f7f6f2",textColor:"#333",activeTextColor:"#409eff",defaultActive:"0-0",defaultOpeneds:[0]},triggerCollapse:!0,footer:"@copyRight by footer"});return o({settings:s},d(s))}});return o({render:function(s,o){const a=t("sum-layout");return n(),e(a,{settings:s.settings,class:"sum-layout"},{title:l((()=>[r])),right:l((()=>[c])),default:l((()=>[p])),_:1},8,["settings"])}},L)}()}};const j=L("h3",{id:"sum-ui-layout",tabindex:"-1"},[L("a",{class:"header-anchor",href:"#sum-ui-layout","aria-hidden":"true"},"#"),M(" @sum-ui/layout")],-1),D=L("div",{class:"language-vue"},[L("pre",{class:"shiki",style:{"background-color":"#ffffff"}},[L("code",null,[L("span",{class:"line"},[L("span",{style:{color:"#24292E"}},"<"),L("span",{style:{color:"#22863A"}},"template"),L("span",{style:{color:"#24292E"}},">")]),M("\n"),L("span",{class:"line"},[L("span",{style:{color:"#24292E"}}," <"),L("span",{style:{color:"#22863A"}},"sum-layout"),L("span",{style:{color:"#24292E"}}," :"),L("span",{style:{color:"#005CC5"}},"settings"),L("span",{style:{color:"#24292E"}},"="),L("span",{style:{color:"#032F62"}},'"'),L("span",{style:{color:"#24292E"}},"settings"),L("span",{style:{color:"#032F62"}},'"'),L("span",{style:{color:"#24292E"}}," "),L("span",{style:{color:"#005CC5"}},"class"),L("span",{style:{color:"#24292E"}},"="),L("span",{style:{color:"#032F62"}},'"sum-layout"'),L("span",{style:{color:"#24292E"}},">")]),M("\n"),L("span",{class:"line"},[L("span",{style:{color:"#24292E"}}," <"),L("span",{style:{color:"#22863A"}},"template"),L("span",{style:{color:"#24292E"}}," #"),L("span",{style:{color:"#005CC5"}},"title"),L("span",{style:{color:"#24292E"}},">")]),M("\n"),L("span",{class:"line"},[L("span",{style:{color:"#24292E"}}," <"),L("span",{style:{color:"#22863A"}},"div"),L("span",{style:{color:"#24292E"}}," "),L("span",{style:{color:"#005CC5"}},"class"),L("span",{style:{color:"#24292E"}},"="),L("span",{style:{color:"#032F62"}},'"title"'),L("span",{style:{color:"#24292E"}},">")]),M("\n"),L("span",{class:"line"},[L("span",{style:{color:"#24292E"}}," <"),L("span",{style:{color:"#22863A"}},"img"),L("span",{style:{color:"#24292E"}}," "),L("span",{style:{color:"#005CC5"}},"style"),L("span",{style:{color:"#24292E"}},"="),L("span",{style:{color:"#032F62"}},'"height: 50px;margin-right: 10px;"'),L("span",{style:{color:"#24292E"}}," "),L("span",{style:{color:"#005CC5"}},"src"),L("span",{style:{color:"#24292E"}},"="),L("span",{style:{color:"#032F62"}},'"data:image/svg+xml;base64,PHN2ZyBpZD0i5Zu+5bGCXzEiIGRhdGEtbmFtZT0i5Zu+5bGCIDEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDQ0IDQ0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzQwOWVmZjtmaWxsLXJ1bGU6ZXZlbm9kZDt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPmVsZW1lbnQgcGx1cy1sb2dvLXNtYWxsIOWJr+acrDwvdGl0bGU+PHBhdGggaWQ9ImVsZW1lbnRfcGx1cy1sb2dvLXNtYWxsIiBkYXRhLW5hbWU9ImVsZW1lbnQgcGx1cy1sb2dvLXNtYWxsIiBjbGFzcz0iY2xzLTEiIGQ9Ik0zNy40MSwzMi4zN2MwLDEuNTctLjgzLDEuOTMtLjgzLDEuOTNMMjEuNTEsNDNBMS42OSwxLjY5LDAsMCwxLDIwLDQzUzUuMiwzNC40LDQuNjYsMzRhMS4yOSwxLjI5LDAsMCwxLS41NS0xVjE1LjI0YzAtLjc4LDEtMS4zMywxLTEuMzNMMTkuODYsNS4zNmEyLDIsMCwwLDEsMS43OSwwbDE0LjQ2LDguNDFhMi4wNiwyLjA2LDAsMCwxLDEuMjUsMi4wNlYzMi4zN1ptLTUuOS0xN0wyMS4zNSw5LjVhMS41OSwxLjU5LDAsMCwwLTEuNDEsMEw4LjMzLDE2LjE1cy0uNzcuNDYtLjc2LDEuMDgsMCwxMy45MiwwLDEzLjkyQTEsMSwwLDAsMCw4LDMxLjljLjQzLjMsMTIsNywxMiw3YTEuMzEsMS4zMSwwLDAsMCwxLjE5LDBDMjEuOTEsMzguNSwzMywzMi4xMSwzMywzMi4xMXMuNjUtLjI4LjY1LTEuNTFWMjcuMTNsLTEzLDcuOVYzMmEzLjA1LDMuMDUsMCwwLDEsMS0yLjA3TDMzLjIsMjNhMi40NCwyLjQ0LDAsMCwwLC41NS0xLjQ2VjE4LjQzTDIwLjY0LDI2LjM1di0zLjJhMi4yMiwyLjIyLDAsMCwxLC44My0xLjc5Wk00MS4wNyw0LjIyYS4zOS4zOSwwLDAsMC0uMzctLjQySDM4VjEuMDZjMC0uMTYtLjI2LS4yMi0uNTMtLjIyTDM2LDEuMDhjLS4xOCwwLS4zMS4xMi0uMzEuMjNWMy44SDMzYS40LjQsMCwwLDAtLjM2LjM3djJoM1Y5YzAsLjE2LjI2LjI3LjU0LjIzbDEuNTEtLjI1Yy4xOCwwLC4yOS0uMTMuMjktLjIzVjYuMTRoM1oiLz48L3N2Zz4="'),L("span",{style:{color:"#24292E"}},">")]),M("\n"),L("span",{class:"line"},[L("span",{style:{color:"#24292E"}}," <"),L("span",{style:{color:"#22863A"}},"div"),L("span",{style:{color:"#24292E"}},">测试标题")]),M("\n"),L("span",{class:"line"},[L("span",{style:{color:"#24292E"}}," ")]),M("\n"),L("span",{class:"line"},[L("span",{style:{color:"#24292E"}}," ")]),M("\n"),L("span",{class:"line"},[L("span",{style:{color:"#24292E"}}," <"),L("span",{style:{color:"#22863A"}},"template"),L("span",{style:{color:"#24292E"}}," #"),L("span",{style:{color:"#005CC5"}},"right"),L("span",{style:{color:"#24292E"}},">")]),M("\n"),L("span",{class:"line"},[L("span",{style:{color:"#24292E"}}," <"),L("span",{style:{color:"#22863A"}},"div"),L("span",{style:{color:"#24292E"}},">admin")]),M("\n"),L("span",{class:"line"},[L("span",{style:{color:"#24292E"}}," ")]),M("\n"),L("span",{class:"line"},[L("span",{style:{color:"#24292E"}}," <"),L("span",{style:{color:"#22863A"}},"template"),L("span",{style:{color:"#24292E"}}," #"),L("span",{style:{color:"#005CC5"}},"default"),L("span",{style:{color:"#24292E"}},">")]),M("\n"),L("span",{class:"line"},[L("span",{style:{color:"#24292E"}}," <"),L("span",{style:{color:"#22863A"}},"div"),L("span",{style:{color:"#24292E"}},">container")]),M("\n"),L("span",{class:"line"},[L("span",{style:{color:"#24292E"}}," ")]),M("\n"),L("span",{class:"line"},[L("span",{style:{color:"#24292E"}}," ")]),M("\n"),L("span",{class:"line"},[L("span",{style:{color:"#24292E"}},"")]),M("\n"),L("span",{class:"line"}),M("\n"),L("span",{class:"line"},[L("span",{style:{color:"#24292E"}},"<"),L("span",{style:{color:"#22863A"}},"script"),L("span",{style:{color:"#24292E"}}," "),L("span",{style:{color:"#005CC5"}},"lang"),L("span",{style:{color:"#24292E"}},"="),L("span",{style:{color:"#032F62"}},'"ts"'),L("span",{style:{color:"#24292E"}},">")]),M("\n"),L("span",{class:"line"},[L("span",{style:{color:"#D73A49"}},"import"),L("span",{style:{color:"#24292E"}}," { defineComponent, reactive, toRefs } "),L("span",{style:{color:"#D73A49"}},"from"),L("span",{style:{color:"#24292E"}}," "),L("span",{style:{color:"#032F62"}},"'vue'")]),M("\n"),L("span",{class:"line"}),M("\n"),L("span",{class:"line"},[L("span",{style:{color:"#D73A49"}},"export"),L("span",{style:{color:"#E36209"}}," "),L("span",{style:{color:"#D73A49"}},"default"),L("span",{style:{color:"#E36209"}}," "),L("span",{style:{color:"#6F42C1"}},"defineComponent"),L("span",{style:{color:"#E36209"}},"({")]),M("\n"),L("span",{class:"line"},[L("span",{style:{color:"#E36209"}}," "),L("span",{style:{color:"#6F42C1"}},"setup"),L("span",{style:{color:"#E36209"}},"() "),L("span",{style:{color:"#24292E"}},"{")]),M("\n"),L("span",{class:"line"},[L("span",{style:{color:"#24292E"}}," "),L("span",{style:{color:"#D73A49"}},"const"),L("span",{style:{color:"#24292E"}}," "),L("span",{style:{color:"#005CC5"}},"settings"),L("span",{style:{color:"#24292E"}}," "),L("span",{style:{color:"#D73A49"}},"="),L("span",{style:{color:"#24292E"}}," "),L("span",{style:{color:"#6F42C1"}},"reactive"),L("span",{style:{color:"#24292E"}},"({")]),M("\n"),L("span",{class:"line"},[L("span",{style:{color:"#24292E"}}," "),L("span",{style:{color:"#6A737D"}},'// 可以用slot插槽或者render渲染函数两种方式,当使用render的时候需要改成 Layout | sum-ui 16 | 17 | 18 | 19 | 20 |

@sum-ui/layout

测试标题
admin
container
@copyRight by footer
<template>
 21 |   <sum-layout :settings="settings" class="sum-layout">
 22 |      <template #title>
 23 |        <div class="title">
 24 |         <img style="height: 50px;margin-right: 10px;" src="data:image/svg+xml;base64,PHN2ZyBpZD0i5Zu+5bGCXzEiIGRhdGEtbmFtZT0i5Zu+5bGCIDEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDQ0IDQ0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzQwOWVmZjtmaWxsLXJ1bGU6ZXZlbm9kZDt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPmVsZW1lbnQgcGx1cy1sb2dvLXNtYWxsIOWJr+acrDwvdGl0bGU+PHBhdGggaWQ9ImVsZW1lbnRfcGx1cy1sb2dvLXNtYWxsIiBkYXRhLW5hbWU9ImVsZW1lbnQgcGx1cy1sb2dvLXNtYWxsIiBjbGFzcz0iY2xzLTEiIGQ9Ik0zNy40MSwzMi4zN2MwLDEuNTctLjgzLDEuOTMtLjgzLDEuOTNMMjEuNTEsNDNBMS42OSwxLjY5LDAsMCwxLDIwLDQzUzUuMiwzNC40LDQuNjYsMzRhMS4yOSwxLjI5LDAsMCwxLS41NS0xVjE1LjI0YzAtLjc4LDEtMS4zMywxLTEuMzNMMTkuODYsNS4zNmEyLDIsMCwwLDEsMS43OSwwbDE0LjQ2LDguNDFhMi4wNiwyLjA2LDAsMCwxLDEuMjUsMi4wNlYzMi4zN1ptLTUuOS0xN0wyMS4zNSw5LjVhMS41OSwxLjU5LDAsMCwwLTEuNDEsMEw4LjMzLDE2LjE1cy0uNzcuNDYtLjc2LDEuMDgsMCwxMy45MiwwLDEzLjkyQTEsMSwwLDAsMCw4LDMxLjljLjQzLjMsMTIsNywxMiw3YTEuMzEsMS4zMSwwLDAsMCwxLjE5LDBDMjEuOTEsMzguNSwzMywzMi4xMSwzMywzMi4xMXMuNjUtLjI4LjY1LTEuNTFWMjcuMTNsLTEzLDcuOVYzMmEzLjA1LDMuMDUsMCwwLDEsMS0yLjA3TDMzLjIsMjNhMi40NCwyLjQ0LDAsMCwwLC41NS0xLjQ2VjE4LjQzTDIwLjY0LDI2LjM1di0zLjJhMi4yMiwyLjIyLDAsMCwxLC44My0xLjc5Wk00MS4wNyw0LjIyYS4zOS4zOSwwLDAsMC0uMzctLjQySDM4VjEuMDZjMC0uMTYtLjI2LS4yMi0uNTMtLjIyTDM2LDEuMDhjLS4xOCwwLS4zMS4xMi0uMzEuMjNWMy44SDMzYS40LjQsMCwwLDAtLjM2LjM3djJoM1Y5YzAsLjE2LjI2LjI3LjU0LjIzbDEuNTEtLjI1Yy4xOCwwLC4yOS0uMTMuMjktLjIzVjYuMTRoM1oiLz48L3N2Zz4=">
 25 |         <div>测试标题</div>
 26 |        </div>
 27 |      </template>
 28 |      <template #right>
 29 |         <div>admin</div>
 30 |       </template>
 31 |       <template #default>
 32 |         <div>container</div>
 33 |       </template>
 34 |   </sum-layout>
 35 | </template>
 36 | 
 37 | <script lang="ts">
 38 | import { defineComponent, reactive, toRefs } from 'vue'
 39 | 
 40 | export default defineComponent({
 41 |   setup() {
 42 |     const settings = reactive({
 43 |         // 可以用slot插槽或者render渲染函数两种方式,当使用render的时候需要改成 <script lang="tsx">
 44 |         headerTitle: {
 45 |           slot: 'title'
 46 |         },
 47 |         // headerTitle: () => 
 48 |         //        <div class="title">
 49 |         //           <img
 50 |         //             src="./logo.png"
 51 |         //             alt="header-logo"
 52 |         //             />
 53 |         //             <div>测试标题</div>
 54 |         //        </div>,
 55 |         headerRight: {
 56 |           slot: 'right'
 57 |         },
 58 |         // headerRight: () => <div>admin</div>,
 59 |         menuData: [
 60 |           {
 61 |             title: '菜单列表', // 标题
 62 |             icon: 'el-icon-s-goods', // icon
 63 |             auth: 'menu', // 权限
 64 |             path: '/menu', // 路径
 65 |             children: [ // 子菜单
 66 |               {
 67 |                 title: '数据',
 68 |                 auth: 'menu/data',
 69 |                 // path: '/menu/data'
 70 |               },
 71 |               {
 72 |                 title: '分析',
 73 |                 auth: 'menu/analysis',
 74 |                 // path: '/menu/analysis'
 75 |               }
 76 |             ]
 77 |           }
 78 |        ],
 79 |        headerStyles: {
 80 |          backgroundColor: '#545c64',
 81 |          padding: '10px',
 82 |          color: '#fff'
 83 |        },
 84 |        menuProps: {
 85 |          backgroundColor: '#f7f6f2',
 86 |          textColor: '#333',
 87 |          activeTextColor: '#409eff',
 88 |          defaultActive: '0-0',
 89 |          defaultOpeneds: [0]
 90 |        },
 91 |        triggerCollapse: true,
 92 |        footer: '@copyRight by footer', // 字符串或者render函数
 93 |     })
 94 |     return {
 95 |       settings,
 96 |       ...toRefs(settings)
 97 |     }
 98 |   }
 99 | })
100 | </script>
101 | 
102 | <style>
103 | .sum-layout {
104 |    min-height: 500px;
105 | }
106 | .title {
107 |   display: flex;
108 |   align-items: center;
109 | }
110 | a:hover {
111 |   text-decoration: none!important;
112 | }
113 | </style>
114 | 

SumLayout Attributes

参数说明类型可选值默认值
settings布局参数object{}

Settings Attributes

参数说明类型可选值默认值
headerTitle头栏左边内容string/object/function(如果有rener函数则展示render函数内容,如果是object,{slot: 'title'}则可以使用插槽,否则展示字符串){}
headerRight头栏右边内容string/object/function(如果有rener函数则展示render函数内容,如果是object,{slot: 'title'}则可以使用插槽,否则展示字符串){}
headerStyles头栏样式object{}
menuProps侧栏属性传递(继承 el-menu 属性)object{}
triggerCollapse是否显示 collapse 图标booleanfalse
menuData菜单数据array[]
footer底部footerstring/object/function(如果有rener函数则展示render函数内容,如果是object,{slot: 'title'}则可以使用插槽,否则展示字符串){}
参数说明类型可选值默认值
mode模式stringhorizontal / verticalvertical
collapse是否水平折叠收起菜单(仅在 mode 为 vertical 时可用)booleanfalse
background-color菜单的背景色(仅支持 hex 格式)string#ffffff
text-color菜单的文字颜色(仅支持 hex 格式)string#303133
active-text-color当前激活菜单的文字颜色(仅支持 hex 格式)string#409EFF
default-active当前激活菜单的 indexstring
default-openeds当前打开的 sub-menu 的 index 的数组Array
unique-opened是否只保持一个子菜单的展开booleanfalse
menu-trigger子菜单打开的触发方式(只在 mode 为 horizontal 时有效)stringhover / clickhover
router是否使用 vue-router 的模式,启用该模式会在激活导航时以 index 作为 path 进行路由跳转booleanfalse
collapse-transition是否开启折叠动画booleantrue
上次更新: 9/7/2021, 2:16:11 PM
贡献者: ltt
115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /docs/.vuepress/dist/guide/install.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 安装 | sum-ui 16 | 17 | 18 | 19 | 20 |

sum-ui 简介

sum-ui 是基于 Vue3 + ElementPlus 二次开发的组合组件库集合,包含通用场景,如 layout 布局,table 表格等等

@sum-ui/layout

npm i @sum-ui/layout
21 | # or
22 | yarn add @sum-ui/layout
23 | 
1
2
3

@sum-ui/table

npm i @sum-ui/table
24 | # or
25 | yarn add @sum-ui/table
26 | 
1
2
3
上次更新: 9/2/2021, 5:12:47 PM
贡献者: ltt
27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /docs/.vuepress/dist/guide/start.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 开始 | sum-ui 16 | 17 | 18 | 19 | 20 |

安装

npm i @sum-ui/layout
21 | # or
22 | yarn add @sum-ui/layout
23 | 
24 | npm i @sum-ui/table
25 | # or
26 | yarn add @sum-ui/table
27 | 
1
2
3
4
5
6
7

使用

<template>
28 |  <sum-layout>
29 |    <sum-table/>
30 |  </sum-layout>
31 | </template>
32 | 
33 | <script lang="ts">
34 | import { defineComponent, toRefs } from 'vue'
35 | import SumLayout from '@sum-ui/layout'
36 | import SumTable from '@sum-ui/table'
37 | 
38 | export default defineComponent({
39 |   name: 'sum-layout',
40 |   components: { SumLayout, SumTable },
41 |   setup() {}
42 | })
43 | </script>
44 | 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
上次更新: 9/2/2021, 5:12:47 PM
贡献者: ltt
45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /docs/.vuepress/dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | sum-ui 16 | 17 | 18 | 19 | 20 |

sum-ui

Vue3 + ElementPlus 组件库

Get Started Components

💡 Instant Server Start

On demand file serving over native ESM, no bundling required!

⚡️ Lightning Fast HMR

Hot Module Replacement (HMR) that stays fast regardless of app size.

🛠️ Rich Features

Out-of-the-box support for TypeScript, JSX, CSS and more.

📦 Optimized Build

Pre-configured Rollup build with multi-page and library mode support.

🔩 Universal Plugins

Rollup-superset plugin interface shared between dev and build.

🔑 Fully Typed APIs

Flexible programmatic APIs with full TypeScript typing.

21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /docs/.vuepress/theme/styles/index.styl: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | -------------------------------------------------------------------------------- /docs/components/layout.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Layout' 3 | desc: 'desc' 4 | --- 5 | 6 | ### @sum-ui/layout 7 | 8 | ::: demo 9 | 10 | ```vue 11 | 27 | 28 | 92 | 93 | 105 | ``` 106 | 107 | ::: 108 | 109 | ### SumLayout Attributes 110 | 111 | | 参数 | 说明 | 类型 | 可选值 | 默认值 | 112 | |---------- |-------------- |---------- |-------------------------------- |-------- | 113 | | settings | 布局参数 | object | — | {} | 114 | 115 | ### Settings Attributes 116 | 117 | | 参数 | 说明 | 类型 | 可选值 | 默认值 | 118 | |---------- |-------------- |---------- |-------------------------------- |-------- | 119 | | headerTitle | 头栏左边内容 | string/object/function(如果有rener函数则展示render函数内容,如果是object,{slot: 'title'}则可以使用插槽,否则展示字符串) | — | {} | 120 | | headerRight | 头栏右边内容 | string/object/function(如果有rener函数则展示render函数内容,如果是object,{slot: 'title'}则可以使用插槽,否则展示字符串) | — | {} | 121 | | headerStyles | 头栏样式 | object | — | {} | 122 | | menuProps | 侧栏属性传递(继承 el-menu 属性) | object | — | {} | 123 | | triggerCollapse | 是否显示 collapse 图标 | boolean | — | false | 124 | | menuData | 菜单数据 | array | — | [] | 125 | | footer | 底部footer | string/object/function(如果有rener函数则展示render函数内容,如果是object,{slot: 'title'}则可以使用插槽,否则展示字符串) | — | {} | 126 | 127 | ### MenuProps Attributes 128 | 129 | | 参数 | 说明 | 类型 | 可选值 | 默认值 | 130 | | ------------------- | ----------------------------------------------------------------------------------- | ------- | --------------------- | -------- | 131 | | mode | 模式 | string | horizontal / vertical | vertical | 132 | | collapse | 是否水平折叠收起菜单(仅在 mode 为 vertical 时可用) | boolean | — | false | 133 | | background-color | 菜单的背景色(仅支持 hex 格式) | string | — | #ffffff | 134 | | text-color | 菜单的文字颜色(仅支持 hex 格式) | string | — | #303133 | 135 | | active-text-color | 当前激活菜单的文字颜色(仅支持 hex 格式) | string | — | #409EFF | 136 | | default-active | 当前激活菜单的 index | string | — | — | 137 | | default-openeds | 当前打开的 sub-menu 的 index 的数组 | Array | — | — | 138 | | unique-opened | 是否只保持一个子菜单的展开 | boolean | — | false | 139 | | menu-trigger | 子菜单打开的触发方式(只在 mode 为 horizontal 时有效) | string | hover / click | hover | 140 | | router | 是否使用 vue-router 的模式,启用该模式会在激活导航时以 index 作为 path 进行路由跳转 | boolean | — | false | 141 | | collapse-transition | 是否开启折叠动画 | boolean | — | true | 142 | -------------------------------------------------------------------------------- /docs/components/table.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Table' 3 | desc: 'desc' 4 | --- 5 | 6 | ### @sum-ui/table 7 | 8 | ::: demo 9 | 10 | ```vue 11 | 25 | 26 | 88 | 89 | ``` 90 | 91 | ::: 92 | 93 | ### SumTable Attributes 94 | 95 | 属性除继承自 el-table属性外,增加 columns配置,locale 语言配置,默认中文, pagenation 分页属性配置 96 | 97 | | 参数 | 说明 | 类型 | 可选值 | 默认值 | 98 | | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- | ------------------------------- | ------------------------------------------------------------- | 99 | | columns | columns 配置 | array | 100 | | data | 显示的数据 | array | — | — | 101 | | height | Table 的高度,默认为自动高度。如果 height 为 number 类型,单位 px;如果 height 为 string 类型,则这个高度会设置为 Table 的 style.height 的值,Table 的高度会受控于外部样式。 | string / number | — | — | 102 | | max-height | Table 的最大高度。合法的值为数字或者单位为 px 的高度。 | string / number | — | — | 103 | | stripe | 是否为斑马纹 table | boolean | — | false | 104 | | border | 是否带有纵向边框 | boolean | — | false | 105 | | size | Table 的尺寸 | string | medium / small / mini | — | 106 | | fit | 列的宽度是否自撑开 | boolean | — | true | 107 | | show-header | 是否显示表头 | boolean | — | true | 108 | | highlight-current-row | 是否要高亮当前行 | boolean | — | false | 109 | | current-row-key | 当前行的 key,只写属性 | string / number | — | — | 110 | | row-class-name | 行的 className 的回调方法,也可以使用字符串为所有行设置一个固定的 className。 | function({ row, rowIndex }) / string | — | — | 111 | | row-style | 行的 style 的回调方法,也可以使用一个固定的 Object 为所有行设置一样的 Style。 | function({ row, rowIndex }) / object | — | — | 112 | | cell-class-name | 单元格的 className 的回调方法,也可以使用字符串为所有单元格设置一个固定的 className。 | function({ row, column, rowIndex, columnIndex }) / string | — | — | 113 | | cell-style | 单元格的 style 的回调方法,也可以使用一个固定的 Object 为所有单元格设置一样的 Style。 | function({ row, column, rowIndex, columnIndex }) / object | — | — | 114 | | header-row-class-name | 表头行的 className 的回调方法,也可以使用字符串为所有表头行设置一个固定的 className。 | function({ row, rowIndex }) / string | — | — | 115 | | header-row-style | 表头行的 style 的回调方法,也可以使用一个固定的 Object 为所有表头行设置一样的 Style。 | function({ row, rowIndex }) / object | — | — | 116 | | header-cell-class-name | 表头单元格的 className 的回调方法,也可以使用字符串为所有表头单元格设置一个固定的 className。 | function({ row, column, rowIndex, columnIndex }) / string | — | — | 117 | | header-cell-style | 表头单元格的 style 的回调方法,也可以使用一个固定的 Object 为所有表头单元格设置一样的 Style。 | function({ row, column, rowIndex, columnIndex }) / object | — | — | 118 | | row-key | 行数据的 Key,用来优化 Table 的渲染;在使用 reserve-selection 功能与显示树形数据时,该属性是必填的。类型为 String 时,支持多层访问:`user.info.id`,但不支持 `user.info[0].id`,此种情况请使用 `Function`。 | function(row) / string | — | — | 119 | | empty-text | 空数据时显示的文本内容,也可以通过 `#empty` 设置 | string | — | 暂无数据 | 120 | | default-expand-all | 是否默认展开所有行,当 Table 包含展开行存在或者为树形表格时有效 | boolean | — | false | 121 | | expand-row-keys | 可以通过该属性设置 Table 目前的展开行,需要设置 row-key 属性才能使用,该属性为展开行的 keys 数组。 | array | — | — | 122 | | default-sort | 默认的排序列的 prop 和顺序。它的 `prop` 属性指定默认的排序的列,`order` 指定默认排序的顺序 | object | `order`: ascending / descending | 如果只指定了 `prop`, 没有指定 `order`, 则默认顺序是 ascending | 123 | | tooltip-effect | tooltip `effect` 属性 | string | dark / light | dark | 124 | | show-summary | 是否在表尾显示合计行 | boolean | — | false | 125 | | sum-text | 合计行第一列的文本 | string | — | 合计 | 126 | | summary-method | 自定义的合计计算方法 | function({ columns, data }) | — | — | 127 | | span-method | 合并行或列的计算方法 | function({ row, column, rowIndex, columnIndex }) | — | — | 128 | | select-on-indeterminate | 在多选表格中,当仅有部分行被选中时,点击表头的多选框时的行为。若为 true,则选中所有行;若为 false,则取消选择所有行 | boolean | — | true | 129 | | indent | 展示树形数据时,树节点的缩进 | number | — | 16 | 130 | | lazy | 是否懒加载子节点数据 | boolean | — | — | 131 | | load | 加载子节点数据的函数,lazy 为 true 时生效,函数第二个参数包含了节点的层级信息 | function(row, treeNode, resolve) | — | — | 132 | | tree-props | 渲染嵌套数据的配置选项 | object | — | { hasChildren: 'hasChildren', children: 'children' } | 133 | | locale | 语言属性 | object | — | import zhCn from 'element-plus/lib/locale/lang/zh-cn' | 134 | | pagenation | 分页属性 | object | — | {} | 135 | 136 | ### Pagenation Attributes 137 | 138 | 继承自 el-pagenation 属性配置 139 | 140 | | 参数 | 说明 | 类型 | 可选值 | 默认值 | 141 | |--------------------|----------------------------------------------------------|-------------------|-------------|--------| 142 | | small | 是否使用小型分页样式 | boolean | — | false | 143 | | background | 是否为分页按钮添加背景色 | boolean | — | false | 144 | | page-size | 每页显示条目个数,支持 v-model 双向绑定 | number | — | 10 | 145 | | default-page-size | 每页显示条目数的初始值;| number | - | - | 146 | | total | 总条目数 | number | — | — | 147 | | page-count | 总页数,total 和 page-count 设置任意一个就可以达到显示页码的功能;如果要支持 page-sizes 的更改,则需要使用 total 属性 | Number | — | — | 148 | | pager-count | 页码按钮的数量,当总页数超过该值时会折叠 | number | 大于等于 5 且小于等于 21 的奇数 | 7 | 149 | | current-page | 当前页数,支持 v-model 双向绑定 | number | — | 1 | 150 | | default-current-page | 当前页数的初始值 | number | - | - | 151 | | layout | 组件布局,子组件名用逗号分隔| String | `sizes`, `prev`, `pager`, `next`, `jumper`, `->`, `total`, `slot` | 'prev, pager, next, jumper, ->, total' | 152 | | page-sizes | 每页显示个数选择器的选项设置 | number[] | — | [10, 20, 30, 40, 50, 100] | 153 | | popper-class | 每页显示个数选择器的下拉框类名 | string | — | — | 154 | | prev-text | 替代图标显示的上一页文字 | string | — | — | 155 | | next-text | 替代图标显示的下一页文字 | string | — | — | 156 | | disabled | 是否禁用 | boolean | — | false | 157 | | hide-on-single-page | 只有一页时是否隐藏 | boolean | — | - | 158 | 159 | ### Events 160 | 161 | | 事件名称 | 说明 | 回调参数 | 162 | |---------|--------|---------| 163 | | pagenation-change | pageSize/currentPage 改变时会触发参数变化 | pagenation对象 | 164 | | select-change | 选中checkbox时会触发 | 选中row数组 | 165 | -------------------------------------------------------------------------------- /docs/guide/install.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 安装 3 | --- 4 | 5 | ## sum-ui 简介 6 | 7 | sum-ui 是基于 Vue3 + ElementPlus 二次开发的组合组件库集合,包含通用场景,如 layout 布局,table 表格等等 8 | 9 | ## @sum-ui/layout 10 | 11 | ```bash 12 | npm i @sum-ui/layout 13 | # or 14 | yarn add @sum-ui/layout 15 | ``` 16 | 17 | ## @sum-ui/table 18 | 19 | ```bash 20 | npm i @sum-ui/table 21 | # or 22 | yarn add @sum-ui/table 23 | ``` 24 | -------------------------------------------------------------------------------- /docs/guide/start.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 开始 3 | --- 4 | ## 安装 5 | 6 | ```bash 7 | npm i @sum-ui/layout 8 | # or 9 | yarn add @sum-ui/layout 10 | 11 | npm i @sum-ui/table 12 | # or 13 | yarn add @sum-ui/table 14 | ``` 15 | 16 | ## 使用 17 | 18 | ```vue 19 | 24 | 25 | 36 | ``` 37 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | home: true 3 | actions: 4 | - text: Get Started 5 | link: /guide/install.html 6 | type: primary 7 | - text: Components 8 | link: /components/layout.html 9 | type: secondary 10 | 11 | features: 12 | - title: 💡 Instant Server Start 13 | details: On demand file serving over native ESM, no bundling required! 14 | - title: ⚡️ Lightning Fast HMR 15 | details: Hot Module Replacement (HMR) that stays fast regardless of app size. 16 | - title: 🛠️ Rich Features 17 | details: Out-of-the-box support for TypeScript, JSX, CSS and more. 18 | - title: 📦 Optimized Build 19 | details: Pre-configured Rollup build with multi-page and library mode support. 20 | - title: 🔩 Universal Plugins 21 | details: Rollup-superset plugin interface shared between dev and build. 22 | - title: 🔑 Fully Typed APIs 23 | details: Flexible programmatic APIs with full TypeScript typing. 24 | footer: MIT Licensed | Copyright © 2021-present Summer 25 | --- 26 | 27 | ## 组件看板 28 | 29 | | 组件 | 下载量 | 版本 | 30 | | ---------------- | --------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | 31 | | @sum-ui/layout | [![layout](https://img.shields.io/npm/dw/@sum-ui/layout.svg)](https://www.npmjs.com/package/@sum-ui/layout) | [![npm package](https://img.shields.io/npm/v/@sum-ui/layout.svg?style=flat-square?style=flat-square)](https://www.npmjs.com/package/@sum-ui/layout) | 32 | | @sum-ui/table | [![table](https://img.shields.io/npm/dw/@sum-ui/table.svg)](https://www.npmjs.com/package/@sum-ui/table) | [![npm package](https://img.shields.io/npm/v/@sum-ui/table.svg?style=flat-square?style=flat-square)](https://www.npmjs.com/package/@sum-ui/table) | 33 | | @sum-ui/upload | [![upload](https://img.shields.io/npm/dw/@sum-ui/upload.svg)](https://www.npmjs.com/package/@sum-ui/upload) | [![npm package](https://img.shields.io/npm/v/@sum-ui/upload.svg?style=flat-square?style=flat-square)](https://www.npmjs.com/package/@sum-ui/upload) | 34 | | @sum-ui/form | [![form](https://img.shields.io/npm/dw/@sum-ui/form.svg)](https://www.npmjs.com/package/@sum-ui/form) | [![npm package](https://img.shields.io/npm/v/@sum-ui/layout.svg?style=flat-square?style=flat-square)](https://www.npmjs.com/package/@sum-ui/form) | 35 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | const alias = require('./alias') 2 | 3 | module.exports = { 4 | globals: { 5 | // work around: https://github.com/kulshekhar/ts-jest/issues/748#issuecomment-423528659 6 | 'ts-jest': { 7 | diagnostics: { 8 | ignoreCodes: [151001] 9 | } 10 | } 11 | }, 12 | testEnvironment: 'jsdom', 13 | transform: { 14 | '^.+\\.vue$': 'vue-jest', 15 | '^.+\\.(t|j)sx?$': [ 16 | 'babel-jest', 17 | { 18 | presets: [ 19 | [ 20 | '@babel/preset-env', 21 | { 22 | targets: { 23 | node: true 24 | } 25 | } 26 | ], 27 | [ 28 | '@babel/preset-typescript', 29 | { 30 | isTSX: true, 31 | allExtensions: true 32 | } 33 | ] 34 | ] 35 | } 36 | ] 37 | }, 38 | moduleNameMapper: alias, 39 | moduleFileExtensions: ['ts', 'tsx', 'js', 'json'], 40 | // u can change this option to a more specific folder for test single component or util when dev 41 | // for example, ['/packages/input'] 42 | roots: [''] 43 | } 44 | -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": [ 3 | "packages/*" 4 | ], 5 | "version": "1.1.0" 6 | } 7 | -------------------------------------------------------------------------------- /main.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sum-ui", 3 | "private": true, 4 | "version": "0.0.0", 5 | "workspaces": [ 6 | "packages/*" 7 | ], 8 | "devDependencies": { 9 | "@babel/core": "^7.14.6", 10 | "@babel/plugin-transform-runtime": "^7.14.5", 11 | "@babel/preset-env": "^7.14.7", 12 | "@babel/preset-typescript": "^7.15.0", 13 | "@commitlint/cli": "^12.1.4", 14 | "@commitlint/config-conventional": "^12.1.4", 15 | "@rollup/plugin-babel": "^5.3.0", 16 | "@rollup/plugin-commonjs": "^19.0.0", 17 | "@rollup/plugin-json": "^4.1.0", 18 | "@rollup/plugin-node-resolve": "^13.0.0", 19 | "@rollup/plugin-typescript": "^8.3.3", 20 | "@types/jest": "^26.0.23", 21 | "@types/lodash": "^4.14.170", 22 | "@typescript-eslint/eslint-plugin": "^4.28.0", 23 | "@typescript-eslint/parser": "^4.28.0", 24 | "@vitejs/plugin-vue": "^1.6.0", 25 | "@vitejs/plugin-vue-jsx": "^1.1.7", 26 | "@vue/babel-plugin-jsx": "^1.0.6", 27 | "@vue/cli-plugin-babel": "^4.5.13", 28 | "@vue/cli-plugin-eslint": "^4.5.13", 29 | "@vue/cli-plugin-typescript": "^4.5.13", 30 | "@vue/compiler-sfc": "^3.2.8", 31 | "@vue/component-compiler-utils": "^3.2.2", 32 | "@vue/eslint-config-prettier": "^6.0.0", 33 | "@vue/eslint-config-typescript": "^7.0.0", 34 | "@vue/test-utils": "^2.0.0-rc.13", 35 | "@vuepress/bundler-vite": "^2.0.0-beta.48", 36 | "@vuepress/theme-default": "^2.0.0-beta.48", 37 | "autoprefixer": "^10.4.7", 38 | "babel-jest": "^26.3.0", 39 | "babel-plugin-import": "^1.13.3", 40 | "chalk": "^4.1.1", 41 | "cross-env": "^7.0.3", 42 | "cz-conventional-changelog": "^3.3.0", 43 | "element-plus": "^2.2.6", 44 | "eslint": "^6.7.2", 45 | "eslint-plugin-prettier": "^3.3.1", 46 | "eslint-plugin-vue": "^7.0.0", 47 | "husky": "^6.0.0", 48 | "jest": "^26.6.3", 49 | "lerna": "^4.0.0", 50 | "lint-staged": "^11.0.0", 51 | "lodash": "^4.17.21", 52 | "plop": "^2.7.4", 53 | "postcss": "^8.4.14", 54 | "prettier": "^2.3.1", 55 | "rollup": "^2.56.3", 56 | "rollup-plugin-postcss": "^4.0.0", 57 | "rollup-plugin-terser": "^7.0.2", 58 | "rollup-plugin-vue": "^6.0.0-beta.10", 59 | "sass": "^1.39.0", 60 | "standard-version": "^9.3.0", 61 | "stylelint": "^13.13.1", 62 | "stylelint-config-recess-order": "^2.4.0", 63 | "stylelint-config-standard": "^22.0.0", 64 | "stylelint-order": "^4.1.0", 65 | "tailwindcss": "^3.0.24", 66 | "ts-jest": "^26.0.0", 67 | "tslib": "^2.3.1", 68 | "typescript": "^4.7.4", 69 | "unplugin-auto-import": "^0.5.11", 70 | "unplugin-vue-components": "^0.17.18", 71 | "vue": "^3.2.37", 72 | "vue-jest": "^5.0.0-alpha.10", 73 | "vuepress": "^2.0.0-beta.48", 74 | "vuepress-plugin-demoblock-plus": "^1.6.0", 75 | "vuepress-vite": "^2.0.0-beta.48" 76 | }, 77 | "license": "MIT", 78 | "repository": "git@github.com:leitingting08/sum-ui.git", 79 | "scripts": { 80 | "build": "yarn dist && cross-env NODE_ENV=production rollup -c", 81 | "build:watch": "rollup -c -w", 82 | "docs:dev": "vuepress dev docs", 83 | "docs:build": "cross-env NODE_ENV=production vuepress build docs", 84 | "clean": "lerna clean", 85 | "dist": "rm -rf ./packages/**/dist", 86 | "commit": "git-cz", 87 | "release": "standard-version", 88 | "lint": "eslint ./packages --ext .vue,.js,.ts", 89 | "lint-fix": "eslint --fix ./packages --ext .vue,.js,.ts", 90 | "prettier": "prettier --write ./packages", 91 | "test": "jest --coverage", 92 | "deploy": "yarn build && lerna publish" 93 | }, 94 | "config": { 95 | "commitizen": { 96 | "path": "cz-conventional-changelog" 97 | } 98 | }, 99 | "commitlint": { 100 | "extends": [ 101 | "@commitlint/config-conventional" 102 | ] 103 | }, 104 | "husky": { 105 | "hooks": { 106 | "pre-commit": "lint-staged", 107 | "pre-push-todo-open": "npm run test", 108 | "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" 109 | } 110 | }, 111 | "lint-staged": { 112 | "*.{js,jsx,less,md,json,vue}": [ 113 | "prettier --write", 114 | "git add" 115 | ], 116 | "*.{css,less,sass,scss}": [ 117 | "stylelint --fix", 118 | "git add" 119 | ], 120 | "*.ts?(x)": [ 121 | "prettier --parser=typescript --write", 122 | "git add" 123 | ] 124 | }, 125 | "browserslist": [ 126 | "last 2 versions", 127 | "Firefox ESR", 128 | "> 1%", 129 | "ie >= 11" 130 | ], 131 | "dependencies": {} 132 | } 133 | -------------------------------------------------------------------------------- /packages/layout/.gitignore: -------------------------------------------------------------------------------- 1 | # packages 2 | .temp 3 | .cache 4 | .DS_Store 5 | node_modules 6 | /dist 7 | /deploy 8 | 9 | # local env files 10 | .env.local 11 | .env.*.local 12 | 13 | # Log files 14 | npm-debug.log* 15 | yarn-debug.log* 16 | yarn-error.log* 17 | pnpm-debug.log* 18 | 19 | # Editor directories and files 20 | .idea 21 | .vscode 22 | *.suo 23 | *.ntvs* 24 | *.njsproj 25 | *.sln 26 | *.sw? -------------------------------------------------------------------------------- /packages/layout/README.md: -------------------------------------------------------------------------------- 1 | # @sum-ui/layout 2 | 3 | ## Install 4 | 5 | ```bash 6 | npm i @sum-ui/layout 7 | # or 8 | yarn add @sum-ui/layout 9 | ``` 10 | 11 | ## Usage 12 | 13 | ```vue 14 | 17 | 18 | 27 | ``` 28 | 29 | ## Docs 30 | 31 | [@sum-ui/layout](https://leitingting08.github.io/sum-ui/components/layout.html) 32 | -------------------------------------------------------------------------------- /packages/layout/__tests__/layout.spec.ts: -------------------------------------------------------------------------------- 1 | import { mount } from '@vue/test-utils' 2 | import SumLayout from '@sum-ui/layout' 3 | 4 | describe('@sum-ui/layout', () => { 5 | it('create', () => { 6 | const wrapper = mount(SumLayout) 7 | expect(wrapper.classes()).toContain('sum-layout') 8 | }) 9 | }) 10 | -------------------------------------------------------------------------------- /packages/layout/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@sum-ui/layout", 3 | "version": "1.1.0", 4 | "description": "基于 Vue3.x + ElementPlus 的组件库", 5 | "main": "dist/index.js", 6 | "module": "dist/index.module.js", 7 | "typings": "typings/sum-ui.d.ts", 8 | "author": "ltt", 9 | "files": [ 10 | "dist", 11 | "typings", 12 | "README" 13 | ], 14 | "homepage": "https://leitingting08.github.io/sum-ui", 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/leitingting08/sum-ui" 18 | }, 19 | "bugs": { 20 | "url": "https://github.com/leitingting08/sum-ui/issues" 21 | }, 22 | "keywords": [ 23 | "vue3", 24 | "element-plus", 25 | "components", 26 | "lerna", 27 | "rollup", 28 | "vuepress" 29 | ], 30 | "publishConfig": { 31 | "access": "public" 32 | }, 33 | "license": "MIT", 34 | "peerDependencies": { 35 | "vue": "^3.2.8" 36 | }, 37 | "engines": { 38 | "node": ">=12" 39 | }, 40 | "gitHead": "fadd15bf6f087edb3b8e1f7cc0b9e804ade02101" 41 | } 42 | -------------------------------------------------------------------------------- /packages/layout/src/Index.vue: -------------------------------------------------------------------------------- 1 | 66 | 67 | 117 | 118 | 161 | -------------------------------------------------------------------------------- /packages/layout/src/components/Render.vue: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /packages/layout/src/main.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import Layout from './Index.vue' 3 | import '../../../main.css' 4 | 5 | Layout.install = (app: App): void => { 6 | app.component(Layout.name, Layout) 7 | } 8 | 9 | export default Layout 10 | -------------------------------------------------------------------------------- /packages/layout/typings/sum-ui.d.ts: -------------------------------------------------------------------------------- 1 | declare module '@sum-ui/layout' 2 | -------------------------------------------------------------------------------- /packages/table/.gitignore: -------------------------------------------------------------------------------- 1 | # packages 2 | .temp 3 | .cache 4 | .DS_Store 5 | node_modules 6 | /dist 7 | /deploy 8 | 9 | # local env files 10 | .env.local 11 | .env.*.local 12 | 13 | # Log files 14 | npm-debug.log* 15 | yarn-debug.log* 16 | yarn-error.log* 17 | pnpm-debug.log* 18 | 19 | # Editor directories and files 20 | .idea 21 | .vscode 22 | *.suo 23 | *.ntvs* 24 | *.njsproj 25 | *.sln 26 | *.sw? -------------------------------------------------------------------------------- /packages/table/README.md: -------------------------------------------------------------------------------- 1 | # @sum-ui/table 2 | 3 | ## Install 4 | 5 | ```bash 6 | npm i @sum-ui/table 7 | # or 8 | yarn add @sum-ui/table 9 | ``` 10 | 11 | ## Usage 12 | 13 | ```vue 14 | 17 | 18 | 27 | ``` 28 | 29 | ## Docs 30 | 31 | [@sum-ui/table](https://leitingting08.github.io/sum-ui/components/table.html) 32 | -------------------------------------------------------------------------------- /packages/table/__tests__/table.spec.ts: -------------------------------------------------------------------------------- 1 | import { mount } from '@vue/test-utils' 2 | import SumTable from '@sum-ui/table' 3 | 4 | describe('@sum-ui/table', () => { 5 | it('create', () => { 6 | const wrapper = mount(SumTable) 7 | expect(wrapper.classes()).toContain('sum-table') 8 | }) 9 | }) 10 | -------------------------------------------------------------------------------- /packages/table/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@sum-ui/table", 3 | "version": "1.1.0", 4 | "description": "基于 Vue3.x + ElementPlus 的组件库", 5 | "main": "dist/index.js", 6 | "module": "dist/index.module.js", 7 | "typings": "typings/sum-ui.d.ts", 8 | "author": "ltt", 9 | "files": [ 10 | "dist", 11 | "typings", 12 | "README" 13 | ], 14 | "homepage": "https://leitingting08.github.io/sum-ui", 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/leitingting08/sum-ui" 18 | }, 19 | "bugs": { 20 | "url": "https://github.com/leitingting08/sum-ui/issues" 21 | }, 22 | "keywords": [ 23 | "vue3", 24 | "element-plus", 25 | "components", 26 | "lerna", 27 | "rollup", 28 | "vuepress" 29 | ], 30 | "publishConfig": { 31 | "access": "public" 32 | }, 33 | "license": "MIT", 34 | "peerDependencies": { 35 | "vue": "^3.2.8" 36 | }, 37 | "engines": { 38 | "node": ">=12" 39 | }, 40 | "gitHead": "fadd15bf6f087edb3b8e1f7cc0b9e804ade02101" 41 | } 42 | -------------------------------------------------------------------------------- /packages/table/src/Index.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | 88 | 89 | 103 | -------------------------------------------------------------------------------- /packages/table/src/components/Render.vue: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /packages/table/src/main.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import Table from './Index.vue' 3 | import '../../../main.css' 4 | 5 | Table.install = (app: App): void => { 6 | app.component(Table.name, Table) 7 | } 8 | 9 | export default Table 10 | -------------------------------------------------------------------------------- /packages/table/typings/sum-ui.d.ts: -------------------------------------------------------------------------------- 1 | declare module '@sum-ui/table' 2 | -------------------------------------------------------------------------------- /plopfile.js: -------------------------------------------------------------------------------- 1 | module.exports = plop => { 2 | plop.setHelper('hump', function (text) { 3 | return text.replace(text[0], text[0].toUpperCase()) 4 | }) 5 | plop.setGenerator('component', { 6 | description: '生成组件', 7 | prompts: [ 8 | { 9 | type: 'input', 10 | name: 'name', 11 | message: '请输入组件名?' 12 | } 13 | ], 14 | actions: [ 15 | { 16 | type: 'add', 17 | path: 'packages/{{name}}/__tests__/{{name}}.spec.ts', 18 | templateFile: 'templates/__tests__/index.spec.hbs' 19 | }, 20 | { 21 | type: 'add', 22 | path: 'packages/{{name}}/src/main.ts', 23 | templateFile: 'templates/src/main.hbs' 24 | }, 25 | { 26 | type: 'add', 27 | path: 'packages/{{name}}/.gitignore', 28 | templateFile: 'templates/.gitignore' 29 | }, 30 | { 31 | type: 'add', 32 | path: 'packages/{{name}}/src/Index.vue', 33 | templateFile: 'templates/src/Index.vue' 34 | }, 35 | { 36 | type: 'add', 37 | path: 'packages/{{name}}/package.json', 38 | templateFile: 'templates/package.hbs' 39 | }, 40 | { 41 | type: 'add', 42 | path: 'packages/{{name}}/README.md', 43 | templateFile: 'templates/README.hbs' 44 | }, 45 | { 46 | type: 'add', 47 | path: 'packages/{{name}}/typings/sum-ui.d.ts', 48 | templateFile: 'templates/typings/sum-ui.d.ts' 49 | }, 50 | { 51 | type: 'append', 52 | path: 'docs/.vuepress/clientAppEnhance.ts', 53 | pattern: /(\/\/ -- APPSTART ITEMS HERE --)/gi, 54 | template: "import Sum{{hump name}} from '@sum-ui/{{name}}'" 55 | }, 56 | { 57 | type: 'append', 58 | path: 'docs/.vuepress/clientAppEnhance.ts', 59 | pattern: /(\/\/ -- APPEND ITEMS HERE --)/gi, 60 | template: "app.component('Sum{{hump name}}', Sum{{hump name}})" 61 | } 62 | ] 63 | }) 64 | } 65 | -------------------------------------------------------------------------------- /rollup.config.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs' 2 | import path from 'path' 3 | import json from '@rollup/plugin-json' 4 | import postcss from 'rollup-plugin-postcss' 5 | import vue from '@vitejs/plugin-vue' 6 | import { terser } from 'rollup-plugin-terser' 7 | import { nodeResolve } from '@rollup/plugin-node-resolve' 8 | import typescript from '@rollup/plugin-typescript' 9 | import babel from '@rollup/plugin-babel' 10 | import commonjs from '@rollup/plugin-commonjs' 11 | import { DEFAULT_EXTENSIONS } from '@babel/core' 12 | import AutoImport from 'unplugin-auto-import/vite' 13 | import Components from 'unplugin-vue-components/vite' 14 | import { ElementPlusResolver } from 'unplugin-vue-components/resolvers' 15 | 16 | const isDev = process.env.NODE_ENV !== 'production' 17 | // packages 文件夹路径 18 | const root = path.resolve(__dirname, 'packages') 19 | 20 | // 公共插件配置 21 | const getPlugins = () => { 22 | return [ 23 | vue(), 24 | AutoImport({ 25 | resolvers: [ElementPlusResolver()] 26 | }), 27 | Components({ 28 | resolvers: [ElementPlusResolver()] 29 | }), 30 | typescript({ 31 | tsconfig: './tsconfig.json' 32 | }), 33 | nodeResolve({ 34 | mainField: ['jsnext:main', 'browser', 'module', 'main'], 35 | browser: true 36 | }), 37 | commonjs(), 38 | json(), 39 | postcss({ 40 | plugins: [require('autoprefixer'), require('tailwindcss')], 41 | // 把 css 插入到 style 中 42 | inject: true, 43 | // 把 css 放到和js同一目录 44 | // extract: true 45 | // Minimize CSS, boolean or options for cssnano. 46 | minimize: !isDev, 47 | // Enable sourceMap. 48 | sourceMap: isDev, 49 | // This plugin will process files ending with these extensions and the extensions supported by custom loaders. 50 | extensions: ['.sass', '.less', '.scss', '.css'] 51 | }), 52 | babel({ 53 | exclude: 'node_modules/**', 54 | babelHelpers: 'runtime', 55 | // babel 默认不支持 ts 需要手动添加 56 | extensions: [...DEFAULT_EXTENSIONS, '.ts', '.tsx', '.vue'] 57 | }), 58 | // 如果不是开发环境,开启压缩 59 | !isDev && terser({ toplevel: true }) 60 | ] 61 | } 62 | 63 | module.exports = fs 64 | .readdirSync(root) 65 | // 过滤,只保留文件夹 66 | .filter(item => fs.statSync(path.resolve(root, item)).isDirectory()) 67 | // 为每一个文件夹创建对应的配置 68 | .map(item => { 69 | const pkg = require(path.resolve(root, item, 'package.json')) 70 | return { 71 | input: path.resolve(root, item, 'src/main.ts'), 72 | output: [ 73 | { 74 | name: 'index', 75 | file: path.resolve(root, item, pkg.main), 76 | format: 'umd', 77 | sourcemap: isDev, 78 | globals: { 79 | vue: 'vue', 80 | 'element-plus': 'element-plus' 81 | } 82 | }, 83 | { 84 | name: 'index.module', 85 | file: path.join(root, item, pkg.module), 86 | format: 'es', 87 | sourcemap: isDev, 88 | globals: { 89 | vue: 'vue', 90 | 'element-plus': 'element-plus' 91 | } 92 | } 93 | ], 94 | onwarn: function (warning) { 95 | if (warning.code === 'THIS_IS_UNDEFINED' || warning.code === 'CIRCULAR_DEPENDENCY') { 96 | return 97 | } 98 | console.error(`(!) ${warning.message}`) 99 | }, 100 | plugins: getPlugins(), 101 | external: Object.keys(require(path.join(root, item, 'package.json'))?.peerDependencies || {}) 102 | } 103 | }) 104 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | content: ['./packages/**/src/*.{html,js,vue}'], 3 | theme: {}, 4 | variants: {}, 5 | plugins: [] 6 | } 7 | -------------------------------------------------------------------------------- /templates/.gitignore: -------------------------------------------------------------------------------- 1 | # packages 2 | .temp 3 | .cache 4 | .DS_Store 5 | node_modules 6 | /dist 7 | /deploy 8 | 9 | # local env files 10 | .env.local 11 | .env.*.local 12 | 13 | # Log files 14 | npm-debug.log* 15 | yarn-debug.log* 16 | yarn-error.log* 17 | pnpm-debug.log* 18 | 19 | # Editor directories and files 20 | .idea 21 | .vscode 22 | *.suo 23 | *.ntvs* 24 | *.njsproj 25 | *.sln 26 | *.sw? -------------------------------------------------------------------------------- /templates/README.hbs: -------------------------------------------------------------------------------- 1 | # @sum-ui/{{name}} 2 | 3 | ## Install 4 | 5 | ```bash 6 | npm i @sum-ui/{{name}} 7 | # or 8 | yarn add @sum-ui/{{name}} 9 | ``` 10 | 11 | ## Usage 12 | 13 | ```vue 14 | 17 | 18 | 27 | ``` 28 | 29 | ## Docs 30 | 31 | [@sum-ui/{{name}}](https://leitingting08.github.io/sum-ui/components/{{name}}.html) 32 | -------------------------------------------------------------------------------- /templates/__tests__/index.spec.hbs: -------------------------------------------------------------------------------- 1 | import { mount } from '@vue/test-utils' 2 | import Sum{{hump name}} from '@sum-ui/{{name}}' 3 | 4 | describe('@sum-ui/{{name}}', () => { 5 | it('create', () => { 6 | const wrapper = mount(Sum{{hump name}}) 7 | expect(wrapper.classes()).toContain('sum-{{name}}') 8 | }) 9 | }) 10 | -------------------------------------------------------------------------------- /templates/package.hbs: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@sum-ui/{{name}}", 3 | "version": "1.0.0", 4 | "description": "基于 Vue3.x + ElementPlus 的组件库", 5 | "main": "dist/index.js", 6 | "module": "dist/index.module.js", 7 | "typings": "sum-ui.d.ts", 8 | "typings": "typings/sum-ui.d.ts", 9 | "author": "ltt", 10 | "files": [ 11 | "dist", 12 | "typings", 13 | "README" 14 | ], 15 | "homepage": "https://leitingting08.github.io/sum-ui", 16 | "repository": { 17 | "type": "git", 18 | "url": "https://github.com/leitingting08/sum-ui" 19 | }, 20 | "bugs": { 21 | "url": "https://github.com/leitingting08/sum-ui/issues" 22 | }, 23 | "keywords": [ 24 | "vue3", 25 | "element-plus", 26 | "components", 27 | "lerna", 28 | "rollup", 29 | "vuepress" 30 | ], 31 | "publishConfig": { 32 | "access": "public" 33 | }, 34 | "license": "MIT", 35 | "peerDependencies": { 36 | "vue": "^3.2.8" 37 | }, 38 | "engines": { 39 | "node": ">=12" 40 | }, 41 | } -------------------------------------------------------------------------------- /templates/src/Index.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 13 | -------------------------------------------------------------------------------- /templates/src/main.hbs: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import {{hump name}} from './Index.vue' 3 | import '../../../main.css' 4 | 5 | {{hump name}}.install = (app: App): void => { 6 | app.component({{hump name}}.name, {{hump name}}) 7 | } 8 | 9 | export default {{hump name}} 10 | -------------------------------------------------------------------------------- /templates/typings/sum-ui.d.ts: -------------------------------------------------------------------------------- 1 | declare module '@sum-ui/{{name}}' 2 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "esnext", 4 | "noImplicitAny": false, 5 | "removeComments": true, 6 | "moduleResolution": "node", 7 | "esModuleInterop": true, 8 | "jsx": "preserve", 9 | "noLib": false, 10 | "target": "es5", 11 | "sourceMap": true, 12 | "lib": ["ESNext", "DOM"], 13 | "allowSyntheticDefaultImports": true, 14 | "experimentalDecorators": true, 15 | "forceConsistentCasingInFileNames": true, 16 | "resolveJsonModule": true 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /typings/vue-shim.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.vue' { 2 | import { App, defineComponent } from 'vue' 3 | const component: ReturnType & { 4 | install(app: App): void 5 | } 6 | export default component 7 | } 8 | 9 | declare type Nullable = T | null 10 | 11 | declare type CustomizedHTMLElement = HTMLElement & T 12 | 13 | declare type Indexable = { 14 | [key: string]: T 15 | } 16 | 17 | declare type Hash = Indexable 18 | 19 | declare type TimeoutHandle = ReturnType 20 | 21 | declare type ComponentSize = 'large' | 'medium' | 'small' | 'mini' 22 | 23 | declare module 'lodash' 24 | -------------------------------------------------------------------------------- /typings/vue-test-utils.d.ts: -------------------------------------------------------------------------------- 1 | import { ComponentPublicInstance } from 'vue' 2 | 3 | declare module '@vue/test-utils' { 4 | interface DOMWrapper { 5 | style: CSSStyleDeclaration 6 | } 7 | 8 | interface VueWrapper { 9 | style: CSSStyleDeclaration 10 | } 11 | } --------------------------------------------------------------------------------