Initial commit

This commit is contained in:
Leon2nd 2024-09-10 16:44:27 +08:00
commit e3924732b7
13059 changed files with 823490 additions and 0 deletions

612
.all-contributorsrc Normal file
View File

@ -0,0 +1,612 @@
{
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"commitConvention": "angular",
"contributors": [
{
"login": "kagol",
"name": "Kagol",
"avatar_url": "https://avatars.githubusercontent.com/u/9566362?v=4",
"profile": "https://github.com/kagol",
"contributions": [
"code"
]
},
{
"login": "zzcr",
"name": "ajaxzheng",
"avatar_url": "https://avatars.githubusercontent.com/u/18521562?v=4",
"profile": "https://github.com/zzcr",
"contributions": [
"code"
]
},
{
"login": "TC-twwang",
"name": "TC-twwang",
"avatar_url": "https://avatars.githubusercontent.com/u/42400776?v=4",
"profile": "https://github.com/TC-twwang",
"contributions": [
"code"
]
},
{
"login": "MNZhu",
"name": "jacknan",
"avatar_url": "https://avatars.githubusercontent.com/u/17588953?v=4",
"profile": "https://github.com/MNZhu",
"contributions": [
"code"
]
},
{
"login": "awspi",
"name": "Pithy",
"avatar_url": "https://avatars.githubusercontent.com/u/66438036?v=4",
"profile": "https://github.com/awspi",
"contributions": [
"code"
]
},
{
"login": "heygsc",
"name": "heygsc",
"avatar_url": "https://avatars.githubusercontent.com/u/103993866?v=4",
"profile": "https://github.com/heygsc",
"contributions": [
"code"
]
},
{
"login": "wwttff",
"name": "MangoWu",
"avatar_url": "https://avatars.githubusercontent.com/u/32888622?v=4",
"profile": "https://github.com/wwttff",
"contributions": [
"code"
]
},
{
"login": "ErKeLost",
"name": "ADNY",
"avatar_url": "https://avatars.githubusercontent.com/u/66500121?v=4",
"profile": "https://github.com/ErKeLost",
"contributions": [
"code"
]
},
{
"login": "chenxi-20",
"name": "chenxi-20",
"avatar_url": "https://avatars.githubusercontent.com/u/76168465?v=4",
"profile": "https://github.com/chenxi-20",
"contributions": [
"code"
]
},
{
"login": "rayhaoqin",
"name": "Alaray",
"avatar_url": "https://avatars.githubusercontent.com/u/46983981?v=4",
"profile": "https://github.com/rayhaoqin",
"contributions": [
"code"
]
},
{
"login": "yuanningning",
"name": "ing",
"avatar_url": "https://avatars.githubusercontent.com/u/104059491?v=4",
"profile": "https://github.com/yuanningning",
"contributions": [
"code"
]
},
{
"login": "shenjunjian",
"name": "申君健",
"avatar_url": "https://avatars.githubusercontent.com/u/6848520?v=4",
"profile": "https://github.com/shenjunjian",
"contributions": [
"code"
]
},
{
"login": "MomoPoppy",
"name": "MomoPoppy",
"avatar_url": "https://avatars.githubusercontent.com/u/125256456?v=4",
"profile": "https://github.com/MomoPoppy",
"contributions": [
"code"
]
},
{
"login": "WXC-Spring",
"name": "WXC-Spring",
"avatar_url": "https://avatars.githubusercontent.com/u/131581326?v=4",
"profile": "https://github.com/WXC-Spring",
"contributions": [
"code"
]
},
{
"login": "GaoNeng-wWw",
"name": "GaoNeng",
"avatar_url": "https://avatars.githubusercontent.com/u/31283122?v=4",
"profile": "https://github.com/GaoNeng-wWw",
"contributions": [
"code"
]
},
{
"login": "acyza",
"name": "acyza",
"avatar_url": "https://avatars.githubusercontent.com/u/101238421?v=4",
"profile": "https://acyza.github.io",
"contributions": [
"code"
]
},
{
"login": "ygj6",
"name": "ygj6",
"avatar_url": "https://avatars.githubusercontent.com/u/7699524?v=4",
"profile": "https://github.com/ygj6",
"contributions": [
"code"
]
},
{
"login": "MrWang2016",
"name": "MrWang2016",
"avatar_url": "https://avatars.githubusercontent.com/u/24307164?v=4",
"profile": "https://github.com/MrWang2016",
"contributions": [
"code"
]
},
{
"login": "qinwencheng",
"name": "qinwencheng",
"avatar_url": "https://avatars.githubusercontent.com/u/24841685?v=4",
"profile": "https://github.com/qinwencheng",
"contributions": [
"code"
]
},
{
"login": "Huangyilin19",
"name": "黄怡林",
"avatar_url": "https://avatars.githubusercontent.com/u/48042709?v=4",
"profile": "https://github.com/Huangyilin19",
"contributions": [
"code"
]
},
{
"login": "zuixinwang",
"name": "zuixinwang",
"avatar_url": "https://avatars.githubusercontent.com/u/59717852?v=4",
"profile": "https://github.com/zuixinwang",
"contributions": [
"code"
]
},
{
"login": "LadyChatterleyLover",
"name": "luopei",
"avatar_url": "https://avatars.githubusercontent.com/u/35223515?v=4",
"profile": "https://github.com/LadyChatterleyLover",
"contributions": [
"code"
]
},
{
"login": "brenner8023",
"name": "前端爆冲",
"avatar_url": "https://avatars.githubusercontent.com/u/31237954?v=4",
"profile": "https://juejin.cn/user/1996368846785128",
"contributions": [
"infra"
]
},
{
"login": "xiejay97",
"name": "Xie Jay",
"avatar_url": "https://avatars.githubusercontent.com/u/64340763?v=4",
"profile": "https://github.com/xiejay97",
"contributions": [
"infra"
]
},
{
"login": "linxiang07",
"name": "linxiang",
"avatar_url": "https://avatars.githubusercontent.com/u/40119767?v=4",
"profile": "https://github.com/linxiang07",
"contributions": [
"code"
]
},
{
"login": "coderbaozi",
"name": "程序员包子",
"avatar_url": "https://avatars.githubusercontent.com/u/103836393?v=4",
"profile": "https://bollome.netlify.app/",
"contributions": [
"code"
]
},
{
"login": "pe-3",
"name": "peter G",
"avatar_url": "https://avatars.githubusercontent.com/u/103579791?v=4",
"profile": "https://github.com/pe-3",
"contributions": [
"code",
"doc"
]
},
{
"login": "gimmyhehe",
"name": "gimmyhehe",
"avatar_url": "https://avatars.githubusercontent.com/u/26026184?v=4",
"profile": "https://github.com/gimmyhehe",
"contributions": [
"code"
]
},
{
"login": "KevinAndrewDong",
"name": "dong",
"avatar_url": "https://avatars.githubusercontent.com/u/20911103?v=4",
"profile": "https://github.com/KevinAndrewDong",
"contributions": [
"code"
]
},
{
"login": "CatsAndMice",
"name": "凌览",
"avatar_url": "https://avatars.githubusercontent.com/u/58327088?v=4",
"profile": "http://www.linglan01.cn",
"contributions": [
"code"
]
},
{
"login": "Caesar-ch",
"name": "Caesar-ch",
"avatar_url": "https://avatars.githubusercontent.com/u/74941512?v=4",
"profile": "https://github.com/Caesar-ch",
"contributions": [
"code"
]
},
{
"login": "chenqifeng66",
"name": "chenqifeng66",
"avatar_url": "https://avatars.githubusercontent.com/u/97503755?v=4",
"profile": "https://github.com/chenqifeng66",
"contributions": [
"test"
]
},
{
"login": "Zz-ZzzZ",
"name": "Zz-ZzzZ",
"avatar_url": "https://avatars.githubusercontent.com/u/48228016?v=4",
"profile": "https://zz-zzzz.github.io/",
"contributions": [
"test"
]
},
{
"login": "lyx-jay",
"name": "Lyx",
"avatar_url": "https://avatars.githubusercontent.com/u/39766860?v=4",
"profile": "https://github.com/lyx-jay",
"contributions": [
"code"
]
},
{
"login": "chenguang1994",
"name": "Spark Bill",
"avatar_url": "https://avatars.githubusercontent.com/u/31501915?v=4",
"profile": "https://github.com/chenguang1994",
"contributions": [
"code"
]
},
{
"login": "Zuowendong",
"name": "wendZzoo",
"avatar_url": "https://avatars.githubusercontent.com/u/45628596?v=4",
"profile": "https://github.com/Zuowendong",
"contributions": [
"code"
]
},
{
"login": "gweesin",
"name": "Gweesin Chan",
"avatar_url": "https://avatars.githubusercontent.com/u/42909374?v=4",
"profile": "https://github.com/gweesin",
"contributions": [
"code"
]
},
{
"login": "Binks123",
"name": "Binks_",
"avatar_url": "https://avatars.githubusercontent.com/u/103343025?v=4",
"profile": "https://github.com/Binks123",
"contributions": [
"doc"
]
},
{
"login": "yoyo201626",
"name": "yoyo",
"avatar_url": "https://avatars.githubusercontent.com/u/104079404?v=4",
"profile": "https://github.com/yoyo201626",
"contributions": [
"code"
]
},
{
"login": "wkif",
"name": "Kif",
"avatar_url": "https://avatars.githubusercontent.com/u/62132584?v=4",
"profile": "https://hexo.kifroom.icu/",
"contributions": [
"code"
]
},
{
"login": "jack-zishan",
"name": "jack-zishan",
"avatar_url": "https://avatars.githubusercontent.com/u/67041206?v=4",
"profile": "https://github.com/jack-zishan",
"contributions": [
"code"
]
},
{
"login": "LinboLen",
"name": "LinboLen",
"avatar_url": "https://avatars.githubusercontent.com/u/5467712?v=4",
"profile": "http://gradii.com",
"contributions": [
"code"
]
},
{
"login": "vaebe",
"name": "vaebe",
"avatar_url": "https://avatars.githubusercontent.com/u/52314078?v=4",
"profile": "https://github.com/vaebe",
"contributions": [
"code"
]
},
{
"login": "allenli178",
"name": "YuYan Li",
"avatar_url": "https://avatars.githubusercontent.com/u/53218750?v=4",
"profile": "https://allenli178.top",
"contributions": [
"code"
]
},
{
"login": "shonen7",
"name": "shonen7",
"avatar_url": "https://avatars.githubusercontent.com/u/145949377?v=4",
"profile": "https://github.com/shonen7",
"contributions": [
"code"
]
},
{
"login": "xlearns",
"name": "xlearns",
"avatar_url": "https://avatars.githubusercontent.com/u/62782792?v=4",
"profile": "https://github.com/xlearns",
"contributions": [
"code"
]
},
{
"login": "ianxinnew",
"name": "tianxin",
"avatar_url": "https://avatars.githubusercontent.com/u/146069396?v=4",
"profile": "https://github.com/ianxinnew",
"contributions": [
"code"
]
},
{
"login": "Xppp0217",
"name": "Xppp0217",
"avatar_url": "https://avatars.githubusercontent.com/u/82315158?v=4",
"profile": "https://github.com/Xppp0217",
"contributions": [
"code"
]
},
{
"login": "AcWrong02",
"name": "AcWrong02",
"avatar_url": "https://avatars.githubusercontent.com/u/147061401?v=4",
"profile": "https://github.com/AcWrong02",
"contributions": [
"bug"
]
},
{
"login": "betavs",
"name": "betavs",
"avatar_url": "https://avatars.githubusercontent.com/u/34408516?v=4",
"profile": "https://github.com/betavs",
"contributions": [
"code"
]
},
{
"login": "fanbingbing16",
"name": "fanbingbing16",
"avatar_url": "https://avatars.githubusercontent.com/u/84823288?v=4",
"profile": "https://github.com/fanbingbing16",
"contributions": [
"code"
]
},
{
"login": "dyh333",
"name": "dyh333",
"avatar_url": "https://avatars.githubusercontent.com/u/1221313?v=4",
"profile": "https://github.com/dyh333",
"contributions": [
"doc"
]
},
{
"login": "betterdancing",
"name": "betterdancing",
"avatar_url": "https://avatars.githubusercontent.com/u/25901461?v=4",
"profile": "https://github.com/betterdancing",
"contributions": [
"doc"
]
},
{
"login": "David-TechNomad",
"name": "David",
"avatar_url": "https://avatars.githubusercontent.com/u/23149356?v=4",
"profile": "https://github.com/David-TechNomad",
"contributions": [
"code"
]
},
{
"login": "falcon-jin",
"name": "falcon-jin",
"avatar_url": "https://avatars.githubusercontent.com/u/48880836?v=4",
"profile": "https://github.com/falcon-jin",
"contributions": [
"code"
]
},
{
"login": "wuyiping0628",
"name": "wuyiping0628",
"avatar_url": "https://avatars.githubusercontent.com/u/42107997?v=4",
"profile": "https://github.com/wuyiping0628",
"contributions": [
"test"
]
},
{
"login": "James-9696",
"name": "James",
"avatar_url": "https://avatars.githubusercontent.com/u/72028410?v=4",
"profile": "https://github.com/James-9696",
"contributions": [
"doc"
]
},
{
"login": "ichynul",
"name": "ichynul",
"avatar_url": "https://avatars.githubusercontent.com/u/10061650?v=4",
"profile": "https://gitee.com/ichynul",
"contributions": [
"code"
]
},
{
"login": "Davont",
"name": "Davont",
"avatar_url": "https://avatars.githubusercontent.com/u/28757633?v=4",
"profile": "https://github.com/Davont",
"contributions": [
"code"
]
},
{
"login": "wNing50",
"name": "Nick Wu",
"avatar_url": "https://avatars.githubusercontent.com/u/38874640?v=4",
"profile": "https://github.com/wNing50",
"contributions": [
"code"
]
},
{
"login": "Floyd-bit",
"name": "Floyd",
"avatar_url": "https://avatars.githubusercontent.com/u/59243597?v=4",
"profile": "https://github.com/Floyd-bit",
"contributions": [
"code"
]
},
{
"login": "Jevin0",
"name": "Jevin",
"avatar_url": "https://avatars.githubusercontent.com/u/69580637?v=4",
"profile": "https://github.com/Jevin0",
"contributions": [
"code"
]
},
{
"login": "HAOUEHF",
"name": "星河",
"avatar_url": "https://avatars.githubusercontent.com/u/107133502?v=4",
"profile": "https://github.com/HAOUEHF",
"contributions": [
"code"
]
},
{
"login": "RanierYu",
"name": "Ranier Yu",
"avatar_url": "https://avatars.githubusercontent.com/u/62528887?v=4",
"profile": "https://github.com/RanierYu",
"contributions": [
"code"
]
},
{
"login": "Zcating",
"name": "Zcating",
"avatar_url": "https://avatars.githubusercontent.com/u/13329558?v=4",
"profile": "https://github.com/Zcating",
"contributions": [
"code"
]
},
{
"login": "trueLoving",
"name": "Aoi Kaze",
"avatar_url": "https://avatars.githubusercontent.com/u/44056372?v=4",
"profile": "https://github.com/trueLoving",
"contributions": [
"test"
]
}
],
"contributorsPerLine": 8,
"skipCi": true,
"repoType": "github",
"repoHost": "https://github.com",
"projectName": "tiny-vue",
"projectOwner": "opentiny",
"commitType": "docs"
}

View File

@ -0,0 +1,23 @@
version: 0.1.0
name: tiny-opentiny-vue
language: nodejs
# 构建工具
dependencies:
base:
nodejs: best
# 构建机器
machine:
standard:
euler:
- default
# 构建脚本
scripts:
- sh build.sh
# 构建产物
artifacts:
npm_deploy:
- config_path: ./dist/vue/package.json

197
.cid/tiny-vue.yml Normal file
View File

@ -0,0 +1,197 @@
version: 0.1.0
name: tiny-vue
language: nodejs
# 构建工具
dependencies:
base:
nodejs: best
# 构建机器
machine:
standard:
euler:
- default
# 构建脚本
scripts:
- sh build.sh
# 构建产物
artifacts:
npm_deploy:
- config_path: ./dist/${componentName}/package.json
# - config_path: ./dist/alert/package.json
# - config_path: ./dist/action-menu/package.json
# - config_path: ./dist/button/package.json
# - config_path: ./dist/vue/package.json
# - config_path: ./dist/action-sheet/package.json
# - config_path: ./dist/amount/package.json
# - config_path: ./dist/area/package.json
# - config_path: ./dist/autocomplete/package.json
# - config_path: ./dist/avatar/package.json
# - config_path: ./dist/badge/package.json
# - config_path: ./dist/breadcrumb/package.json
# - config_path: ./dist/breadcrumb-item/package.json
# - config_path: ./dist/bulletin-board/package.json
# - config_path: ./dist/button-group/package.json
# - config_path: ./dist/calendar/package.json
# - config_path: ./dist/card-template/package.json
# - config_path: ./dist/carousel/package.json
# - config_path: ./dist/carousel-item/package.json
# - config_path: ./dist/cascader/package.json
# - config_path: ./dist/cascader-menu/package.json
# - config_path: ./dist/cascader-node/package.json
# - config_path: ./dist/cascader-panel/package.json
# - config_path: ./dist/chart/package.json
# - config_path: ./dist/chart/autonavi-map/package.json
# - config_path: ./dist/chart/baidu-map/package.json
# - config_path: ./dist/chart/chart-bar/package.json
# - config_path: ./dist/chart/chart-boxplot/package.json
# - config_path: ./dist/chart/chart-candle/package.json
# - config_path: ./dist/chart/chart-core/package.json
# - config_path: ./dist/chart/chart-funnel/package.json
# - config_path: ./dist/chart/chart-gauge/package.json
# - config_path: ./dist/chart/chart-graph/package.json
# - config_path: ./dist/chart/chart-heatmap/package.json
# - config_path: ./dist/chart/chart-histogram/package.json
# - config_path: ./dist/chart/chart-line/package.json
# - config_path: ./dist/chart/chart-liquidfill/package.json
# - config_path: ./dist/chart/chart-map/package.json
# - config_path: ./dist/chart/chart-pie/package.json
# - config_path: ./dist/chart/chart-radar/package.json
# - config_path: ./dist/chart/chart-ring/package.json
# - config_path: ./dist/chart/chart-sankey/package.json
# - config_path: ./dist/chart/chart-scatter/package.json
# - config_path: ./dist/chart/chart-sunburst/package.json
# - config_path: ./dist/chart/chart-tree/package.json
# - config_path: ./dist/chart/chart-waterfall/package.json
# - config_path: ./dist/chart/chart-wordcloud/package.json
# - config_path: ./dist/checkbox/package.json
# - config_path: ./dist/checkbox-button/package.json
# - config_path: ./dist/checkbox-group/package.json
# - config_path: ./dist/col/package.json
# - config_path: ./dist/collapse/package.json
# - config_path: ./dist/collapse-item/package.json
# - config_path: ./dist/collapse-transition/package.json
# - config_path: ./dist/common/package.json
# - config_path: ./dist/company/package.json
# - config_path: ./dist/container/package.json
# - config_path: ./dist/country/package.json
# - config_path: ./dist/credit-card/package.json
# - config_path: ./dist/credit-card-form/package.json
# - config_path: ./dist/crop/package.json
# - config_path: ./dist/currency/package.json
# - config_path: ./dist/date-panel/package.json
# - config_path: ./dist/date-picker/package.json
# - config_path: ./dist/date-range/package.json
# - config_path: ./dist/date-table/package.json
# - config_path: ./dist/dept/package.json
# - config_path: ./dist/detail-page/package.json
# - config_path: ./dist/dialog-box/package.json
# - config_path: ./dist/dialog-select/package.json
# - config_path: ./dist/drop-roles/package.json
# - config_path: ./dist/drop-times/package.json
# - config_path: ./dist/dropdown/package.json
# - config_path: ./dist/dropdown-item/package.json
# - config_path: ./dist/dropdown-menu/package.json
# - config_path: ./dist/espace/package.json
# - config_path: ./dist/exception/package.json
# - config_path: ./dist/file-upload/package.json
# - config_path: ./dist/filter-panel/package.json
# - config_path: ./dist/floatbar/package.json
# - config_path: ./dist/form/package.json
# - config_path: ./dist/form-item/package.json
# - config_path: ./dist/fullscreen/package.json
# - config_path: ./dist/fall-menu/package.json
# - config_path: ./dist/grid/package.json
# - config_path: ./dist/grid-column/package.json
# - config_path: ./dist/grid-manager/package.json
# - config_path: ./dist/grid-toolbar/package.json
# - config_path: ./dist/hrapprover/package.json
# - config_path: ./dist/icon/package.json
# - config_path: ./dist/infinite-scroll/package.json
# - config_path: ./dist/image/package.json
# - config_path: ./dist/image-viewer/package.json
# - config_path: ./dist/input/package.json
# - config_path: ./dist/ip-address/package.json
# - config_path: ./dist/layout/package.json
# - config_path: ./dist/link/package.json
# - config_path: ./dist/link-menu/package.json
# - config_path: ./dist/list/package.json
# - config_path: ./dist/loading/package.json
# - config_path: ./dist/locale/package.json
# - config_path: ./dist/locales/package.json
# - config_path: ./dist/logon-user/package.json
# - config_path: ./dist/logout/package.json
# - config_path: ./dist/milestone/package.json
# - config_path: ./dist/mini-picker/package.json
# - config_path: ./dist/modal/package.json
# - config_path: ./dist/month-range/package.json
# - config_path: ./dist/month-table/package.json
# - config_path: ./dist/nav-bar/package.json
# - config_path: ./dist/nav-menu/package.json
# - config_path: ./dist/notify/package.json
# - config_path: ./dist/numeric/package.json
# - config_path: ./dist/option/package.json
# - config_path: ./dist/option-group/package.json
# - config_path: ./dist/pager/package.json
# - config_path: ./dist/pager-item/package.json
# - config_path: ./dist/panel/package.json
# - config_path: ./dist/picker/package.json
# - config_path: ./dist/picker-column/package.json
# - config_path: ./dist/pop-upload/package.json
# - config_path: ./dist/popeditor/package.json
# - config_path: ./dist/popover/package.json
# - config_path: ./dist/popup/package.json
# - config_path: ./dist/progress/package.json
# - config_path: ./dist/pull-refresh/package.json
# - config_path: ./dist/radio/package.json
# - config_path: ./dist/radio-button/package.json
# - config_path: ./dist/radio-group/package.json
# - config_path: ./dist/rate/package.json
# - config_path: ./dist/roles/package.json
# - config_path: ./dist/row/package.json
# - config_path: ./dist/scroll-text/package.json
# - config_path: ./dist/scrollbar/package.json
# - config_path: ./dist/search/package.json
# - config_path: ./dist/select/package.json
# - config_path: ./dist/select-dropdown/package.json
# - config_path: ./dist/slide-bar/package.json
# - config_path: ./dist/slider/package.json
# - config_path: ./dist/split/package.json
# - config_path: ./dist/steps/package.json
# - config_path: ./dist/svg-icon/package.json
# - config_path: ./dist/switch/package.json
# - config_path: ./dist/tab-item/package.json
# - config_path: ./dist/tabbar/package.json
# - config_path: ./dist/tabbar-item/package.json
# - config_path: ./dist/table/package.json
# - config_path: ./dist/tabs/package.json
# - config_path: ./dist/tag/package.json
# - config_path: ./dist/tag-group/package.json
# - config_path: ./dist/text-popup/package.json
# - config_path: ./dist/time/package.json
# - config_path: ./dist/time-line/package.json
# - config_path: ./dist/time-panel/package.json
# - config_path: ./dist/time-picker/package.json
# - config_path: ./dist/time-range/package.json
# - config_path: ./dist/time-select/package.json
# - config_path: ./dist/time-spinner/package.json
# - config_path: ./dist/toggle-menu/package.json
# - config_path: ./dist/tooltip/package.json
# - config_path: ./dist/top-box/package.json
# - config_path: ./dist/transfer/package.json
# - config_path: ./dist/transfer-panel/package.json
# - config_path: ./dist/tree/package.json
# - config_path: ./dist/tree-menu/package.json
# - config_path: ./dist/upload/package.json
# - config_path: ./dist/upload-dragger/package.json
# - config_path: ./dist/upload-list/package.json
# - config_path: ./dist/user/package.json
# - config_path: ./dist/user-account/package.json
# - config_path: ./dist/user-contact/package.json
# - config_path: ./dist/user-head/package.json
# - config_path: ./dist/user-link/package.json
# - config_path: ./dist/wizard/package.json
# - config_path: ./dist/year-table/package.json

9
.codecheck/check.yml Normal file
View File

@ -0,0 +1,9 @@
version: 2.0
steps:
pre_codecheck:
- checkout
tool_params:
secsolar:
source_dir: ./

10
.depcheckrc.yaml Normal file
View File

@ -0,0 +1,10 @@
ignores:
# Unused dependencies
# Unused devDependencies
# Missing dependencies
ignore-patterns:
- "node_modules"

7
.eslintignore Normal file
View File

@ -0,0 +1,7 @@
dist
runtime
dist2/
dist2.7/
dist3/
node_modules
examples/docs/public/assets/map/js

55
.eslintrc.js Normal file
View File

@ -0,0 +1,55 @@
/* eslint-env node */
/** @type {import('eslint').Linter.Config} */
module.exports = {
extends: ['@antfu', 'plugin:prettier/recommended'],
rules: {
'vue/component-tags-order': [
'error',
{
order: [['script', 'template'], 'style']
}
],
'vue/attribute-hyphenation': 'off',
'vue/v-on-event-hyphenation': 'off',
'vue/order-in-components': 'off',
'vue/component-name-in-template-casing': 'off',
'vue/custom-event-name-casing': 'off',
'vue/quote-props': 'off',
'vue/attributes-order': 'off',
'vue/prop-name-casing': 'off',
'vue/html-self-closing': 'off',
'vue/prefer-separate-static-class': 'off',
'vue/comma-dangle': 'off',
'vue/prefer-template': 'off',
'vue/no-unused-refs': 'off',
'vue/require-component-is': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/no-v-for-template-key-on-child': 'off',
'curly': 'off',
'sort-imports': 'off',
'prefer-template': 'off',
'arrow-parens': 'off',
'operator-linebreak': 'off',
'antfu/if-newline': 'off',
'antfu/top-level-function': 'off',
'import/order': 'off',
'import/no-duplicates': 'off',
'quote-props': 'off',
'prefer-const': 'off',
'multiline-ternary': 'off',
'vue/no-deprecated-v-on-native-modifier': 'off',
'@typescript-eslint/comma-dangle': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/brace-style': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-invalid-this': 'off',
'vue/no-deprecated-dollar-scopedslots-api': 'off'
}
}

6
.gitattributes vendored Normal file
View File

@ -0,0 +1,6 @@
* text=auto eol=lf
*.ts linguist-detectable=false
*.css linguist-detectable=false
*.scss linguist-detectable=false
*.js linguist-detectable=true
*.vue linguist-detectable=true

80
.gitignore vendored Normal file
View File

@ -0,0 +1,80 @@
.DS_Store
node_modules
dist/
dist2/
dist2.7/
dist3/
dist-react/
allDist/
packages/**/runtime
coverage/
test-results
/packages/vue/index.ts
/packages/vue/pc.ts
/packages/vue/mobile.ts
/packages/vue/mobile-first.ts
/packages/vue/app.ts
/packages/vue-icon-saas/src
/packages/vue-icon-saas/index.ts
/packages/vue-runtime/pc.ts
/packages/vue-runtime/mobile.ts
/packages/vue-runtime/mobile-first.ts
/packages/vue-runtime/all.ts
/packages/vue-runtime/simple.ts
/packages/react/index.ts
/packages/react/pc.ts
/packages/react/mobile.ts
/packages/react/app.ts
/packages/react/mobile-first.ts
/examples/**/playwright-report
/examples/**/test-results
vite.config.ts.timestamp*
vitest.config.ts.timestamp*
# local env
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.history
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
*.log
*.stackdump
tgzs
*.tgz
packages/theme/scripts/theme.json
packages/theme/scripts/theme-result.txt
packages/theme/scripts/themeExcel.xlsx
packages/theme/src/theme/*-theme/component.js
pnpm-lock.yaml
gulp/bundle.json
# 屏蔽测试用例报告相关文件
allure-report
allure-results
test-results
# 本地构建的saas相关资源文件
examples/sites/public/tiny-vue*.js
examples/sites/public/tiny-vue*.mjs
examples/sites/public/tailwind.css
examples/sites/public/index.css

16
.hintrc Normal file
View File

@ -0,0 +1,16 @@
{
"extends": [
"development"
],
"hints": {
"compat-api/html": [
"default",
{
"ignore": [
"script[type=module]"
]
}
],
"axe/language": "off"
}
}

36
.husky/_/husky.sh Normal file
View File

@ -0,0 +1,36 @@
#!/usr/bin/env sh
if [ -z "$husky_skip_init" ]; then
debug () {
if [ "$HUSKY_DEBUG" = "1" ]; then
echo "husky (debug) - $1"
fi
}
readonly hook_name="$(basename -- "$0")"
debug "starting $hook_name..."
if [ "$HUSKY" = "0" ]; then
debug "HUSKY env variable is set to 0, skipping hook"
exit 0
fi
if [ -f ~/.huskyrc ]; then
debug "sourcing ~/.huskyrc"
. ~/.huskyrc
fi
readonly husky_skip_init=1
export husky_skip_init
sh -e "$0" "$@"
exitCode="$?"
if [ $exitCode != 0 ]; then
echo "husky - $hook_name hook exited with code $exitCode (error)"
fi
if [ $exitCode = 127 ]; then
echo "husky - command not found in PATH=$PATH"
fi
exit $exitCode
fi

4
.husky/commit-msg Normal file
View File

@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no-install commitlint --edit

4
.husky/pre-commit Normal file
View File

@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx lint-staged

4
.lintstagedrc.json Normal file
View File

@ -0,0 +1,4 @@
{
"*.{js,jsx,ts,tsx,vue}": ["prettier --write", "eslint --fix"],
"*.md": ["prettier --write"]
}

4
.npmrc Normal file
View File

@ -0,0 +1,4 @@
shell-emulator=true
auto-install-peers=true
strict-peer-dependencies=false
enable-pre-post-scripts=true

9
.prettierignore Normal file
View File

@ -0,0 +1,9 @@
dist
dist2
dist2.7
dist3
node_modules
internal/template
internal/runtime
examples/docs/public/static
pnpm-lock.yaml

23
.prettierrc Normal file
View File

@ -0,0 +1,23 @@
{
"semi": false,
"singleQuote": true,
"printWidth": 120,
"trailingComma": "none",
"quoteProps": "preserve",
"endOfLine": "auto",
"bracketSpacing": true,
"jsxBracketSameLine": true,
"jsxSingleQuote": false,
"useTabs": false,
"tabWidth": 2,
"proseWrap": "preserve",
"arrowParens": "always",
"overrides": [
{
"files": ".prettierrc",
"options": {
"parser": "json"
}
}
]
}

11
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,11 @@
{
"recommendations": [
"vue.volar",
"bradlc.vscode-tailwindcss",
"davidanson.vscode-markdownlint",
"dbaeumer.vscode-eslint",
"stylelint.vscode-stylelint",
"ms-playwright.playwright"
],
"unwantedRecommendations": ["esbenp.prettier-vscode", "octref.vetur"]
}

86
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,86 @@
{
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.expand": false,
"explorer.fileNesting.patterns": {
"*.js": "$(capture).js.map, $(capture).*.js",
"*.ts": "$(capture).ts.map, $(capture).*.ts",
"*.tsx": "$(capture).tsx.map, $(capture).*.tsx",
".gitignore": ".gitattributes",
".eslintrc.js": ".eslintignore, .prettierignore, .prettierrc, commitlint.config.js",
"README.md": "*.md, LICENSE",
"tsconfig.json": "tsconfig.*.json, jsconfig.json",
"package.json": ".npmrc, pnpm-workspace.yaml, logo.svg, lerna.json"
},
"editor.quickSuggestions": {
"strings": true
},
"markdownlint.config": {
"no-inline-html": false,
"first-line-heading": false
},
"typescript.tsdk": "node_modules/typescript/lib",
"prettier.enable": true,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"stylelint.validate": ["css", "less", "postcss", "scss", "sass"],
"better-comments.highlightPlainText": true,
"better-comments.tags": [
{
"tag": "#v",
"color": "#FF8C00",
"strikethrough": false,
"underline": false,
"backgroundColor": "transparent",
"bold": false,
"italic": false
},
{
"tag": "!",
"color": "#FF2D00",
"strikethrough": false,
"underline": false,
"backgroundColor": "transparent",
"bold": false,
"italic": false
},
{
"tag": "?",
"color": "#3498DB",
"strikethrough": false,
"underline": false,
"backgroundColor": "transparent",
"bold": false,
"italic": false
},
{
"tag": "//",
"color": "#474747",
"strikethrough": true,
"underline": false,
"backgroundColor": "transparent",
"bold": false,
"italic": false
},
{
"tag": "todo",
"color": "#FF8C00",
"strikethrough": false,
"underline": false,
"backgroundColor": "transparent",
"bold": false,
"italic": false
},
{
"tag": "*",
"color": "#98C379",
"strikethrough": false,
"underline": false,
"backgroundColor": "transparent",
"bold": false,
"italic": false
}
],
"vue.codeActions.enabled": false
}

0
CHANGELOG.md Normal file
View File

148
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,148 @@
# Contributing
We are glad that you are willing to contribute to the TinyVue open source project. There are many forms of contribution, and you can choose one or more of them according to your strengths and interests:
- Report [new defect](https://github.com/opentiny/tiny-vue/issues/new?template=bug-report.yml)
- Provide more detailed information for [existing defects](https://github.com/opentiny/tiny-vue/labels/bug), such as supplementary screenshots, more detailed reproduction steps, minimum reproducible demo links, etc.
- Submit Pull requests to fix typos in the document or make the document clearer and better
- Add the official assistant WeChat `opentiny-official` and join the technical exchange group to participate in the discussion.
When you personally use the TinyVue component library and participate in many of the above contributions, as you become familiar with TinyVue, you can try to do something more challenging, such as:
- Fix defects, you can start with [Good-first issue](https://github.com/opentiny/tiny-vue/labels/good%20first%20issue).
- Implement new features.
- Improve unit testing.
- Translate the document.
- Participate in code review.
## Bug Reports
If you encounter problems in the process of using TinyVue components, you are welcome to submit Issue to us. Before submitting Issue, please read the relevant [official documentation](https://opentiny.design) carefully to confirm whether this is a defect or an unimplemented function.
If it is a defect, select [Bug report](https://github.com/opentiny/tiny-vue/issues/new?template=bug-report.yml) template when creating a new Issue. The title follows the format of `[componentName] defect description`. For example: `[select] filtering function, the selected option cannot be selected again after it has been deleted`.
Issue that reports defects mainly needs to fill in the following information:
- Version numbers of `@opentiny/vue` and `vue`.
- The performance of the defect can be illustrated by screenshot, and if there is an error, the error message can be posted.
- Defect reproduction step, preferably with a minimum reproducible demo link.
If it is a new feature, select [Feature request](https://github.com/opentiny/tiny-vue/issues/new?template=feature-request.yml) template. The title follows the format of `[componentName] new feature description`. For example: `[select] selection box is too long to display, hope to support the configuration of tips prompt`.
The following information is required for the Issue of the new feature:
- What problems does this feature mainly solve for users?
- What is the api of this feature?
## Pull Requests
Before submitting pull request, please make sure that your submission is in line with the overall plan of TinyVue. Generally, issues that marked as [bug](https://github.com/opentiny/tiny-vue/labels/bug) are encouraged to submit pull requests. If you are not sure, you can create a [Discussion](https://github.com/opentiny/tiny-vue/discussions) for discussion.
### Pull Request Specification
#### Commit Message
The commit message should be in the form of a `type(scope): description of the message`, e.g. `fix(vue-renderless): [scrollbar, action-menu] fix xxx bug`.
1. type: must be one of build, chore, ci, docs, feat, fix, perf, refactor, revert, release, style, test, improvement.
2. scope.
- Package names in the `packages` directory, e.g. `vue-design-aurora, vue-design-saas, react ......`
- Component name under the package name in the `packages` directory, e.g., `vue-design-aurora/alert, vue-design-saas/alert, react/alert ......`
- The name of the folder to use: e.g.: `gulp, internals/playwright-config, sites`
- The name of the component (lowercase, center dot): e.g.: `action-menu, alert ......`
#### Pull Request Title
1. The specification of the title is the same as the commit information, which is entered in the form of `type(scope): description information`.
2. **e2e test** of trigger components: Adding '[componentName1, componentName2]' to the Pull Request title will execute test cases for componentName1, componentName2, and declare this structure when changes to code affect components.
- Note: The `github action` in this project identifies test e2e use cases to be executed by matching the component names declared by `[componentName1, componentName2]` with the path names in the `examples/sites/demos` directory. (Because running the full test case is too time consuming)
- When modifying a sub-component of a component, such as the `col` component, which has no corresponding examples and test cases, the `layout` component should be tested, because the `col` component is a sub-component of the `layout` component. The PR title can be: `fix(col): [layout] xxxxxxxxxxxxxx`
3. Example title:
- Supplement alert component document: `docs(alert): [alert] xxxxxxxxxxxxxxx`, `docs(site): [alert] xxxxxxxxxxxxxxx`
- Supplement alet component test case: `test(alert): [alert] xxxxxxxxxxxxxx`
- Fixed bug in alet component @opentiny/vue-renderless: `fix(vue-renderless/alert): [alert] xxxxxxxxxxxxxx`
#### Pull Request Description
The PR description uses a template, and it is necessary to fill in the relevant information of the PR according to the template, mainly including:
- PR Checklist: Whether the Commit information is compliant with the specifications, whether it supplements the E2E test cases, and whether it supplements the documentation
- PR Type: Bugfix / Feature / Code style update / Refactoring and so on
- Issue Number
- Does this PR introduce a breaking change?
### Local Startup Steps
- Click the Fork button in the upper right corner of the [TinyVue](https://github.com/opentiny/tiny-vue) code repository to Fork the upstream repository to the personal repository.
- Clone personal repository to local.
- Associated with the upstream repository to facilitate the synchronization of the latest code of the upstream repository.
- Run `pnpm i` under the TinyVue root directory to install node dependencies.
- Run `pnpm dev` to launch the component library website.
- Open the browser to visit: [http://127.0.0.1:7130/](http://127.0.0.1:7130/)
```shell
# You need to replace username with your own user name
git clone git@github.com:username/tiny-vue.git
cd tiny-vue
# Associate upstream repository
git remote add upstream git@github.com:opentiny/tiny-vue.git
# Installation
pnpm i
# Launch Vue.js 3
pnpm dev
# Launch Vue.js 2
pnpm dev:vue2
```
### Submit a PR
- Make sure that you have completed the steps in local startup and can visit [http://127.0.0.1:7130/](http://127.0.0.1:7130/) normally.
- Synchronize upstream repository dev branch latest code: `git pull upstream dev`.
- Create a new branch `git checkout-b username/feature1 upstream/ dev` from the upstream repository dev branch. The name of the branch should be `username/feat- xxx` / `username/fix- xxx`.
- Local coding.
- Submit according to [Commit Message Format](https://www.conventionalcommits.org/zh-hans/v1.0.0/) specification. PR that do not conform to the submission specification will not be merged.
- Submit to remote repository: `git push origin branchName`.
- Open the [Pull requests](https://github.com/opentiny/tiny-vue/pulls) link of the TinyVue code repository and click the New pull request button to submit the PR.
- According to the PR template, please provide the following information: PR self-check items, PR type, related Issue ID, whether it is a destructive change.
- Project Committer conducts Code Review and makes comments.
- The PR author adjusts the code according to the opinion. Please note that when a branch initiates PR, the subsequent commit will be synchronized automatically, and there is no need to resubmit the PR.
- Project administrator merges PR.
The contribution process is over, thank you for your contribution!
## Join OpenTiny Community
If you are interested in our open source project, you are welcome to join our open source community in the following ways.
- Add official assistant WeChat: opentiny-official to join our technical exchange group.
- Add to the mailing list: <opentiny@googlegroups.com>
If you have submitted Issue or PR to OpenTiny, you can comment on Issue or Pull Request, asking @all-contributors to add a contributor:
```
@all-contributors please add @<username> for <contributions>
```
For detailed rules, please refer to [https://allcontributors.org/docs/en/bot/usage](https://allcontributors.org/docs/en/bot/usage)
## Contributors
We sincerely thank all the contributors who have participated in the TinyVue project!
In recognition of the contributions of our contributors, we have added a 'Contributors' section at the bottom of each component documentation, displaying the GitHub information of each contributor, including their profile picture, username, and GitHub personal page.
Due to the current manpower constraints, only information of internal members (or former members) of the TinyVue team is currently being recorded. Open source contributors are welcome to supplement their own information.
The file that record contributors info is:
```
/examples/sites/src/data/contributorMap.js
```

147
CONTRIBUTING.zh-CN.md Normal file
View File

@ -0,0 +1,147 @@
# 贡献指南
很高兴你有意愿参与 TinyVue 开源项目的贡献,参与贡献的形式有很多种,你可以根据自己的特长和兴趣选择其中的一个或多个:
- 报告[新缺陷](https://github.com/opentiny/tiny-vue/issues/new?template=bug-report.yml)
- 为[已有缺陷](https://github.com/opentiny/tiny-vue/labels/bug)提供更详细的信息,比如补充截图、提供更详细的复现步骤、提供最小可复现 demo 链接等
- 提交 Pull requests 修复文档中的错别字或让文档更清晰和完善
- 添加官方小助手微信 opentiny-official加入技术交流群参与讨论
当你亲自使用 TinyVue 组件库,并参与多次以上形式的贡献,对 TinyVue 逐渐熟悉之后,可以尝试做一些更有挑战的事情,比如:
- 修复缺陷,可以先从 [Good-first issue](https://github.com/opentiny/tiny-vue/labels/good%20first%20issue) 开始
- 实现新特性
- 完善单元测试
- 翻译文档
- 参与代码检视
## 提交 Issue
如果你在使用 TinyVue 组件过程中遇到问题,欢迎给我们提交 Issue提交 Issue 之前,请先仔细阅读相关的[官方文档](https://opentiny.design),确认这是一个缺陷还是尚未实现的功能。
如果是一个缺陷,创建新 Issue 时选择 [Bug report](https://github.com/opentiny/tiny-vue/issues/new?template=bug-report.yml) 模板,标题遵循 `[componentName]缺陷简述` 的格式,比如:`[select]过滤功能中,选中的选项退格删除后,无法再次选中该选项`。
报告缺陷的 Issue 主要需要填写以下信息:
- tiny-vue 和 vue 的版本号
- 缺陷的表现,可截图辅助说明,如果有报错可贴上报错信息
- 缺陷的复现步骤,最好能提供一个最小可复现 demo 链接
如果是一个新特性,则选择 [Feature request](https://github.com/opentiny/tiny-vue/issues/new?template=feature-request.yml) 模板,标题遵循 `[componentName]新特性简述` 的格式,比如:`[select]选择框内容太长展示不下时希望能支持配置tips提示`。
新特性的 Issue 主要需要填写以下信息:
- 该特性主要解决用户的什么问题
- 该特性的 api 是什么样的
## 提交 PR
提交 PR 之前,请先确保你提交的内容是符合 TinyVue 整体规划的,一般已经标记为 [bug](https://github.com/opentiny/tiny-vue/labels/bug) 的 Issue 是鼓励提交 PR 的,如果你不是很确定,可以创建一个 [Discussion](https://github.com/opentiny/tiny-vue/discussions) 进行讨论。
### Pull Request 规范
#### Commit 信息
commit 信息要以 `type(scope): 描述信息` 的形式填写,例如 `fix(vue-renderless): [scrollbar, action-menu] fix xxx bug`
1. type: 必须是 build, chore, ci, docs, feat, fix, perf, refactor, revert, release, style, test, improvement 其中的一个。
2. scope:
- `packages`目录下的包名,比如:`vue-design-aurora, vue-design-saas, react ......`
- `packages`目录下的包名下的组件名,比如:`vue-design-aurora/alert, vue-design-saas/alert, react/alert ......`
- 用文件夹的名称: 比如: `gulp, internals/playwright-config, sites`
- 组件的名称(小写,中划线): 比如: `action-menu, alert ......`
#### Pull Request 的标题
1. 标题的规范与 commit 信息一样,以`type(scope): 描述信息` 的形式填写。
2. 触发组件的 **e2e 测试**: 在 Pull Request 标题里添加 `[componentName1, componentName2]`,将会执行 componentName1componentName2 的测试用例,当改动的代码会影响组件时,需要声明这个结构。
- 注:本项目下的 `github action` 会用`[componentName1, componentName2]`声明的组件名匹配 `examples/sites/demos` 目录下的路径名称识别要执行的测试e2e用例。因为全量跑测试用例太耗费时间
- 当修改了某个组件的子组件,比如`col`组件,它本身没有对应的示例以及测试用例,这时应该要测试的是`layout`组件,因为`col`组件是`layout`组件的子组件PR 标题可以这样: `fix(col): [layout] xxxxxxxxxxxxxx`
3. 标题示例:
- 补充 alert 组件文档: `docs(alert): [alert] xxxxxxxxxxxxxxx`, `docs(site): [alert] xxxxxxxxxxxxxxx`
- 补充 alet 组件测试用例: `test(alert): [alert] xxxxxxxxxxxxxx`
- 修复 alet 组件 @opentiny/vue-renderless 下的缺陷: `fix(vue-renderless/alert): [alert] xxxxxxxxxxxxxx`
#### Pull Request 的描述
PR 描述使用了模板,需要按照模板填写 PR 相关信息,主要包括:
- PR 自检项Commit 信息是够符合规范、是否补充了 E2E 测试用例、是否补充了文档
- PR 类型:缺陷修复、新特性、代码格式调整、重构等
- 关联的 Issue 编号
- 是否包含破坏性变更
### 本地启动步骤
- 点击 [TinyVue](https://github.com/opentiny/tiny-vue) 代码仓库右上角的 Fork 按钮,将上游仓库 Fork 到个人仓库
- Clone 个人仓库到本地
- 关联上游仓库,方便同步上游仓库最新代码
- 在 Tiny Vue 根目录下运行 `pnpm i`, 安装 node 依赖
- 运行 `pnpm dev`,启动组件库网站
- 打开浏览器访问:[http://127.0.0.1:7130/](http://127.0.0.1:7130/)
```shell
# username 为用户名,执行前请替换
git clone git@github.com:username/tiny-vue.git
cd tiny-vue
# 关联上游仓库
git remote add upstream git@github.com:opentiny/tiny-vue.git
# 安装依赖
pnpm i
# 启动 Vue3 项目
pnpm dev
# 启动 Vue2 项目
pnpm dev:vue2
```
### 提交 PR 的步骤
- 请确保你已经完成本地启动中的步骤,并能正常访问:[http://127.0.0.1:7130/](http://127.0.0.1:7130/)
- 同步上游仓库 dev 分支最新代码git pull upstream dev
- 从上游仓库 dev 分支创建新分支 `git checkout -b username/feature1 upstream/dev`,分支名字建议为 `username/feat-xxx` / `username/fix-xxx`
- 本地编码
- 遵循 [Commit Message Format](https://www.conventionalcommits.org/zh-hans/v1.0.0/) 规范进行提交,不符合提交规范的 PR 将不会被合并
- 提交到远程仓库git push origin branchName
- 打开 TinyVue 代码仓库的 [Pull requests](https://github.com/opentiny/tiny-vue/pulls) 链接,点击 New pull request 按钮提交 PR
- 按照 PR 模板补充相关信息,包括 PR 自检项、PR 类型、关联的 Issue 编号、是否是破坏性变更
- 项目 Committer 进行 Code Review并提出意见
- PR 作者根据意见调整代码,请注意一个分支发起了 PR 后,后续的 commit 会自动同步,无需重新提交 PR
- 项目管理员合并 PR
贡献流程结束,感谢你的贡献!
## 加入开源社区
如果你对我们的开源项目感兴趣,欢迎通过以下方式加入我们的开源社区。
- 添加官方小助手微信opentiny-official加入我们的技术交流群
- 加入邮件列表:<opentiny@googlegroups.com>
如果你给 OpenTiny 提交过 Issue 或 PR请通过以下方式添加自己到贡献者列表里。
```
@all-contributors please add @<username> for <contributions>
```
详细规则可以参考:[https://allcontributors.org/docs/en/bot/usage](https://allcontributors.org/docs/en/bot/usage)
## 贡献者
我们诚挚感谢每位参与过TinyVue项目的贡献者们
为彰显贡献者们的付出我们在每个组件文档底部增加“贡献者”模块陈列各位贡献者的github信息包括头像、昵称、github个人主页等。由于当前团队人力较为紧张目前只录入TinyVue团队内部成员或前组员信息欢迎各位开源贡献者自行补充信息。
贡献者信息记录的文件路径为:
```
/examples/sites/src/data/contributorMap.js
```

22
LICENSE Normal file
View File

@ -0,0 +1,22 @@
MIT License
Copyright (c) 2022 - present TinyVue Authors.
Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

191
README.md Normal file
View File

@ -0,0 +1,191 @@
<p align="center">
<a href="https://opentiny.design/tiny-vue" target="_blank" rel="noopener noreferrer">
<img alt="OpenTiny Logo" src="logo.svg" height="100" style="max-width:100%;">
</a>
</p>
<p align="center">An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.</p>
English | [简体中文](README.zh-CN.md)
🌈 Features:
- 📦 104 clean, easy-to-use and powerful components.
- 🖖 One code, Support both Vue.js 2 and Vue.js 3.
- 🖥️ One code, Support both PC and Mobile.
- 🌍 Support internationalization.
- 🎨 Support theme customization.
- 📊 Components support configuration development, can support low-code platform.
- 💡 Use a cross-end and cross-framework architecture, flexible and portable.
## 🛠️ Usage
### 1. Installation
Execute the following command to install the TinyVue component library for Vue.js 3.
```shell
npm i @opentiny/vue@3
```
Execute the following command to install the TinyVue component library for Vue.js 2.
```shell
npm i @opentiny/vue@2
```
### 2. Import component
Then you can use the TinyVue component(such as `<tiny-button>`) in the `App.vue` file.
```html
<script lang="ts" setup>
import { Button as TinyButton } from '@opentiny/vue'
</script>
<template>
<tiny-button>Tiny Vue</tiny-button>
</template>
```
## 🖥️ Development
```shell
git clone git@github.com:opentiny/tiny-vue.git
cd tiny-vue
pnpm i
# Vue.js 3
pnpm dev
# Vue.js 2
pnpm dev2
```
Open your browser and visit: [http://127.0.0.1:7130/](http://127.0.0.1:7130/)
## 🤝 Contributing
Welcome to join our OpenTiny community!🎉
If you don't know how to start, please read our [contributing guide](CONTRIBUTING.md).
- Add the official assistant WeChat `opentiny-official` and join the technical exchange group.
- Add to the mailing list `opentiny@googlegroups.com`
## ✨ Contributors
Contributors are community members who have 1 or more PR merged in OpenTiny.
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tbody>
<tr>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/kagol"><img src="https://avatars.githubusercontent.com/u/9566362?v=4?s=100" width="100px;" alt="Kagol"/><br /><sub><b>Kagol</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=kagol" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/zzcr"><img src="https://avatars.githubusercontent.com/u/18521562?v=4?s=100" width="100px;" alt="ajaxzheng"/><br /><sub><b>ajaxzheng</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=zzcr" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/TC-twwang"><img src="https://avatars.githubusercontent.com/u/42400776?v=4?s=100" width="100px;" alt="TC-twwang"/><br /><sub><b>TC-twwang</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=TC-twwang" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/MNZhu"><img src="https://avatars.githubusercontent.com/u/17588953?v=4?s=100" width="100px;" alt="jacknan"/><br /><sub><b>jacknan</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=MNZhu" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/awspi"><img src="https://avatars.githubusercontent.com/u/66438036?v=4?s=100" width="100px;" alt="Pithy"/><br /><sub><b>Pithy</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=awspi" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/heygsc"><img src="https://avatars.githubusercontent.com/u/103993866?v=4?s=100" width="100px;" alt="heygsc"/><br /><sub><b>heygsc</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=heygsc" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/wwttff"><img src="https://avatars.githubusercontent.com/u/32888622?v=4?s=100" width="100px;" alt="MangoWu"/><br /><sub><b>MangoWu</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=wwttff" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/ErKeLost"><img src="https://avatars.githubusercontent.com/u/66500121?v=4?s=100" width="100px;" alt="ADNY"/><br /><sub><b>ADNY</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=ErKeLost" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/chenxi-20"><img src="https://avatars.githubusercontent.com/u/76168465?v=4?s=100" width="100px;" alt="chenxi-20"/><br /><sub><b>chenxi-20</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=chenxi-20" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/rayhaoqin"><img src="https://avatars.githubusercontent.com/u/46983981?v=4?s=100" width="100px;" alt="Alaray"/><br /><sub><b>Alaray</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=rayhaoqin" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/yuanningning"><img src="https://avatars.githubusercontent.com/u/104059491?v=4?s=100" width="100px;" alt="ing"/><br /><sub><b>ing</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=yuanningning" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/shenjunjian"><img src="https://avatars.githubusercontent.com/u/6848520?v=4?s=100" width="100px;" alt="申君健"/><br /><sub><b>申君健</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=shenjunjian" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/MomoPoppy"><img src="https://avatars.githubusercontent.com/u/125256456?v=4?s=100" width="100px;" alt="MomoPoppy"/><br /><sub><b>MomoPoppy</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=MomoPoppy" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/WXC-Spring"><img src="https://avatars.githubusercontent.com/u/131581326?v=4?s=100" width="100px;" alt="WXC-Spring"/><br /><sub><b>WXC-Spring</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=WXC-Spring" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/GaoNeng-wWw"><img src="https://avatars.githubusercontent.com/u/31283122?v=4?s=100" width="100px;" alt="GaoNeng"/><br /><sub><b>GaoNeng</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=GaoNeng-wWw" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://acyza.github.io"><img src="https://avatars.githubusercontent.com/u/101238421?v=4?s=100" width="100px;" alt="acyza"/><br /><sub><b>acyza</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=acyza" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/ygj6"><img src="https://avatars.githubusercontent.com/u/7699524?v=4?s=100" width="100px;" alt="ygj6"/><br /><sub><b>ygj6</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=ygj6" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/MrWang2016"><img src="https://avatars.githubusercontent.com/u/24307164?v=4?s=100" width="100px;" alt="MrWang2016"/><br /><sub><b>MrWang2016</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=MrWang2016" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/qinwencheng"><img src="https://avatars.githubusercontent.com/u/24841685?v=4?s=100" width="100px;" alt="qinwencheng"/><br /><sub><b>qinwencheng</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=qinwencheng" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/Huangyilin19"><img src="https://avatars.githubusercontent.com/u/48042709?v=4?s=100" width="100px;" alt="黄怡林"/><br /><sub><b>黄怡林</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=Huangyilin19" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/zuixinwang"><img src="https://avatars.githubusercontent.com/u/59717852?v=4?s=100" width="100px;" alt="zuixinwang"/><br /><sub><b>zuixinwang</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=zuixinwang" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/LadyChatterleyLover"><img src="https://avatars.githubusercontent.com/u/35223515?v=4?s=100" width="100px;" alt="luopei"/><br /><sub><b>luopei</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=LadyChatterleyLover" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://juejin.cn/user/1996368846785128"><img src="https://avatars.githubusercontent.com/u/31237954?v=4?s=100" width="100px;" alt="前端爆冲"/><br /><sub><b>前端爆冲</b></sub></a><br /><a href="#infra-brenner8023" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/xiejay97"><img src="https://avatars.githubusercontent.com/u/64340763?v=4?s=100" width="100px;" alt="Xie Jay"/><br /><sub><b>Xie Jay</b></sub></a><br /><a href="#infra-xiejay97" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
</tr>
<tr>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/linxiang07"><img src="https://avatars.githubusercontent.com/u/40119767?v=4?s=100" width="100px;" alt="linxiang"/><br /><sub><b>linxiang</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=linxiang07" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://bollome.netlify.app/"><img src="https://avatars.githubusercontent.com/u/103836393?v=4?s=100" width="100px;" alt="程序员包子"/><br /><sub><b>程序员包子</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=coderbaozi" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/pe-3"><img src="https://avatars.githubusercontent.com/u/103579791?v=4?s=100" width="100px;" alt="peter G"/><br /><sub><b>peter G</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=pe-3" title="Code">💻</a> <a href="https://github.com/opentiny/tiny-vue/commits?author=pe-3" title="Documentation">📖</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/gimmyhehe"><img src="https://avatars.githubusercontent.com/u/26026184?v=4?s=100" width="100px;" alt="gimmyhehe"/><br /><sub><b>gimmyhehe</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=gimmyhehe" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/KevinAndrewDong"><img src="https://avatars.githubusercontent.com/u/20911103?v=4?s=100" width="100px;" alt="dong"/><br /><sub><b>dong</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=KevinAndrewDong" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="http://www.linglan01.cn"><img src="https://avatars.githubusercontent.com/u/58327088?v=4?s=100" width="100px;" alt="凌览"/><br /><sub><b>凌览</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=CatsAndMice" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/Caesar-ch"><img src="https://avatars.githubusercontent.com/u/74941512?v=4?s=100" width="100px;" alt="Caesar-ch"/><br /><sub><b>Caesar-ch</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=Caesar-ch" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/chenqifeng66"><img src="https://avatars.githubusercontent.com/u/97503755?v=4?s=100" width="100px;" alt="chenqifeng66"/><br /><sub><b>chenqifeng66</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=chenqifeng66" title="Tests">⚠️</a></td>
</tr>
<tr>
<td align="center" valign="top" width="12.5%"><a href="https://zz-zzzz.github.io/"><img src="https://avatars.githubusercontent.com/u/48228016?v=4?s=100" width="100px;" alt="Zz-ZzzZ"/><br /><sub><b>Zz-ZzzZ</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=Zz-ZzzZ" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/lyx-jay"><img src="https://avatars.githubusercontent.com/u/39766860?v=4?s=100" width="100px;" alt="Lyx"/><br /><sub><b>Lyx</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=lyx-jay" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/chenguang1994"><img src="https://avatars.githubusercontent.com/u/31501915?v=4?s=100" width="100px;" alt="Spark Bill"/><br /><sub><b>Spark Bill</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=chenguang1994" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/Zuowendong"><img src="https://avatars.githubusercontent.com/u/45628596?v=4?s=100" width="100px;" alt="wendZzoo"/><br /><sub><b>wendZzoo</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=Zuowendong" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/gweesin"><img src="https://avatars.githubusercontent.com/u/42909374?v=4?s=100" width="100px;" alt="Gweesin Chan"/><br /><sub><b>Gweesin Chan</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=gweesin" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/Binks123"><img src="https://avatars.githubusercontent.com/u/103343025?v=4?s=100" width="100px;" alt="Binks_"/><br /><sub><b>Binks_</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=Binks123" title="Documentation">📖</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/yoyo201626"><img src="https://avatars.githubusercontent.com/u/104079404?v=4?s=100" width="100px;" alt="yoyo"/><br /><sub><b>yoyo</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=yoyo201626" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://hexo.kifroom.icu/"><img src="https://avatars.githubusercontent.com/u/62132584?v=4?s=100" width="100px;" alt="Kif"/><br /><sub><b>Kif</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=wkif" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/jack-zishan"><img src="https://avatars.githubusercontent.com/u/67041206?v=4?s=100" width="100px;" alt="jack-zishan"/><br /><sub><b>jack-zishan</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=jack-zishan" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="http://gradii.com"><img src="https://avatars.githubusercontent.com/u/5467712?v=4?s=100" width="100px;" alt="LinboLen"/><br /><sub><b>LinboLen</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=LinboLen" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/vaebe"><img src="https://avatars.githubusercontent.com/u/52314078?v=4?s=100" width="100px;" alt="vaebe"/><br /><sub><b>vaebe</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=vaebe" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://allenli178.top"><img src="https://avatars.githubusercontent.com/u/53218750?v=4?s=100" width="100px;" alt="YuYan Li"/><br /><sub><b>YuYan Li</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=allenli178" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/shonen7"><img src="https://avatars.githubusercontent.com/u/145949377?v=4?s=100" width="100px;" alt="shonen7"/><br /><sub><b>shonen7</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=shonen7" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/xlearns"><img src="https://avatars.githubusercontent.com/u/62782792?v=4?s=100" width="100px;" alt="xlearns"/><br /><sub><b>xlearns</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=xlearns" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/ianxinnew"><img src="https://avatars.githubusercontent.com/u/146069396?v=4?s=100" width="100px;" alt="tianxin"/><br /><sub><b>tianxin</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=ianxinnew" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/Xppp0217"><img src="https://avatars.githubusercontent.com/u/82315158?v=4?s=100" width="100px;" alt="Xppp0217"/><br /><sub><b>Xppp0217</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=Xppp0217" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/AcWrong02"><img src="https://avatars.githubusercontent.com/u/147061401?v=4?s=100" width="100px;" alt="AcWrong02"/><br /><sub><b>AcWrong02</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/issues?q=author%3AAcWrong02" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/betavs"><img src="https://avatars.githubusercontent.com/u/34408516?v=4?s=100" width="100px;" alt="betavs"/><br /><sub><b>betavs</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=betavs" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/fanbingbing16"><img src="https://avatars.githubusercontent.com/u/84823288?v=4?s=100" width="100px;" alt="fanbingbing16"/><br /><sub><b>fanbingbing16</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=fanbingbing16" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/dyh333"><img src="https://avatars.githubusercontent.com/u/1221313?v=4?s=100" width="100px;" alt="dyh333"/><br /><sub><b>dyh333</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=dyh333" title="Documentation">📖</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/betterdancing"><img src="https://avatars.githubusercontent.com/u/25901461?v=4?s=100" width="100px;" alt="betterdancing"/><br /><sub><b>betterdancing</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=betterdancing" title="Documentation">📖</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/David-TechNomad"><img src="https://avatars.githubusercontent.com/u/23149356?v=4?s=100" width="100px;" alt="David"/><br /><sub><b>David</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=David-TechNomad" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/falcon-jin"><img src="https://avatars.githubusercontent.com/u/48880836?v=4?s=100" width="100px;" alt="falcon-jin"/><br /><sub><b>falcon-jin</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=falcon-jin" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/wuyiping0628"><img src="https://avatars.githubusercontent.com/u/42107997?v=4?s=100" width="100px;" alt="wuyiping0628"/><br /><sub><b>wuyiping0628</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=wuyiping0628" title="Tests">⚠️</a></td>
</tr>
<tr>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/James-9696"><img src="https://avatars.githubusercontent.com/u/72028410?v=4?s=100" width="100px;" alt="James"/><br /><sub><b>James</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=James-9696" title="Documentation">📖</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://gitee.com/ichynul"><img src="https://avatars.githubusercontent.com/u/10061650?v=4?s=100" width="100px;" alt="ichynul"/><br /><sub><b>ichynul</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=ichynul" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/Davont"><img src="https://avatars.githubusercontent.com/u/28757633?v=4?s=100" width="100px;" alt="Davont"/><br /><sub><b>Davont</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=Davont" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/wNing50"><img src="https://avatars.githubusercontent.com/u/38874640?v=4?s=100" width="100px;" alt="Nick Wu"/><br /><sub><b>Nick Wu</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=wNing50" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/Floyd-bit"><img src="https://avatars.githubusercontent.com/u/59243597?v=4?s=100" width="100px;" alt="Floyd"/><br /><sub><b>Floyd</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=Floyd-bit" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/Jevin0"><img src="https://avatars.githubusercontent.com/u/69580637?v=4?s=100" width="100px;" alt="Jevin"/><br /><sub><b>Jevin</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=Jevin0" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/HAOUEHF"><img src="https://avatars.githubusercontent.com/u/107133502?v=4?s=100" width="100px;" alt="星河"/><br /><sub><b>星河</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=HAOUEHF" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/RanierYu"><img src="https://avatars.githubusercontent.com/u/62528887?v=4?s=100" width="100px;" alt="Ranier Yu"/><br /><sub><b>Ranier Yu</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=RanierYu" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/Zcating"><img src="https://avatars.githubusercontent.com/u/13329558?v=4?s=100" width="100px;" alt="Zcating"/><br /><sub><b>Zcating</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=Zcating" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/trueLoving"><img src="https://avatars.githubusercontent.com/u/44056372?v=4?s=100" width="100px;" alt="Aoi Kaze"/><br /><sub><b>Aoi Kaze</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=trueLoving" title="Tests">⚠️</a></td>
</tr>
</tbody>
</table>
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
## ❤️ Credits
Thanks to:
- The [element](https://github.com/ElemeFE/element) project which is an old component library based on Vue.js. TinyVue draws on Element at the beginning of its design, and is compatible with Element's component API.
- The [floating-ui](https://github.com/floating-ui/floating-ui) project which is a small library that helps you create "floating" elements such as tooltips, popovers, dropdowns, and more. Many components of TinyVue are based on the capabilities provided by Floating UI.
- The [vxe-table](https://github.com/x-extends/vxe-table) project which is a Vue-based table component, supports rich features, TinyVue's Grid component is based on vxe-table.
- The [sortablejs](https://github.com/SortableJS/Sortable) project which is a powerful drag-and-drop library. The drag-and-drop sorting function of TinyVue's Grid / Transfer / Tabs and other components is based on Sortable.
- [@adamwathan](https://github.com/adamwathan)'s article [Renderless Components in Vue.js](https://adamwathan.me/renderless-components-in-vuejs/), which inspired TinyVue's renderless component design architecture and ultimately enabled cross-end and cross-framework capabilities in the TinyVue project.
## License
[MIT](LICENSE)

180
README.zh-CN.md Normal file
View File

@ -0,0 +1,180 @@
<p align="center">
<a href="https://opentiny.design/tiny-vue" target="_blank" rel="noopener noreferrer">
<img alt="OpenTiny Logo" src="logo.svg" height="100" style="max-width:100%;">
</a>
</p>
<p align="center">一套跨端、跨框架的企业级 UI 组件库,支持 Vue 2 和 Vue 3支持 PC 端和移动端。</p>
[English](README.md) | 简体中文
🌈 特性:
- 📦 包含 104 个简洁、易用、功能强大的组件
- 🖖 一套代码同时支持 Vue 2 和 Vue 3
- 🖥️ 一套代码同时支持 PC 端和移动端
- 🌍 支持国际化
- 🎨 支持主题定制
- 📊 组件内部支持配置式开发,可支持低代码平台可视化组件配置
- 💡 采用模板、样式、逻辑分离的跨端、跨框架架构,保障灵活性和可移植性
## 🛠️ 如何使用
### 1. 安装
执行以下命令,安装 Vue 3 版本的 TinyVue 组件库:
```shell
npm i @opentiny/vue@3
```
执行以下命令,安装 Vue 2 版本的 TinyVue 组件库:
```shell
npm i @opentiny/vue@2
```
### 2. 引入和使用
在`App.vue`文件中使用 TinyVue 组件。
```html
<script lang="ts" setup>
import { Button as TinyButton } from '@opentiny/vue'
</script>
<template>
<tiny-button>TinyVue</tiny-button>
</template>
```
## 🖥️ 本地开发
```shell
git clone git@github.com:opentiny/tiny-vue.git
cd tiny-vue
pnpm i
# 启动 Vue3 项目
pnpm dev
# 启动 Vue2 项目
pnpm dev2
```
打开浏览器访问:[http://127.0.0.1:7130/](http://127.0.0.1:7130/)
## 🤝 参与贡献
如果你对我们的开源项目感兴趣,欢迎加入我们!🎉
参与贡献之前请先阅读[贡献指南](CONTRIBUTING.zh-CN.md)。
- 添加官方小助手微信 opentiny-official加入技术交流群
- 加入邮件列表 opentiny@googlegroups.com
## ✨ 贡献者
贡献者是在 OpenTiny 社区中合并了 1 个或多个 PR 的社区成员。
感谢以下 OpenTiny 的贡献者们 ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tbody>
<tr>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/kagol"><img src="https://avatars.githubusercontent.com/u/9566362?v=4?s=100" width="100px;" alt="Kagol"/><br /><sub><b>Kagol</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=kagol" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/zzcr"><img src="https://avatars.githubusercontent.com/u/18521562?v=4?s=100" width="100px;" alt="ajaxzheng"/><br /><sub><b>ajaxzheng</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=zzcr" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/TC-twwang"><img src="https://avatars.githubusercontent.com/u/42400776?v=4?s=100" width="100px;" alt="TC-twwang"/><br /><sub><b>TC-twwang</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=TC-twwang" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/MNZhu"><img src="https://avatars.githubusercontent.com/u/17588953?v=4?s=100" width="100px;" alt="jacknan"/><br /><sub><b>jacknan</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=MNZhu" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/awspi"><img src="https://avatars.githubusercontent.com/u/66438036?v=4?s=100" width="100px;" alt="Pithy"/><br /><sub><b>Pithy</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=awspi" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/heygsc"><img src="https://avatars.githubusercontent.com/u/103993866?v=4?s=100" width="100px;" alt="heygsc"/><br /><sub><b>heygsc</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=heygsc" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/wwttff"><img src="https://avatars.githubusercontent.com/u/32888622?v=4?s=100" width="100px;" alt="MangoWu"/><br /><sub><b>MangoWu</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=wwttff" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/ErKeLost"><img src="https://avatars.githubusercontent.com/u/66500121?v=4?s=100" width="100px;" alt="ADNY"/><br /><sub><b>ADNY</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=ErKeLost" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/chenxi-20"><img src="https://avatars.githubusercontent.com/u/76168465?v=4?s=100" width="100px;" alt="chenxi-20"/><br /><sub><b>chenxi-20</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=chenxi-20" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/rayhaoqin"><img src="https://avatars.githubusercontent.com/u/46983981?v=4?s=100" width="100px;" alt="Alaray"/><br /><sub><b>Alaray</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=rayhaoqin" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/yuanningning"><img src="https://avatars.githubusercontent.com/u/104059491?v=4?s=100" width="100px;" alt="ing"/><br /><sub><b>ing</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=yuanningning" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/shenjunjian"><img src="https://avatars.githubusercontent.com/u/6848520?v=4?s=100" width="100px;" alt="申君健"/><br /><sub><b>申君健</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=shenjunjian" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/MomoPoppy"><img src="https://avatars.githubusercontent.com/u/125256456?v=4?s=100" width="100px;" alt="MomoPoppy"/><br /><sub><b>MomoPoppy</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=MomoPoppy" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/WXC-Spring"><img src="https://avatars.githubusercontent.com/u/131581326?v=4?s=100" width="100px;" alt="WXC-Spring"/><br /><sub><b>WXC-Spring</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=WXC-Spring" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/GaoNeng-wWw"><img src="https://avatars.githubusercontent.com/u/31283122?v=4?s=100" width="100px;" alt="GaoNeng"/><br /><sub><b>GaoNeng</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=GaoNeng-wWw" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://acyza.github.io"><img src="https://avatars.githubusercontent.com/u/101238421?v=4?s=100" width="100px;" alt="acyza"/><br /><sub><b>acyza</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=acyza" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/ygj6"><img src="https://avatars.githubusercontent.com/u/7699524?v=4?s=100" width="100px;" alt="ygj6"/><br /><sub><b>ygj6</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=ygj6" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/MrWang2016"><img src="https://avatars.githubusercontent.com/u/24307164?v=4?s=100" width="100px;" alt="MrWang2016"/><br /><sub><b>MrWang2016</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=MrWang2016" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/qinwencheng"><img src="https://avatars.githubusercontent.com/u/24841685?v=4?s=100" width="100px;" alt="qinwencheng"/><br /><sub><b>qinwencheng</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=qinwencheng" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/Huangyilin19"><img src="https://avatars.githubusercontent.com/u/48042709?v=4?s=100" width="100px;" alt="黄怡林"/><br /><sub><b>黄怡林</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=Huangyilin19" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/zuixinwang"><img src="https://avatars.githubusercontent.com/u/59717852?v=4?s=100" width="100px;" alt="zuixinwang"/><br /><sub><b>zuixinwang</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=zuixinwang" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/LadyChatterleyLover"><img src="https://avatars.githubusercontent.com/u/35223515?v=4?s=100" width="100px;" alt="luopei"/><br /><sub><b>luopei</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=LadyChatterleyLover" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://juejin.cn/user/1996368846785128"><img src="https://avatars.githubusercontent.com/u/31237954?v=4?s=100" width="100px;" alt="前端爆冲"/><br /><sub><b>前端爆冲</b></sub></a><br /><a href="#infra-brenner8023" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/xiejay97"><img src="https://avatars.githubusercontent.com/u/64340763?v=4?s=100" width="100px;" alt="Xie Jay"/><br /><sub><b>Xie Jay</b></sub></a><br /><a href="#infra-xiejay97" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
</tr>
<tr>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/linxiang07"><img src="https://avatars.githubusercontent.com/u/40119767?v=4?s=100" width="100px;" alt="linxiang"/><br /><sub><b>linxiang</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=linxiang07" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://bollome.netlify.app/"><img src="https://avatars.githubusercontent.com/u/103836393?v=4?s=100" width="100px;" alt="程序员包子"/><br /><sub><b>程序员包子</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=coderbaozi" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/pe-3"><img src="https://avatars.githubusercontent.com/u/103579791?v=4?s=100" width="100px;" alt="peter G"/><br /><sub><b>peter G</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=pe-3" title="Code">💻</a> <a href="https://github.com/opentiny/tiny-vue/commits?author=pe-3" title="Documentation">📖</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/gimmyhehe"><img src="https://avatars.githubusercontent.com/u/26026184?v=4?s=100" width="100px;" alt="gimmyhehe"/><br /><sub><b>gimmyhehe</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=gimmyhehe" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/KevinAndrewDong"><img src="https://avatars.githubusercontent.com/u/20911103?v=4?s=100" width="100px;" alt="dong"/><br /><sub><b>dong</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=KevinAndrewDong" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="http://www.linglan01.cn"><img src="https://avatars.githubusercontent.com/u/58327088?v=4?s=100" width="100px;" alt="凌览"/><br /><sub><b>凌览</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=CatsAndMice" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/Caesar-ch"><img src="https://avatars.githubusercontent.com/u/74941512?v=4?s=100" width="100px;" alt="Caesar-ch"/><br /><sub><b>Caesar-ch</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=Caesar-ch" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/chenqifeng66"><img src="https://avatars.githubusercontent.com/u/97503755?v=4?s=100" width="100px;" alt="chenqifeng66"/><br /><sub><b>chenqifeng66</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=chenqifeng66" title="Tests">⚠️</a></td>
</tr>
<tr>
<td align="center" valign="top" width="12.5%"><a href="https://zz-zzzz.github.io/"><img src="https://avatars.githubusercontent.com/u/48228016?v=4?s=100" width="100px;" alt="Zz-ZzzZ"/><br /><sub><b>Zz-ZzzZ</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=Zz-ZzzZ" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/lyx-jay"><img src="https://avatars.githubusercontent.com/u/39766860?v=4?s=100" width="100px;" alt="Lyx"/><br /><sub><b>Lyx</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=lyx-jay" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/chenguang1994"><img src="https://avatars.githubusercontent.com/u/31501915?v=4?s=100" width="100px;" alt="Spark Bill"/><br /><sub><b>Spark Bill</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=chenguang1994" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/Zuowendong"><img src="https://avatars.githubusercontent.com/u/45628596?v=4?s=100" width="100px;" alt="wendZzoo"/><br /><sub><b>wendZzoo</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=Zuowendong" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/gweesin"><img src="https://avatars.githubusercontent.com/u/42909374?v=4?s=100" width="100px;" alt="Gweesin Chan"/><br /><sub><b>Gweesin Chan</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=gweesin" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/Binks123"><img src="https://avatars.githubusercontent.com/u/103343025?v=4?s=100" width="100px;" alt="Binks_"/><br /><sub><b>Binks_</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=Binks123" title="Documentation">📖</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/yoyo201626"><img src="https://avatars.githubusercontent.com/u/104079404?v=4?s=100" width="100px;" alt="yoyo"/><br /><sub><b>yoyo</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=yoyo201626" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://hexo.kifroom.icu/"><img src="https://avatars.githubusercontent.com/u/62132584?v=4?s=100" width="100px;" alt="Kif"/><br /><sub><b>Kif</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=wkif" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/jack-zishan"><img src="https://avatars.githubusercontent.com/u/67041206?v=4?s=100" width="100px;" alt="jack-zishan"/><br /><sub><b>jack-zishan</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=jack-zishan" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="http://gradii.com"><img src="https://avatars.githubusercontent.com/u/5467712?v=4?s=100" width="100px;" alt="LinboLen"/><br /><sub><b>LinboLen</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=LinboLen" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/vaebe"><img src="https://avatars.githubusercontent.com/u/52314078?v=4?s=100" width="100px;" alt="vaebe"/><br /><sub><b>vaebe</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=vaebe" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://allenli178.top"><img src="https://avatars.githubusercontent.com/u/53218750?v=4?s=100" width="100px;" alt="YuYan Li"/><br /><sub><b>YuYan Li</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=allenli178" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/shonen7"><img src="https://avatars.githubusercontent.com/u/145949377?v=4?s=100" width="100px;" alt="shonen7"/><br /><sub><b>shonen7</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=shonen7" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/xlearns"><img src="https://avatars.githubusercontent.com/u/62782792?v=4?s=100" width="100px;" alt="xlearns"/><br /><sub><b>xlearns</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=xlearns" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/ianxinnew"><img src="https://avatars.githubusercontent.com/u/146069396?v=4?s=100" width="100px;" alt="tianxin"/><br /><sub><b>tianxin</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=ianxinnew" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/Xppp0217"><img src="https://avatars.githubusercontent.com/u/82315158?v=4?s=100" width="100px;" alt="Xppp0217"/><br /><sub><b>Xppp0217</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=Xppp0217" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/AcWrong02"><img src="https://avatars.githubusercontent.com/u/147061401?v=4?s=100" width="100px;" alt="AcWrong02"/><br /><sub><b>AcWrong02</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/issues?q=author%3AAcWrong02" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/betavs"><img src="https://avatars.githubusercontent.com/u/34408516?v=4?s=100" width="100px;" alt="betavs"/><br /><sub><b>betavs</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=betavs" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/fanbingbing16"><img src="https://avatars.githubusercontent.com/u/84823288?v=4?s=100" width="100px;" alt="fanbingbing16"/><br /><sub><b>fanbingbing16</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=fanbingbing16" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/dyh333"><img src="https://avatars.githubusercontent.com/u/1221313?v=4?s=100" width="100px;" alt="dyh333"/><br /><sub><b>dyh333</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=dyh333" title="Documentation">📖</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/betterdancing"><img src="https://avatars.githubusercontent.com/u/25901461?v=4?s=100" width="100px;" alt="betterdancing"/><br /><sub><b>betterdancing</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=betterdancing" title="Documentation">📖</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/David-TechNomad"><img src="https://avatars.githubusercontent.com/u/23149356?v=4?s=100" width="100px;" alt="David"/><br /><sub><b>David</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=David-TechNomad" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/falcon-jin"><img src="https://avatars.githubusercontent.com/u/48880836?v=4?s=100" width="100px;" alt="falcon-jin"/><br /><sub><b>falcon-jin</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=falcon-jin" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/wuyiping0628"><img src="https://avatars.githubusercontent.com/u/42107997?v=4?s=100" width="100px;" alt="wuyiping0628"/><br /><sub><b>wuyiping0628</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=wuyiping0628" title="Tests">⚠️</a></td>
</tr>
<tr>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/James-9696"><img src="https://avatars.githubusercontent.com/u/72028410?v=4?s=100" width="100px;" alt="James"/><br /><sub><b>James</b></sub></a><br /><a href="https://github.com/opentiny/tiny-vue/commits?author=James-9696" title="Documentation">📖</a></td>
</tr>
</tbody>
</table>
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
## ❤️ Credits
感谢:
- [element](https://github.com/ElemeFE/element) 项目,它是一个老牌的基于 Vue.js 的组件库TinyVue 在设计之初借鉴了 Element并针对 Element 的组件 API 进行兼容。
- [floating-ui](https://github.com/floating-ui/floating-ui) 项目它是一个轻量级、无依赖、高性能的定位库TinyVue 的多个组件都是基于 Floating UI 提供的能力。
- [vxe-table](https://github.com/x-extends/vxe-table) 项目,它是一个基于 Vue 的表格组件支持丰富的功能TinyVue 的 Grid 组件基于 vxe-table。
- [sortablejs](https://github.com/SortableJS/Sortable) 项目它是一个功能强大的拖拽库TinyVue 的 Grid / Transfer / Tabs 等多个组件的拖拽排序功能都基于 Sortable。
- [@adamwathan](https://github.com/adamwathan) 写的文章[《Renderless Components in Vue.js》](https://adamwathan.me/renderless-components-in-vuejs/),这篇文章启发了 TinyVue 的无渲染组件设计架构,并最终在 TinyVue 项目中实现了跨端、跨框架能力。
## 开源协议
[MIT](LICENSE)

1
commitlint.config.js Normal file
View File

@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] }

View File

@ -0,0 +1 @@
ignores: ["tailwindcss", "postcss", "autoprefixer", "flexsearch", "@root/typings-vue3"]

8
examples/docs/README.md Normal file
View File

@ -0,0 +1,8 @@
# Tiny Vue 文档资源说明
本文件夹内容发布到 @opentiny/vue-doc-resources 中。
- `api` 记录每个组件的属性,插槽,方法,事件等内容
- `demo` 记录每个组件的示例源码
- `demo-config` 记录每个组件的示例配置
- `menus.js` 记录导航菜单

View File

@ -0,0 +1,283 @@
<template>
<div :class="themeClass">
<header class="header">
<h1>电子书阅读器</h1>
<div class="header-buttons">
<button @click="toggleTheme">{{ buttonLabel }}</button>
<button @click="toggleFontSize">切换字体大小</button>
</div>
</header>
<div class="main-container">
<aside class="sidebar">
<h2>书架</h2>
<ul>
<li v-for="book in books" :key="book.id" @click="selectBook(book)">
{{ book.title }}
</li>
</ul>
<div class="sidebar-buttons">
<button @click="previousBook">上一本书</button>
<button @click="nextBook">下一本书</button>
</div>
</aside>
<div class="content">
<section class="book-viewer">
<h2>{{ currentBook.title }}</h2>
<div class="reading-area">
<p v-html="currentBook.content"></p>
<div class="content-buttons">
<button @click="increaseFontSize">增大字体</button>
<button @click="decreaseFontSize">减小字体</button>
<button @click="downloadChapter">下载当前章节</button>
</div>
</div>
</section>
<section class="chapters">
<h2>章节列表</h2>
<ul>
<li v-for="chapter in currentBook.chapters" :key="chapter.id" @click="openChapter(chapter)">
{{ chapter.title }}
</li>
</ul>
</section>
<section class="bookmarks">
<h2>书签</h2>
<ul>
<li v-for="bookmark in bookmarks" :key="bookmark.id">
{{ bookmark.title }}
</li>
</ul>
<button @click="addBookmark">添加书签</button>
</section>
</div>
</div>
<footer class="footer">
<p>© 2024 电子书阅读器. All rights reserved.</p>
</footer>
</div>
</template>
<script>
import { darkTheme } from '@opentiny/vue-theme/theme/dark-Theme/dark-theme.js'
import { galaxyTheme } from '@opentiny/vue-theme/theme/galaxy-theme/index.js'
export default {
data() {
return {
isDarkTheme: false,
isLargeFont: false,
currentBook: {
title: '西游记',
content: `第1回 灵根育孕源流出 心性修持大道生...`,
chapters: [
{ id: 1, title: '第一回 灵根育孕源流出 心性修持大道生' },
{ id: 2, title: '第二回 兔妖引来如意棒 大圣闹海重生' },
{ id: 3, title: '第三回 三藏法师大闹天宫 归国取经广育群妖' }
]
},
books: [
{ id: 1, title: '西游记' },
{ id: 2, title: '红楼梦' },
{ id: 3, title: '水浒传' }
],
bookmarks: [
{ id: 1, title: '第一章开始' },
{ id: 2, title: '第二章精彩' }
]
}
},
computed: {
themeClass() {
return this.isDarkTheme ? 'dark' : 'aurora'
},
buttonLabel() {
return this.isDarkTheme ? '切换到 Aurora 主题' : '切换到 Dark 主题'
}
},
methods: {
toggleTheme() {
this.isDarkTheme = !this.isDarkTheme
this.applyTheme()
},
toggleFontSize() {
this.isLargeFont = !this.isLargeFont
this.applyFontSize()
},
applyTheme() {
const themeVariables = this.isDarkTheme ? darkTheme : galaxyTheme
for (const [key, value] of Object.entries(themeVariables)) {
document.documentElement.style.setProperty(`--${key}`, value)
}
},
applyFontSize() {
const fontSize = this.isLargeFont ? '18px' : '14px'
document.documentElement.style.setProperty('--reading-font-size', fontSize)
},
selectBook(book) {
this.currentBook = {
title: book.title,
content: book.title === '西游记' ? `第1回 灵根育孕源流出...` : `这是《${book.title}》的内容部分。`,
chapters: [
{ id: 1, title: '第一回 灵根育孕源流出 心性修持大道生' },
{ id: 2, title: '第二回 兔妖引来如意棒 大圣闹海重生' },
{ id: 3, title: '第三回 三藏法师大闹天宫 归国取经广育群妖' }
]
}
},
openChapter(chapter) {
this.currentBook.content = `这是《${this.currentBook.title}》的${chapter.title}内容。`
},
previousBook() {
const currentIndex = this.books.findIndex((book) => book.title === this.currentBook.title)
const previousIndex = (currentIndex - 1 + this.books.length) % this.books.length
this.selectBook(this.books[previousIndex])
},
nextBook() {
const currentIndex = this.books.findIndex((book) => book.title === this.currentBook.title)
const nextIndex = (currentIndex + 1) % this.books.length
this.selectBook(this.books[nextIndex])
},
increaseFontSize() {
this.isLargeFont = true
this.applyFontSize()
},
decreaseFontSize() {
this.isLargeFont = false
this.applyFontSize()
},
downloadChapter() {
const blob = new Blob([this.currentBook.content], { type: 'text/plain;charset=utf-8' })
const link = document.createElement('a')
link.href = URL.createObjectURL(blob)
link.download = `${this.currentBook.title}-${new Date().toISOString().slice(0, 10)}.txt`
link.click()
},
addBookmark() {
this.bookmarks.push({ id: this.bookmarks.length + 1, title: `书签 ${this.bookmarks.length + 1}` })
}
},
mounted() {
this.applyTheme()
this.applyFontSize()
}
}
</script>
<style>
/* Aurora 主题 */
.aurora {
--ti-base-color-bg-1: #ffffff;
--ti-base-color-common-7: #333333;
--ti-button-normal-background-color: #1890ff;
--ti-button-normal-hover-bg-color: #096dd9;
--ti-common-color-border: #2e3243;
--ti-common-color-light: #f5f5f5;
--ti-common-color-info-normal: #333333;
--ti-common-color-hover-background: #e6f7ff;
--ti-common-color-selected-background: #1890ff;
--ti-button-primary-text-color: #ffffff;
}
/* Dark 主题 */
.dark {
--dark-color-brand-6: #0a84ff;
--dark-color-common-9: #e0e0e0;
--dark-color-common-8: #b3b3b3;
--dark-color-bg-primary: #2b2b2b;
--dark-color-btn-bg: #444444; /* 按钮背景色 */
--dark-color-btn-text: #e0e0e0; /* 按钮文本颜色 */
--dark-color-btn-hover-bg: #555555; /* 按钮悬停背景色 */
--dark-color-btn-border: #666666; /* 按钮边框颜色 */
--dark-color-bg-accent: #3a3a3a;
}
/* 通用样式 */
.header {
background-color: var(--ti-base-color-bg-1, var(--dark-color-bg-primary));
color: var(--ti-base-color-common-7, var(--dark-color-common-9));
padding: 20px;
text-align: center;
border-bottom: 1px solid var(--ti-common-color-border, var(--dark-color-common-8));
display: flex;
justify-content: space-between;
align-items: center;
}
.header-buttons {
display: flex;
gap: 10px;
}
.main-container {
display: flex;
padding: 20px;
}
.sidebar {
width: 250px;
padding: 20px;
background-color: var(--ti-base-color-bg-4, var(--dark-color-bg-accent));
color: var(--ti-base-color-common-7, var(--dark-color-common-9));
border-right: 1px solid var(--ti-common-color-border, var(--dark-color-common-8));
}
.book-viewer {
flex: 1;
margin-right: 20px;
}
.bookmarks {
margin-top: 20px;
}
button {
padding: 10px 20px;
background-color: var(--ti-button-normal-background-color, var(--dark-color-btn-bg));
color: var(--ti-button-primary-text-color, var(--dark-color-btn-text));
border: 1px solid var(--ti-button-normal-background-color, var(--dark-color-btn-border));
border-radius: 4px;
cursor: pointer;
}
button:hover {
background-color: var(--ti-button-normal-hover-bg-color, var(--dark-color-btn-hover-bg));
}
button:active {
transform: scale(0.95);
}
.content {
flex: 1;
padding: 20px;
background-color: var(--ti-common-color-light, var(--dark-color-bg-primary));
color: var(--ti-base-color-common-7, var(--dark-color-common-9));
}
/* 阅读区域 */
.reading-area {
padding: 20px;
background-color: var(--ti-common-color-light, var(--dark-color-bg-accent));
color: var(--ti-base-color-common-7, var(--dark-color-common-9));
border-radius: 8px;
font-size: var(--reading-font-size, 14px);
}
.reading-area p {
margin: 0;
line-height: 1.6;
}
.content-buttons {
margin-top: 20px;
display: flex;
gap: 10px;
}
.footer {
padding: 20px;
text-align: center;
background-color: var(--ti-base-color-bg-1, var(--dark-color-bg-primary));
color: var(--ti-base-color-common-7, var(--dark-color-common-9));
}
</style>

View File

@ -0,0 +1 @@
<svg viewBox="0 0 1024 1024" width="20" height="20"><path d="M512 96C229.696 96 0 325.696 0 608c0 90.368 30.304 174.496 85.344 236.896 55.264 62.624 129.152 97.12 208.128 97.12 81.568 0 161.536-36.832 231.264-106.592l2.272-2.496c65.792-81.472 132.896-121.056 205.088-121.056 46.72 0 89.216 15.872 126.688 29.92 30.336 11.328 56.576 21.12 81.216 21.12C1024 762.912 1024 654.336 1024 608c0-282.304-229.696-512-512-512z m428 602.912c-13.088 0-35.296-8.288-58.784-17.088-40.48-15.136-90.848-33.952-149.12-33.952-92.352 0-175.328 46.944-253.76 143.456-57.184 56.704-121.056 86.688-184.832 86.688-60.352 0-117.216-26.784-160.128-75.456C88.64 751.872 64 682.784 64 608 64 360.96 264.96 160 512 160s448 200.96 448 448c0 27.328-1.952 90.912-20 90.912z m-203.296-182.848a64 64 0 1 0 128 0 64 64 0 1 0-128 0z m-343.68-202.688a64 64 0 1 0 128 0 64 64 0 1 0-128 0z m215.68 26.688a64 64 0 1 0 128 0 64 64 0 1 0-128 0z m-381.312 112a64 64 0 1 0 128 0 64 64 0 1 0-128 0zM182.4 698.752a96 96 0 1 0 192 0 96 96 0 1 0-192 0z"></path></svg>

After

Width:  |  Height:  |  Size: 1020 B

View File

@ -0,0 +1,223 @@
<template>
<div class="wp100 hp100 f-r of-hidden">
<div class="w230 pt20 of-auto sm-hidden b-r bg-white" :class="{ 'fixed-menu': showFixedMenu }">
<tiny-tree-menu
class="!w213"
:data="menuData"
:filter-node-method="fn.searchMenu"
@current-change="fn.clickMenu"
></tiny-tree-menu>
</div>
<div class="fi-1 f-c px20 pb30 f-c pr200 of-auto">
<!-- 标题 -->
<div class="py20">
<component :is="state.currMd" class="component-md"></component>
</div>
<div id="preview" class="bg-white">
<div class="mb20 py10 pl16 child<code>p4 child<code>bg-lightless">
<div class="mr20 fw-bold">
{{ state.currDemo?.name['zh-CN'] }}
(<span class="allselect">{{ state.currDemo?.codeFiles[0] }}</span
>):
</div>
<div v-html="state.currDemo?.desc['zh-CN']"></div>
</div>
<!-- 预览 -->
<!-- modeState.demoId === 'preview-in-dialog' 修复preview-in-dialog demo弹窗内容被遮罩层遮挡 -->
<div
:id="state.currDemo?.demoId"
class="rel px20 minh200"
:style="{ transform: modeState.demoId === 'preview-in-dialog' ? '' : 'translateX(0)' }"
>
<config-provider :design="design">
<component :is="state.comp"></component>
</config-provider>
</div>
</div>
<!-- API表格 -->
<div v-if="state.currApi?.length" class="mt20 f24 fw-bold">组件API</div>
<div v-for="(oneGroup, idx) in state.currApi" :key="idx">
<div class="mt20 f-r f-pos-start fw-bold">
<div :id="oneGroup.name" class="f18">
{{ oneGroup.name }}
</div>
<div class="ml12 b-a-primary c-primary px8 py4">
{{ oneGroup.type }}
</div>
</div>
<div v-for="(oneApiArr, key) in oneGroup" :key="key">
<div v-if="key !== 'name' && key !== 'type' && oneApiArr.length > 0">
<div class="f18 py28">
{{ key }}
</div>
<table class="api-table">
<thead>
<tr>
<th width="20%">名称</th>
<th width="15%">类型</th>
<th width="20%">默认值</th>
<th width="55%">说明</th>
</tr>
</thead>
<tbody>
<tr v-for="row in oneApiArr" :key="row.name">
<td>
<a v-if="row.demoId" class="c-primary h:c-error cur-hand" @click="fn.selectDemo(row.demoId)">{{
row.name
}}</a>
<span v-else>{{ row.name }}</span>
</td>
<td>{{ row.type }}</td>
<td v-html="typeof row.defaultValue === 'string' ? row.defaultValue || '--' : row.defaultValue"></td>
<td v-html="row.desc['zh-CN']"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- 右边浮动所有的demos -->
<tiny-floatbar v-if="state.demos.length > 0" class="!top120 !z1 !right25 sm-hidden">
<div class="f12 ofy-auto h700">
<div
v-for="demo in state.demos"
:key="demo.demoId"
@click="fn.selectDemo(demo.demoId)"
class="w130 px10 py4 bg-light f-r f-pos-between"
:class="{ 'c-error': state.currDemo === demo }"
>
<div class="link-primary h:c-error h:td-under ellipsis">
{{ demo.name['zh-CN'] }}
<Icon-star-icon v-if="state.currDemo === demo" style="fill: #ee343f" />
</div>
<IconOpeninVscode @click.stop="fn.openInVscode(demo)" class="f18 cur-hand" />
</div>
</div>
</tiny-floatbar>
</div>
</template>
<script>
import { hooks } from '@opentiny/vue-common'
import { Floatbar, TreeMenu, Button, Tooltip, ConfigProvider } from '@opentiny/vue'
import { iconStarActive, iconSelect } from '@opentiny/vue-icon'
import designAuroraConfig from '@opentiny/vue-design-aurora'
import designSaasConfig from '@opentiny/vue-design-saas'
import { menuData, demos, demoStr, demoVue, mds } from './resourceMobileFirst.js'
import { useModeCtx } from './uses'
import { getDemosConfig, getApisConfig } from './utils/componentsDoc'
const isSaasMode = process.env.VITE_TINY_THEME === 'saas'
export default {
props: {
showFixedMenu: Boolean
},
components: {
TinyFloatbar: Floatbar,
TinyTreeMenu: TreeMenu,
TinyButton: Button,
TinyTooltip: Tooltip,
IconStarIcon: iconStarActive(),
IconOpeninVscode: iconSelect(),
ConfigProvider
},
setup() {
import('./tailwind.css')
const { state: modeState, fn: modeFn } = useModeCtx()
const state = hooks.reactive({
demos: [], //
currDemo: null, // demo
currApi: [], // pathapi
comp: null, //
currDemoSrc: '',
currMd: hooks.computed(() => mds[`${modeState.pathName}.cn.md`])
})
const fn = {
//
searchMenu: (value, data) => {
if (!value) return true
return data.label.toLowerCase().includes(value.toLowerCase())
},
// path
clickMenu: async (menu) => {
if (menu.nameCn && menu.key !== state.key) {
modeState.pathName = menu.key
await _switchPath()
}
},
//
selectDemo: async (demoId) => {
const demo = state.demos.find((d) => d.demoId === demoId)
if (state.currDemo !== demo) {
state.currDemo = demo
await _switchDemo()
}
},
openInVscode: (demo) => {
fetch(`/__open-in-editor?file=../sites/demos/mobile-first/app/${modeState.pathName}/${demo.codeFiles[0]}`)
}
}
hooks.onMounted(() => {
_switchPath()
})
// vue
async function _switchPath() {
const demosModule =
demos[`../../sites/demos/mobile-first/app/${modeState.pathName}/webdoc/${modeState.pathName}.js`]
const demosConfig = await getDemosConfig(demosModule)
state.demos = demosConfig.demos
state.currDemo = state.demos.find((d) => d.demoId === modeState.demoId) || state.demos?.[0]
state.currApi = (await getApisConfig(modeState.pathName, 'mobile-first')).apis
await _switchDemo()
}
async function _switchDemo() {
modeState.demoId = state.currDemo.demoId
const path = `../../sites/demos/mobile-first/app/${modeState.pathName}/${state.currDemo?.codeFiles[0]}`
//
state.currDemoSrc = await demoStr[path]()
const comp = await demoVue[path]()
state.comp = hooks.markRaw(comp.default)
modeFn.cacheCtx()
modeFn.pushToUrl()
}
// mobile-firstaui使saas 使designSaasConfig designAuroraConfig
const design = isSaasMode ? designSaasConfig : designAuroraConfig
return {
menuData,
state,
fn,
modeState,
modeFn,
design
}
}
}
</script>
<style lang="less">
.component-md h1,
.component-md h2 {
font-size: 1.5em;
font-weight: bold;
}
.demo-date-picker-mobile-container {
min-height: 500px;
.tiny-recycle-scroller {
height: 220px !important;
}
div[data-tag='tiny-drawer-main'] {
min-height: auto;
}
}
</style>

View File

@ -0,0 +1,189 @@
<template>
<div class="wp100 hp100 f-r of-hidden">
<div class="w230 pt20 of-auto sm-hidden b-r bg-white" :class="{ 'fixed-menu': showFixedMenu }">
<tiny-tree-menu
class="!w213"
:data="menuData"
:filter-node-method="fn.searchMenu"
@current-change="fn.clickMenu"
></tiny-tree-menu>
</div>
<div class="fi-1 f-c px20 pb30 f-c pr200 of-auto">
<!-- 标题 -->
<div class="py20">
<component :is="state.currMd"></component>
</div>
<div id="preview" class="bg-white">
<div class="mb20 py10 pl16 child<code>p4 child<code>bg-lightless">
<div class="mr20 fw-bold">
{{ state.currDemo?.name['zh-CN'] }}( <span class="allselect">{{ state.currDemo?.codeFiles[0] }}</span
>):
</div>
<div v-html="state.currDemo?.desc['zh-CN']"></div>
</div>
<!-- 预览 -->
<div class="rel px20" :id="state.currDemo?.demoId">
<div class="phone-container" @dblclick="fn.openInVscode(state.currDemo)">
<div class="mobile-view-container">
<component :is="state.comp"></component>
</div>
</div>
</div>
</div>
<!-- API表格 -->
<div v-if="state.currApi?.length" class="mt20 f24 fw-bold">组件API</div>
<div v-for="(oneGroup, idx) in state.currApi" :key="idx">
<div class="mt20 f-r f-pos-start fw-bold">
<div :id="oneGroup.name" class="f18">
{{ oneGroup.name }}
</div>
<div class="ml12 b-a-primary c-primary px8 py4">
{{ oneGroup.type }}
</div>
</div>
<div v-for="(oneApiArr, key) in oneGroup" :key="key">
<div v-if="key !== 'name' && key !== 'type' && oneApiArr.length > 0">
<div class="f18 py28">
{{ key }}
</div>
<table class="api-table">
<thead>
<tr>
<th width="20%">名称</th>
<th width="15%">类型</th>
<th width="20%">默认值</th>
<th width="55%">说明</th>
</tr>
</thead>
<tbody>
<tr v-for="row in oneApiArr" :key="row.name">
<td>
<a v-if="row.demoId" class="c-primary h:c-error cur-hand" @click="fn.selectDemo(row.demoId)">{{
row.name
}}</a>
<span v-else>{{ row.name }}</span>
</td>
<td>{{ row.type }}</td>
<td v-html="typeof row.defaultValue === 'string' ? row.defaultValue || '--' : row.defaultValue"></td>
<td v-html="row.desc['zh-CN']"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- 右边浮动所有的demos -->
<tiny-floatbar v-if="state.demos?.length > 0" class="!top120 !z1 !right25">
<div class="f12 ofy-auto">
<div
v-for="demo in state.demos"
:key="demo.demoId"
@click="fn.selectDemo(demo.demoId)"
class="w130 px10 py4 bg-light f-r f-pos-between"
:class="{ 'c-error': state.currDemo === demo }"
>
<div class="link-primary h:c-error h:td-under ellipsis">
{{ demo.name['zh-CN'] }}
<Icon-star-icon v-if="state.currDemo === demo" style="fill: #ee343f" />
</div>
<IconOpeninVscode @click.stop="fn.openInVscode(demo)" class="f18 cur-hand" />
</div>
</div>
</tiny-floatbar>
</div>
</template>
<script>
import { hooks } from '@opentiny/vue-common'
import { Floatbar, TreeMenu, Button, Tooltip } from '@opentiny/vue'
import { iconStarActive, iconSelect } from '@opentiny/vue-icon'
import { menuData, demos, demoStr, demoVue, mds } from './resourceMobile.js'
import { useModeCtx } from './uses'
import { getDemosConfig, getApisConfig } from './utils/componentsDoc'
export default {
props: {
showFixedMenu: Boolean
},
components: {
TinyFloatbar: Floatbar,
TinyTreeMenu: TreeMenu,
TinyButton: Button,
TinyTooltip: Tooltip,
IconStarIcon: iconStarActive(),
IconOpeninVscode: iconSelect()
},
setup() {
const { state: modeState, fn: modeFn } = useModeCtx()
const state = hooks.reactive({
demos: [], //
currDemo: null, // demo
currApi: [], // pathapi
comp: null, //
currDemoSrc: '',
currMd: hooks.computed(() => mds[`${modeState.pathName}.cn.md`])
})
const fn = {
//
searchMenu: (value, data) => {
if (!value) return true
return data.label.toLowerCase().includes(value.toLowerCase())
},
// path
clickMenu: async (menu) => {
if (menu.nameCn && menu.key !== state.key) {
modeState.pathName = menu.key
await _switchPath()
}
},
//
selectDemo: async (demoId) => {
const demo = state.demos.find((d) => d.demoId === demoId)
if (state.currDemo !== demo) {
state.currDemo = demo
await _switchDemo()
}
},
openInVscode: (demo) => {
fetch(`/__open-in-editor?file=../sites/demos/mobile/app/${modeState.pathName}/${demo.codeFiles[0]}`)
}
}
hooks.onMounted(() => {
_switchPath()
})
// vue
async function _switchPath() {
const demosModule = demos[`../../sites/demos/mobile/app/${modeState.pathName}/webdoc/${modeState.pathName}.js`]
const demosConfig = await getDemosConfig(demosModule)
state.demos = demosConfig.demos
state.currDemo = state.demos.find((d) => d.demoId === modeState.demoId) || state.demos?.[0]
state.currApi = (await getApisConfig(modeState.pathName, 'mobile')).apis
await _switchDemo()
}
async function _switchDemo() {
modeState.demoId = state.currDemo.demoId
const path = `../../sites/demos/mobile/app/${modeState.pathName}/${state.currDemo?.codeFiles[0]}`
//
state.currDemoSrc = await demoStr[path]()
const comp = await demoVue[path]()
state.comp = hooks.markRaw(comp.default)
modeFn.cacheCtx()
modeFn.pushToUrl()
}
return {
menuData,
state,
fn,
modeState,
modeFn
}
}
}
</script>

285
examples/docs/newsrc/pc.vue Normal file
View File

@ -0,0 +1,285 @@
<template>
<div class="wp100 hp100 f-r of-hidden">
<div class="w230 pt20 of-auto sm-hidden b-r bg-white" :class="{ 'fixed-menu': showFixedMenu }">
<tiny-tree-menu
class="!w213"
:data="menuData"
:filter-node-method="fn.searchMenu"
@current-change="fn.clickMenu"
></tiny-tree-menu>
</div>
<div class="fi-1 f-c px20 pb30 f-c pr200 of-auto" ref="rightRef">
<!-- 标题 -->
<div class="py20 f24 fw-bold text-center">
<component :is="state.currMd" class="component-md"></component>
</div>
<div id="preview" class="bg-white f-c">
<!-- 标题 + 组件说明 -->
<div class="mb20 py10 pl16 child<code>p4 child<code>bg-lightless">
<div class="mr20 fw-bold">
{{ state.currDemo?.name['zh-CN'] }}
(<span class="allselect">{{ state.currDemo?.codeFiles[0] }}</span
>):
</div>
<div v-html="state.currDemo?.desc['zh-CN']"></div>
</div>
<!-- 预览 -->
<div class="rel px20 py60 b-a bs-dotted" :id="state.currDemo?.demoId">
<div class="abs top10 right10">
<span title="点击在vscode中打开">
<IconOpeninVscode @click="fn.openInVscode(state.currDemo)" class="ml12 cur-hand" />
</span>
</div>
<config-provider :design="design">
<component :is="state.comp" v-loading="state.demoLoading"></component>
</config-provider>
</div>
</div>
<!-- API表格 -->
<div v-if="state.currApi?.length" class="mt20 f24 fw-bold">组件API</div>
<div v-for="(oneGroup, idx) in state.currApi" :key="idx">
<div class="mt20 f-r f-pos-start fw-bold">
<div :id="oneGroup.name" class="f18">
{{ oneGroup.name }}
</div>
<div class="ml12 b-a-primary c-primary px8 py4">
{{ oneGroup.type }}
</div>
</div>
<div v-for="(oneApiArr, key) in oneGroup" :key="key">
<div v-if="key !== 'name' && key !== 'type' && oneApiArr.length > 0">
<div class="f18 py28">
{{ key }}
</div>
<table class="api-table">
<thead>
<tr>
<th width="20%">名称</th>
<th width="15%">类型</th>
<th width="20%">默认值</th>
<th width="55%">说明</th>
</tr>
</thead>
<tbody>
<tr v-for="row in oneApiArr" :key="row.name">
<td>
<a v-if="row.demoId" class="c-primary h:c-error cur-hand" @click="fn.selectDemo(row.demoId)">{{
row.name
}}</a>
<span v-else>{{ row.name }}</span>
</td>
<td>{{ row.type }}</td>
<td v-html="typeof row.defaultValue === 'string' ? row.defaultValue || '--' : row.defaultValue"></td>
<td v-html="row.desc['zh-CN']"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- 右边浮动所有的demos -->
<tiny-floatbar v-if="state.demos.length > 0" class="!top120 !z1 !right25">
<div class="f12 ofy-auto" style="max-height: calc(100vh - 240px)">
<div
v-for="demo in state.demos"
:key="demo.demoId"
@click="fn.selectDemo(demo.demoId)"
class="w130 px10 py4 bg-light f-r f-pos-between"
:class="{ 'c-error': state.currDemo === demo }"
>
<div class="link-primary h:c-error h:td-under ellipsis">
{{ demo.name['zh-CN'] }}
<Icon-star-icon v-if="state.currDemo === demo" style="fill: #ee343f" />
</div>
<IconOpeninVscode @click.stop="fn.openInVscode(demo)" class="f18 cur-hand" />
</div>
</div>
</tiny-floatbar>
<!-- 切换主题 -->
<tiny-dropdown class="!fixed bottom20 right140" :show-icon="false" @item-click="changeTheme" :disabled="isSaasMode">
<span title="切换主题">
<SvgTheme></SvgTheme>
</span>
<template #dropdown>
<tiny-dropdown-menu placement="top">
<tiny-dropdown-item
label="tiny-default-theme"
class="minw160"
:class="{ '!c-primary': currThemeLabel === 'tiny-default-theme' }"
>
Default Theme
</tiny-dropdown-item>
<tiny-dropdown-item
label="tiny-infinity-theme"
class="minw160"
:class="{ '!c-primary': currThemeLabel === 'tiny-infinity-theme' }"
>
Infinity Theme
</tiny-dropdown-item>
<tiny-dropdown-item
label="tiny-aurora-theme"
class="minw160"
:class="{ '!c-primary': currThemeLabel === 'tiny-aurora-theme' }"
>
Aurora Theme
</tiny-dropdown-item>
<tiny-dropdown-item
label="tiny-smb-theme"
class="minw160"
:class="{ '!c-primary': currThemeLabel === 'tiny-smb-theme' }"
>
SMB Theme
</tiny-dropdown-item>
</tiny-dropdown-menu>
</template>
</tiny-dropdown>
</div>
</template>
<script>
import { hooks } from '@opentiny/vue-common'
import {
Floatbar,
TreeMenu,
Button,
Tooltip,
Dropdown,
DropdownMenu,
DropdownItem,
ConfigProvider
} from '@opentiny/vue'
import { iconStarActive, iconSelect } from '@opentiny/vue-icon'
import Loading from '@opentiny/vue-loading'
import designSmbConfig from '@opentiny/vue-design-smb'
import designAuroraConfig from '@opentiny/vue-design-aurora'
import designSaasConfig from '@opentiny/vue-design-saas'
import { menuData, demoStr, demoVue, mds, demos } from './resourcePc.js'
import { useTheme, useModeCtx } from './uses'
import { getDemosConfig, getPath, getApisConfig } from './utils/componentsDoc'
import SvgTheme from './assets/theme.svg'
const isSaasMode = process.env.VITE_TINY_THEME === 'saas'
export default {
props: {
showFixedMenu: Boolean
},
components: {
TinyFloatbar: Floatbar,
TinyTreeMenu: TreeMenu,
TinyButton: Button,
TinyTooltip: Tooltip,
TinyDropdown: Dropdown,
TinyDropdownMenu: DropdownMenu,
TinyDropdownItem: DropdownItem,
SvgTheme,
IconStarIcon: iconStarActive(),
IconOpeninVscode: iconSelect(),
ConfigProvider
},
directives: {
loading: Loading.directive
},
setup() {
const { state: modeState, fn: modeFn } = useModeCtx()
const { changeTheme, currThemeLabel } = useTheme({ readCacheImmediate: !isSaasMode })
const rightRef = hooks.ref('')
const state = hooks.reactive({
demos: [], // {component,content,demoId,findIntroStr,link,title}[]
currDemo: null, // demo
currApi: [], // pathapi
comp: null, //
currDemoSrc: '',
currMd: hooks.computed(() => mds[`${modeState.pathName}.cn.md`]),
demoLoading: false
})
// hui chart api api
const huiNewChart = ['chart-process']
const fn = {
//
searchMenu: (value, data) => {
if (!value) return true
return data.label.toLowerCase().includes(value.toLowerCase())
},
// path
clickMenu: async (menu) => {
if (menu.nameCn && menu.key !== state.key) {
modeState.pathName = menu.key
await _switchPath()
}
},
//
selectDemo: async (demoId) => {
const demo = state.demos.find((d) => d.demoId === demoId)
if (state.currDemo !== demo) {
state.currDemo = demo
await _switchDemo()
}
},
openInVscode: (demo) => {
fetch(`/__open-in-editor?file=../sites/demos/pc/app/${getPath(modeState.pathName)}/${demo.codeFiles[0]}`)
}
}
hooks.onMounted(() => {
_switchPath()
})
// vue
async function _switchPath() {
state.demoLoading = true
const componentName = getPath(modeState.pathName)
// demos
const demosModule = demos[`../../sites/demos/pc/app/${componentName}/webdoc/${modeState.pathName}.js`]
const demosConfig = await getDemosConfig(demosModule)
state.demos = demosConfig.demos
state.currDemo = state.demos.find((d) => d.demoId === modeState.demoId) || state.demos?.[0]
if (huiNewChart.includes(modeState.pathName)) {
state.currApi = (await getApisConfig('hui', 'pc')).apis
} else {
state.currApi = (await getApisConfig(componentName, 'pc')).apis
}
await _switchDemo()
}
async function _switchDemo() {
modeState.demoId = state.currDemo.demoId
const path = `../../sites/demos/pc/app/${getPath(modeState.pathName)}/${state.currDemo?.codeFiles[0]}`
//
state.currDemoSrc = await demoStr[path]()
const comp = await demoVue[path]()
state.demoLoading = false
state.comp = hooks.markRaw(comp.default)
modeFn.cacheCtx()
modeFn.pushToUrl()
}
const designConfigMap = {
'tiny-smb-theme': designSmbConfig,
'tiny-aurora-theme': designAuroraConfig
}
const lastThemeKey = localStorage.getItem('tinyThemeToolkey')
// saas 使designSaasConfig
const design = isSaasMode ? designSaasConfig : designConfigMap[lastThemeKey] || {}
return {
menuData,
state,
fn,
changeTheme,
currThemeLabel,
modeState,
modeFn,
rightRef,
design,
isSaasMode
}
}
}
</script>

View File

@ -0,0 +1,32 @@
// eager = true可以校验vue,json等文件错误。
// eager = false, 可以懒加载,优化速度
// demo源码
// 同web-doc的菜单资源
import { cmpMenus } from '../../sites/demos/mobile/menus.js'
export const demoStr = import.meta.glob('../../sites/demos/mobile/app/**/*.vue', { eager: false, as: 'raw' })
export const demoVue = import.meta.glob('../../sites/demos/mobile/app/**/*.vue', { eager: false })
// demos配置
export const demos = import.meta.glob('../../sites/demos/mobile/app/*/webdoc/*.js', { eager: false })
// 组件的md
const allMD = import.meta.glob('../../sites/demos/mobile/app/*/webdoc/*.cn.md', { eager: true })
export const mds = {}
for (const path in allMD) {
let key = path.split('/').slice(-1)[0]
mds[key] = allMD[path].default
}
const menuData = cmpMenus.slice(0)
function processMenu(menu, isTop) {
menu.id = menu.key
menu.label = isTop ? menu.label : `${menu.nameCn} ${menu.name}`
if (menu.children && menu.children.length > 0) {
menu.children.forEach((m) => processMenu(m, false))
}
}
menuData.forEach((m) => processMenu(m, true))
export { menuData }

View File

@ -0,0 +1,27 @@
import { cmpMenus } from '../../sites/demos/mobile-first/menus.js'
export const demoStr = import.meta.glob('../../sites/demos/mobile-first/app/**/*.vue', { eager: false, as: 'raw' })
export const demoVue = import.meta.glob('../../sites/demos/mobile-first/app/**/*.vue', { eager: false })
// demos配置
export const demos = import.meta.glob('../../sites/demos/mobile-first/app/*/webdoc/*.js', { eager: false })
// 组件的md
const allMD = import.meta.glob('../../sites/demos/mobile-first/app/*/webdoc/*.cn.md', { eager: true })
export const mds = {}
for (const path in allMD) {
let key = path.split('/').slice(-1)[0]
mds[key] = allMD[path].default
}
const menuData = cmpMenus.slice(0)
function processMenu(menu, isTop) {
menu.id = menu.key
menu.label = isTop ? menu.label : `${menu.nameCn} ${menu.name}`
if (menu.children && menu.children.length > 0) {
menu.children.forEach((m) => processMenu(m, false))
}
}
menuData.forEach((m) => processMenu(m, true))
export { menuData }

View File

@ -0,0 +1,32 @@
// eager = true可以校验vue,json等文件错误。
// eager = false, 可以懒加载,优化速度
// demo源码
// 同web-doc的菜单资源
import { cmpMenus } from '../../sites/demos/pc/menus.js'
export const demoStr = import.meta.glob('../../sites/demos/pc/app/**/*.vue', { eager: false, as: 'raw' })
export const demoVue = import.meta.glob('../../sites/demos/pc/app/**/*.vue', { eager: false })
// demos配置
export const demos = import.meta.glob('../../sites/demos/pc/app/*/webdoc/*.js', { eager: false })
// 组件的md
const allMD = import.meta.glob('../../sites/demos/pc/app/*/webdoc/*.cn.md', { eager: true })
export const mds = {}
for (const path in allMD) {
let key = path.split('/').slice(-1)[0]
mds[key] = allMD[path].default
}
const menuData = cmpMenus.slice(0)
function processMenu(menu, isTop) {
menu.id = menu.key
menu.label = isTop ? menu.label : `${menu.nameCn} ${menu.name}`
if (menu.children && menu.children.length > 0) {
menu.children.forEach((m) => processMenu(m, false))
}
}
menuData.forEach((m) => processMenu(m, true))
export { menuData }

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,4 @@
/* 调试mobile-first时再放开此处 */
@tailwind base;
@tailwind components;
@tailwind utilities;

View File

@ -0,0 +1,5 @@
export default {
'button': 'button',
'checkbox-button': 'checkbox-button',
'input': 'input'
}

View File

@ -0,0 +1,22 @@
export const themes = [
{
id: 'tiny-light-theme',
name: 'Light',
cnName: '浅色主题',
data: {
'ti-base-color': '#ffffff',
'ti-button-bg-color': '#f0f0f0',
'ti-input-bg-color': '#f0f0f0'
}
},
{
id: 'tiny-dark-theme',
name: 'Dark',
cnName: '深色主题',
data: {
'ti-base-color': '#000000',
'ti-button-bg-color': '#333333',
'ti-input-bg-color': '#333333'
}
}
]

View File

@ -0,0 +1,5 @@
export { useStorage, $local, $session } from './useStorage.js'
export { useFileSaver } from './useFileSaver.js'
export { useFullScreen } from './useFullScreen.js'
export { useTheme } from './useTheme'
export { useModeCtx } from './useModeCtx'

View File

@ -0,0 +1,18 @@
const pickerOption = {
types: [{ accept: { 'text/vue': ['.vue'] } }]
}
export function useFileSaver() {
let handle = null
const saver = {
save: async (data) => {
handle = handle || (await window.showSaveFilePicker(pickerOption))
const writableStream = await handle.createWritable()
await writableStream.write(data)
await writableStream.close()
},
reset: () => (handle = null) // 切换保存为另一个文件时,要先行调用一下
}
return saver
}

View File

@ -0,0 +1,16 @@
import { hooks } from '@opentiny/vue-common'
export function useFullScreen(selector) {
let el = null
const fn = {
toggle: () => (document.fullscreenElement ? fn.exit() : fn.enter()),
enter: () => el && el.requestFullscreen(),
exit: () => document.exitFullscreen()
}
hooks.onMounted(() => {
el = document.querySelector(selector)
})
return fn
}

View File

@ -0,0 +1,59 @@
// import Vue from 'vue'
import { hooks } from '@opentiny/vue-common'
import { $local } from './useStorage'
const defaultPath = {
pc: '/pc/button/base',
mobile: '/mobile/navbar/left-right-arrow',
'mobile-first': '/mobile-first/calendar-bar/basic-usage'
}
const modeNames = Object.keys(defaultPath)
const parsePath = (path) => {
const items = path.split('/')
state.mode = items[1]
state.pathName = items[2]
}
// todo vue2需要预注册一下 @vue/composition-api
const state = hooks.reactive({
mode: '',
pathName: '',
demoId: '',
modeCtx: $local.modeCtx || defaultPath
})
const fn = {
// 加载页面
loadPage: () => {
const urlSegments = location.pathname.split('/')
let mode = urlSegments[1]
if (modeNames.includes(mode)) {
// 有效的url, 更新缓存
parsePath(location.pathname)
state.demoId = location.hash.slice(1)
fn.cacheCtx()
} else {
// 无效的url
fn.changeMode('pc')
fn.pushToUrl()
}
},
changeMode: (mode) => {
parsePath(state.modeCtx[mode])
},
// 保存ctx
cacheCtx: () => {
state.modeCtx[state.mode] = `/${state.mode}/${state.pathName}#${state.demoId}`
$local.modeCtx = state.modeCtx
},
// 更新url
pushToUrl: () => history.pushState({}, '', state.modeCtx[state.mode])
}
export function useModeCtx() {
return {
state,
fn
}
}

View File

@ -0,0 +1,52 @@
function parse(str) {
if (str === null) return undefined
const type = str[0]
const strVal = str.slice(1)
// 对象时有可能是Date, 否则反解析后统一是对象
if (type === 'o' || type === 'b') {
let val = JSON.parse(strVal)
return typeof val === 'string' ? new Date(val) : val
}
if (type === 'n') return +Number(strVal)
if (type === 's') return strVal
}
// 带前缀的保存值
function save(store, k, v) {
const type = typeof v
store.setItem(k, type[0] + (type === 'object' ? JSON.stringify(v) : v))
}
/**
* 快速的保存值到 sessionStorage, localStorage.
* 支持基本类型时间数组对象,null不存在的键值返回undefined
* 不支持Map,Set, 以及多级串联赋值比如$session.obj.name="abcd"
*/
function handler(storage) {
return {
get(target, propKey) {
let val = storage.getItem(propKey)
return parse(val)
},
set(target, propKey, value) {
save(storage, propKey, value)
return true
}
}
}
const typeMatcher = { session: null, local: null }
/**
* 用于记录值到localStorage或 sessionStorage, 并保持数据的类型
* @ const $s = useStorage("session");
* @ $s.abc="abc"
* @param {*} type 存储到的目标 "session" || "local"
* @returns Proxy对象
*/
export const useStorage = (type) =>
typeMatcher[type] || //
(typeMatcher[type] = new Proxy({}, handler(type === 'session' ? sessionStorage : localStorage)))
export const $session = useStorage('session')
export const $local = useStorage('local')

View File

@ -0,0 +1,51 @@
import TinyThemeTool from '@opentiny/vue-theme/theme-tool'
import { tinyAuroraTheme, tinySmbTheme, tinyInfinityTheme, tinyDarkTheme } from '@opentiny/vue-theme/theme'
import { hooks } from '@opentiny/vue-common'
import { Notify } from '@opentiny/vue'
let isShowTip = false
function showTip() {
Notify({
type: 'info',
title: '请注意',
message: '主题切换成功,如有部分主题样式不生效,请尝试手动刷新页面即可',
position: 'top-right',
duration: 3000
})
isShowTip = true
}
export function useTheme({ readCacheImmediate = true } = {}) {
const theme = new TinyThemeTool()
const currThemeLabel = hooks.ref('tiny-default-theme')
const lastThemeKey = localStorage.getItem('tinyThemeToolkey')
const THEME_MAP = {
'tiny-aurora-theme': tinyAuroraTheme,
'tiny-smb-theme': tinySmbTheme,
'tiny-infinity-theme': tinyInfinityTheme,
'tiny-dark-theme': tinyDarkTheme
}
const changeTheme = ({ vm }) => {
localStorage.setItem('tinyThemeToolkey', vm.label)
theme.changeTheme(THEME_MAP[vm.label])
currThemeLabel.value = vm.label
console.log('变换主题' + vm.label)
// 若部分主题样式切换不生效,第一次则提示用户需要手动刷新
if (!isShowTip) {
showTip()
}
}
// 切换上次缓存的主题
if (readCacheImmediate && THEME_MAP[lastThemeKey]) {
theme.changeTheme(THEME_MAP[lastThemeKey])
currThemeLabel.value = lastThemeKey
}
return {
changeTheme,
currThemeLabel
}
}

View File

@ -0,0 +1,40 @@
export const apis = import.meta.glob('../../../sites/demos/apis/*.js', { eager: false })
export const getPath = (path) => {
if (path.startsWith('grid-')) {
return 'grid'
} else if (path.startsWith('chart-')) {
return 'chart'
}
return path
}
export const getApisConfig = async (component, mode) => {
const apisModule = apis[`../../../sites/demos/apis/${component}.js`]
if (apisModule) {
const apisConfig = (await apisModule()).default
const demoKey = mode === 'mobile-first' ? 'mfDemo' : `${mode}Demo`
const apis = apisConfig.apis.map((item) => {
Object.keys(item).forEach((key) => {
const apiItem = item[key]
if (Array.isArray(apiItem)) {
item[key] = apiItem
.filter((i) => !i.mode || i.mode.includes(mode))
.map((filterItem) => ({ ...filterItem, demoId: filterItem[demoKey] }))
}
})
return item
})
return { ...apisConfig, apis }
}
return {}
}
export const getDemosConfig = async (module) => {
if (module) {
const demosModule = await module()
const demosConfig = demosModule.default
return demosConfig
}
return { demos: [] }
}

View File

@ -0,0 +1,26 @@
{
"name": "@opentiny/vue-localhost-dev",
"type": "module",
"version": "1.0.8",
"description": "",
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@opentiny/vue": "workspace:~",
"@opentiny/vue-common": "workspace:~",
"@opentiny/vue-icon": "workspace:~",
"@opentiny/vue-theme-mobile": "workspace:~",
"@opentiny/vue-theme-saas": "workspace:~",
"@opentiny/vue-design-aurora": "workspace:~",
"@opentiny/vue-design-smb": "workspace:~",
"@opentiny/vue-design-saas": "workspace:~",
"sortablejs": "1.15.0"
},
"devDependencies": {
"@playwright/test": "~1.42.0"
},
"files": [
"resources"
]
}

View File

@ -0,0 +1,9 @@
/** @type { import('tailwindcss').Config } */
module.exports = {
presets: [require('@opentiny/vue-theme-saas/tailwind.config.js')],
content: [
'../../packages/vue/src/**/*.{css,less,vue,js,jsx,ts,tsx}',
'!../../packages/vue/src/**/node_modules',
'../docs/resources/mobile-first/**/*.{css,less,vue,js,jsx,ts,tsx}'
]
}

View File

@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.vue3.json",
"include": [
"types/shims-vue.d.ts",
"types/shims-app.d.ts"
]
}

4
examples/docs/types/shims-app.d.ts vendored Normal file
View File

@ -0,0 +1,4 @@
declare module '*?raw' {
const content: string
export default content
}

5
examples/docs/types/shims-vue.d.ts vendored Normal file
View File

@ -0,0 +1,5 @@
declare module '*.vue' {
import { defineComponent } from 'vue'
const component: ReturnType<typeof defineComponent>
export default component
}

View File

@ -0,0 +1,249 @@
const _s0 = {
m: 'margin',
p: 'padding',
w: 'width',
h: 'height',
minw: 'min-width',
maxw: 'max-width',
minh: 'min-height',
maxh: 'max-height',
r: '-right',
l: '-left',
b: '-bottom',
t: '-top'
}
const sizeRules = [
// 高宽, 字体,行高 f12 lh20 w200 h200 box78
[/^(w|h|minw|maxw|minh|maxh)(\d+)$/, ([, attr, num]) => ({ [`${_s0[attr]}`]: `${num}px` })],
// 高宽百分比 wp33 hp50
[/^(w|h)p(\d+\.?\d*)$/, ([, attr, num]) => ({ [`${_s0[attr]}`]: `${num}%` })],
// 内外边距 *可负* m10 mr10 mt-10 mx20 my-10 p10 pr10
[/^([mp])([rlbt]?)(-?\d+)$/, ([, attr, pos, num]) => ({ [`${_s0[attr]}${pos ? _s0[pos] : ''}`]: `${num}px` })],
// 内外边距auto m-auto mt-auto mx-auto
[/^([mp])([rlbt]?)-auto$/, ([, attr, pos]) => ({ [`${_s0[attr]}${pos ? _s0[pos] : ''}`]: 'auto' })],
// abs 定位时 *可负* left0 right50 bottom-20 leftauto
[/^(left|top|right|bottom)(-?\d+)$/, ([, pos, num]) => ({ [`${pos}`]: `${num}px` })],
[/^(left|top|right|bottom)-(auto|unset)$/, ([, pos, val]) => ({ [`${pos}`]: val })]
]
const _s1 = {
none: 'none',
block: 'block',
inline: 'inline',
flex: 'flex',
grid: 'grid',
ib: 'inline-block',
if: 'inline-flex',
ig: 'inline-grid',
abs: 'absolute',
rel: 'relative',
fixed: 'fixed',
sticky: 'sticky',
static: 'static',
r: 'row',
c: 'column',
center: 'center',
start: 'flex-start',
end: 'flex-end',
around: 'space-around',
between: 'space-between',
evenly: 'space-evenly',
stretch: 'stretch'
}
const layoutRules = [
// display d-none, d-block d-flex d-inline d-grid d-ib d-if d-ig
[/^d-(none|block|flex|inline|grid|ib|if|ig)$/, ([, pos]) => ({ display: `${_s1[pos]}` })],
// position abs rel fixed sticky static
[/^(rel|abs|fixed|sticky|static)$/, ([, pos]) => ({ position: `${_s1[pos]}` })],
// 绝对定位 abs-0 fixed-0
['abs-0', { position: 'absolute', left: 0, right: 0, top: 0, bottom: 0 }],
['fixed-0', { position: 'fixed', left: 0, right: 0, top: 0, bottom: 0 }],
// 这个会用的很少通常是css reset中会重置。
['border-box', { 'box-sizing': 'border-box' }],
['content-box', { 'box-sizing': 'content-box' }],
// flex布局 父元素: f-r f-c f-center f-pos-between f-box-stretch f-wrap
[/^f-([rc])$/, ([, dir]) => ({ display: 'flex', 'flex-direction': `${_s1[dir]}` })],
[/^f-pos-(start|center|end|around|between|evenly|stretch)$/, ([, dir]) => ({ 'justify-content': `${_s1[dir]}` })],
[/^f-box-(start|center|end|stretch)$/, ([, dir]) => ({ 'align-items': `${_s1[dir]}` })],
[/^f-(wrap|nowrap)$/, ([, dir]) => ({ 'flex-wrap': dir })],
// 子元素: fi-1 fi-4
[/^fi-(\d+)$/, ([, num]) => ({ flex: `${num}` })]
]
const _s2 = {
f: 'font-size',
lh: 'line-height',
bold: 'bolder',
thin: 'lighter',
normal: 'normal',
under: 'underline',
over: 'overline',
through: 'line-through',
del: 'line-through',
none: 'none'
}
const fontRules = [
// 字体与行高 f12 lh20
[/^(f|lh)(\d+)$/, ([, attr, num]) => ({ [`${_s2[attr]}`]: `${num}px` })],
// 字体粗细 fw-bold fw-700
[/^fw-(bold|thin|normal)$/, ([, dir]) => ({ 'font-weight': `${_s2[dir]}` })],
[/^fw-(\d+)$/, ([, val]) => ({ 'font-weight': val })],
// 文字对齐 text-right ta-center
[/^(text|ta)-(right|left|center)$/, ([, abbr, dir]) => ({ 'text-align': dir })],
// 文字上下划线 solid|double|dotted|dashed|wavy
// td-under td-over-wavy td-over td-none-dashed
[
/^td-(under|over|through|del|none)(-solid|-double|-dotted|-dashed|-wavy)?$/,
([, dir, style = '']) => ({ 'text-decoration': `${_s2[dir]} ${style.slice(1)}` })
],
// 文字阴影 ts-sm ts-lg
['ts-sm', { 'text-shadow': 'var(--text-shadow-sm)' }],
['ts-lg', { 'text-shadow': 'var(--text-shadow-lg)' }]
]
const _s3 = {
a: '', // all
r: '-right',
l: '-left',
b: '-bottom',
t: '-top',
ws: 'var(--border-width) var(--border-style) ' // width & style
}
const borderRules = [
// 边框 b-a b-b b-r b-t b-l b-a-primary b-a#ff0000
[/^b-([arlbt])$/, ([, pos]) => ({ [`border${_s3[pos]}`]: _s3.ws + 'var(--border-color)' })],
[/^b-([arlbt])-([\w|-]+)$/, ([, pos, color]) => ({ [`border${_s3[pos]}`]: _s3.ws + `var(--${color})` })],
[/^b-([arlbt])#(\w+)$/, ([, pos, color]) => ({ [`border${_s3[pos]}`]: _s3.ws + `#${color}` })],
// 边框样式 bs-dotted bs-double
[/^bs-(none|dotted|dashed|solid|double|groove|ridge|inset|outset)$/, ([, style]) => ({ 'border-style': style })],
[/^br-(\d+)$/, ([, val]) => ({ 'border-radius': `${val}px` })],
// 无边框 nb-a nb-b nb-r nb-t nb-l
[/^nb-([arlbt])$/, ([, pos]) => ({ [`border${_s3[pos]}`]: 'none' })],
['br-sm', { 'border-radius': 'var(--box-radius-sm)' }],
['br-lg', { 'border-radius': 'var(--box-radius-lg)' }],
['br-circle', { 'border-radius': '50%' }],
['bs-sm', { 'box-shadow': 'var(--box-shadow-sm)' }],
['bs-lg', { 'box-shadow': 'var(--box-shadow-lg)' }]
]
const _s4 = {
def: 'default',
hand: 'pointer',
disable: 'not-allowed'
}
const clamp = (v, min, max) => Math.min(Math.max(v, min), max)
const utilRules = [
// 省略号 ellipsis ellipsis2 ellipsis3
['ellipsis', { overflow: 'hidden', ' text-overflow': 'ellipsis', 'white-space': 'nowrap' }],
[
/^ellipsis(\d+)$/,
([, num]) => ({
display: '-webkit-box',
overflow: 'hidden',
'-webkit-line-clamp': num,
' -webkit-box-orient': 'vertical',
'overflow-wrap': 'anywhere'
})
],
// 光标样式 cur-hand
[/^cur-(def|hand|disable)$/, ([, shape]) => ({ cursor: `${_s4[shape]}` })],
// overflow of-auto ofx-hidden ofy-scroll
[/^of(\w?)-(auto|scroll|hidden|visible)$/, ([, axis, mode]) => ({ [`overflow${axis ? '-' + axis : ''}`]: mode })],
// 图片填充 img-cover
[/^img-(cover|contain|fill)$/, ([, mode]) => ({ 'object-fit': mode })],
// z-index z100
[/^z(-?\d+)$/, ([, num]) => ({ 'z-index': num })],
// 选择相关 noselect allselect nomouse 参见选择变体: select:c-primary select:bg-dark
['noselect', { 'user-select': 'none' }],
['allselect', { 'user-select': 'all' }],
['noevent', { 'pointer-events': 'none' }],
// 可见性 hide show
['hide', { visibility: 'hidden' }],
['show', { visibility: 'visible' }],
// 透明度 op100
[/^op(\d+)$/, ([, val]) => ({ opacity: clamp(val / 100, 0, 1) })],
['op-hover', { opacity: 'var(--hover-op)' }],
['op-disabled', { opacity: 'var(--disabled-op)' }],
// 断词 breakword breakall
[/^break(word|all)$/, ([, type]) => ({ 'word-break': `break-${type}` })]
]
const _s5 = { c: 'color', bg: 'background-color' }
const colorRules = [
// 颜色 #不建议使用 c-black bg-primary c#123456 c-theme-color
[
/^(c|bg)-rand(\d+)$/,
([, attr, seed]) => ({ [`${_s5[attr]}`]: `#${Math.floor(Math.random() * 255 * 255 * 255).toString(16)}` })
],
[/^(c|bg)-([\w|-]+)$/, ([, attr, color]) => ({ [`${_s5[attr]}`]: `var(--${color})` })],
[/^(c|bg)#(\w+)$/, ([, attr, color]) => ({ [`${_s5[attr]}`]: `#${color}` })]
]
export const rules: any[] = [...sizeRules, ...layoutRules, ...fontRules, ...borderRules, ...utilRules, ...colorRules]
export const shortcuts: any[] = [
[/^(m|p)x(-?\d+)$/, ([, t, c]) => `${t}l${c} ${t}r${c}`],
[/^(m|p)y(-?\d+)$/, ([, t, c]) => `${t}t${c} ${t}b${c}`],
[/^(m|p)x-auto$/, ([, t, c]) => `${t}l-auto ${t}r-auto`],
[/^(m|p)y-auto$/, ([, t, c]) => `${t}t-auto ${t}b-auto`],
[/^box(\d+)$/, ([, w]) => `w${w} h${w}`],
[/^link-(\w+)$/, ([, c]) => `c-${c} h:c-${c}less cur-hand `],
[/^link#(\w+)$/, ([, c]) => `c#${c} cur-hand `],
['f-center', 'd-flex f-pos-center f-box-center']
]
export const variants = [
(matcher) => {
if (!matcher.startsWith('!')) return matcher
return {
matcher: matcher.slice(1),
body: (body) => {
body.forEach((e) => e[1] && (e[1] += ' !important'))
return body
}
}
},
(matcher) => {
if (!matcher.startsWith('h:')) return matcher
return {
matcher: matcher.slice(2),
selector: (s) => `${s}:hover`,
body: (body) => {
body.push(['transition', 'all var(--trans-time)'])
return body
}
}
},
(matcher) => {
if (!matcher.startsWith('child:')) return matcher
return {
matcher: matcher.slice(6),
selector: (s) => `${s}>*`,
body: (s) => s
}
},
(matcher) => {
// "child<code>xxx".match(/child<(\w+)>/ ) =====> ['child<code>', 'code']
const matchResult = matcher.match(/^child<(\w+)>/)
if (!matchResult) return matcher
const [matchStr, selector] = matchResult
return {
matcher: matcher.slice(matchStr.length),
selector: (s) => `${s} ${selector}`,
body: (s) => s
}
}
]

View File

@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Opentiny openinula 组件调试</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

View File

@ -0,0 +1,29 @@
{
"name": "@opentiny/openinula-docs",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"@opentiny/openinula": "workspace:~",
"openinula": "^0.1.1"
},
"devDependencies": {
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.6",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"@vitejs/plugin-react": "^4.0.1",
"eslint": "^8.44.0",
"eslint-plugin-react-hooks": "^4.6.0",
"postcss": "^8.4.16",
"typescript": "^5.0.2",
"vite": "^4.3.8",
"vite-plugin-svgr": "^3.2.0"
}
}

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,12 @@
import { Alert } from '@opentiny/openinula'
// 在这里导入组件,进行 api 调试
function App() {
return (
<div className="app">
<Alert description="默认提示组件" />
</div>
)
}
export default App

View File

@ -0,0 +1,4 @@
.app {
margin: 10px;
width: 500px;
}

View File

@ -0,0 +1,5 @@
import Inula from 'openinula'
import App from './App.tsx'
import './main.css'
Inula.render(<App />, document.getElementById('root'))

View File

@ -0,0 +1,25 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
}

View File

@ -0,0 +1,10 @@
{
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
}

View File

@ -0,0 +1,16 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import svgr from 'vite-plugin-svgr'
const alias = {
react: 'openinula',
'react-dom': 'openinula',
'react/jsx-dev-runtime': 'openinula/jsx-dev-runtime'
}
export default defineConfig({
plugins: [svgr(), react({ include: /\.(mdx|js|jsx|ts|tsx)$/ })],
resolve: {
alias
}
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 KiB

Some files were not shown because too many files have changed in this diff Show More