From 93507d0165e1ecadccd7bef03067733ed3e362f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E5=84=80=E5=BC=8F?= <854085467@qq.com> Date: Sat, 25 Dec 2021 00:09:30 +0800 Subject: [PATCH] ci eslint --- .eslintcache | 1 + .eslintrc.js | 79 ++++++++++ package.json | 11 +- src/index.ts | 142 ++++++++--------- src/module/avatar/index.ts | 12 +- src/module/backTop/index.ts | 12 +- src/module/backTop/index.vue | 2 +- src/module/badge/index.ts | 12 +- src/module/badge/index.vue | 2 +- src/module/block/index.ts | 12 +- src/module/block/index.vue | 2 +- src/module/body/index.ts | 12 +- src/module/body/index.vue | 2 +- src/module/breadcrumb/index.ts | 12 +- src/module/breadcrumbItem/index.ts | 12 +- src/module/button/index.ts | 13 +- src/module/button/index.vue | 2 +- src/module/buttonContainer/index.ts | 12 +- src/module/buttonContainer/index.vue | 2 +- src/module/buttonGroup/index.ts | 12 +- src/module/buttonGroup/index.vue | 2 +- src/module/card/index.ts | 12 +- src/module/card/index.vue | 4 +- src/module/carousel/index.ts | 12 +- src/module/carouselItem/index.ts | 12 +- src/module/checkbox/index.ts | 12 +- src/module/checkbox/index.vue | 4 +- src/module/checkboxGroup/index.ts | 12 +- src/module/col/index.ts | 12 +- src/module/col/index.vue | 2 +- src/module/collapse/index.ts | 12 +- src/module/collapse/index.vue | 2 +- src/module/collapseItem/index.ts | 12 +- src/module/collapseItem/index.vue | 2 +- src/module/colorPicker/ColorBox.vue | 2 +- src/module/colorPicker/colorPicker.type.ts | 12 +- src/module/colorPicker/colorUtil.ts | 128 ++++++++-------- src/module/colorPicker/index.ts | 12 +- src/module/colorPicker/index.vue | 2 +- src/module/container/index.ts | 12 +- src/module/container/index.vue | 2 +- src/module/count/index.ts | 12 +- src/module/count/index.vue | 2 +- src/module/dropdown/index.ts | 12 +- src/module/dropdown/index.vue | 8 +- src/module/dropdownItem/index.ts | 12 +- src/module/dropdownItem/index.vue | 2 +- src/module/empty/index.ts | 12 +- src/module/field/index.ts | 12 +- src/module/field/index.vue | 2 +- src/module/footer/index.ts | 12 +- src/module/footer/index.vue | 2 +- src/module/form/index.ts | 12 +- src/module/form/index.vue | 2 +- src/module/formItem/cnValidateMessage.ts | 92 +++++------ src/module/formItem/index.ts | 12 +- src/module/formItem/index.vue | 2 +- src/module/header/index.ts | 12 +- src/module/header/index.vue | 2 +- src/module/icon/index.ts | 12 +- src/module/iconPicker/index.ts | 12 +- src/module/iconPicker/index.vue | 23 ++- src/module/input/index.ts | 12 +- src/module/inputNumber/index.ts | 12 +- src/module/inputNumber/index.vue | 6 +- src/module/layer/modal/index.ts | 12 +- src/module/layout/index.ts | 12 +- src/module/layout/index.vue | 2 +- src/module/line/index.ts | 12 +- src/module/logo/index.ts | 12 +- src/module/logo/index.vue | 2 +- src/module/menu/index.ts | 12 +- src/module/menu/index.vue | 2 +- src/module/menuChildItem/index.ts | 12 +- src/module/menuItem/index.ts | 12 +- src/module/menuItem/index.vue | 4 +- src/module/page/index.ts | 12 +- src/module/page/index.vue | 5 +- src/module/panel/index.ts | 12 +- src/module/panel/index.vue | 2 +- src/module/popper/calcPosition.ts | 115 ++++++++------ src/module/popper/usePopper.ts | 84 +++++----- src/module/progress/index.ts | 12 +- src/module/radio/index.ts | 12 +- src/module/radio/index.vue | 2 +- src/module/rate/index.ts | 12 +- src/module/rate/index.vue | 4 +- src/module/row/index.ts | 12 +- src/module/row/index.vue | 2 +- src/module/scroll/index.ts | 12 +- src/module/select/index.ts | 12 +- src/module/select/index.vue | 9 +- src/module/selectOption/index.ts | 12 +- src/module/selectOption/index.vue | 2 +- src/module/side/index.ts | 12 +- src/module/side/index.vue | 2 +- src/module/slider/index.ts | 12 +- src/module/switch/index.ts | 12 +- src/module/switch/index.vue | 2 +- src/module/tab/index.ts | 12 +- src/module/tab/index.vue | 2 +- src/module/tabItem/index.ts | 12 +- src/module/tabItem/index.vue | 2 +- src/module/table/index.ts | 12 +- src/module/table/index.vue | 19 +-- src/module/textarea/index.ts | 12 +- src/module/textarea/index.vue | 2 +- src/module/timeline/index.ts | 12 +- src/module/timeline/index.vue | 2 +- src/module/timelineItem/index.ts | 12 +- src/module/timelineItem/index.vue | 2 +- src/module/tooltip/index.ts | 12 +- src/module/tooltip/index.vue | 6 +- src/module/transfer/index.ts | 12 +- src/module/transfer/index.vue | 12 +- src/module/tree/TreeNode.vue | 3 +- src/module/tree/index.ts | 12 +- src/module/tree/index.vue | 2 +- src/module/tree/tree.ts | 170 ++++++++++----------- src/module/tree/tree.type.ts | 48 +++--- src/module/tree/useTree.ts | 36 ++--- src/module/type/form.ts | 48 +++--- src/module/type/index.ts | 6 +- src/module/type/public.ts | 22 +-- src/module/type/select.ts | 12 +- src/tools/guidUtil.ts | 24 ++- 126 files changed, 1028 insertions(+), 912 deletions(-) create mode 100644 .eslintcache create mode 100644 .eslintrc.js diff --git a/.eslintcache b/.eslintcache new file mode 100644 index 00000000..f3effa11 --- /dev/null +++ b/.eslintcache @@ -0,0 +1 @@ +[{"D:\\project\\layui-vue\\src\\index.ts":"1","D:\\project\\layui-vue\\src\\module\\avatar\\index.ts":"2","D:\\project\\layui-vue\\src\\module\\avatar\\index.vue":"3","D:\\project\\layui-vue\\src\\module\\backTop\\index.ts":"4","D:\\project\\layui-vue\\src\\module\\backTop\\index.vue":"5","D:\\project\\layui-vue\\src\\module\\badge\\index.ts":"6","D:\\project\\layui-vue\\src\\module\\badge\\index.vue":"7","D:\\project\\layui-vue\\src\\module\\block\\index.ts":"8","D:\\project\\layui-vue\\src\\module\\block\\index.vue":"9","D:\\project\\layui-vue\\src\\module\\body\\index.ts":"10","D:\\project\\layui-vue\\src\\module\\body\\index.vue":"11","D:\\project\\layui-vue\\src\\module\\breadcrumb\\index.ts":"12","D:\\project\\layui-vue\\src\\module\\breadcrumb\\index.vue":"13","D:\\project\\layui-vue\\src\\module\\breadcrumbItem\\index.ts":"14","D:\\project\\layui-vue\\src\\module\\breadcrumbItem\\index.vue":"15","D:\\project\\layui-vue\\src\\module\\button\\index.ts":"16","D:\\project\\layui-vue\\src\\module\\button\\index.vue":"17","D:\\project\\layui-vue\\src\\module\\buttonContainer\\index.ts":"18","D:\\project\\layui-vue\\src\\module\\buttonContainer\\index.vue":"19","D:\\project\\layui-vue\\src\\module\\buttonGroup\\index.ts":"20","D:\\project\\layui-vue\\src\\module\\buttonGroup\\index.vue":"21","D:\\project\\layui-vue\\src\\module\\card\\index.ts":"22","D:\\project\\layui-vue\\src\\module\\card\\index.vue":"23","D:\\project\\layui-vue\\src\\module\\carousel\\index.ts":"24","D:\\project\\layui-vue\\src\\module\\carousel\\index.vue":"25","D:\\project\\layui-vue\\src\\module\\carouselItem\\index.ts":"26","D:\\project\\layui-vue\\src\\module\\carouselItem\\index.vue":"27","D:\\project\\layui-vue\\src\\module\\checkbox\\index.ts":"28","D:\\project\\layui-vue\\src\\module\\checkbox\\index.vue":"29","D:\\project\\layui-vue\\src\\module\\checkboxGroup\\index.ts":"30","D:\\project\\layui-vue\\src\\module\\checkboxGroup\\index.vue":"31","D:\\project\\layui-vue\\src\\module\\col\\index.ts":"32","D:\\project\\layui-vue\\src\\module\\col\\index.vue":"33","D:\\project\\layui-vue\\src\\module\\collapse\\index.ts":"34","D:\\project\\layui-vue\\src\\module\\collapse\\index.vue":"35","D:\\project\\layui-vue\\src\\module\\collapseItem\\index.ts":"36","D:\\project\\layui-vue\\src\\module\\collapseItem\\index.vue":"37","D:\\project\\layui-vue\\src\\module\\colorPicker\\ColorBox.vue":"38","D:\\project\\layui-vue\\src\\module\\colorPicker\\colorPicker.type.ts":"39","D:\\project\\layui-vue\\src\\module\\colorPicker\\ColorPicker.vue":"40","D:\\project\\layui-vue\\src\\module\\colorPicker\\colorUtil.ts":"41","D:\\project\\layui-vue\\src\\module\\colorPicker\\index.ts":"42","D:\\project\\layui-vue\\src\\module\\colorPicker\\index.vue":"43","D:\\project\\layui-vue\\src\\module\\container\\index.ts":"44","D:\\project\\layui-vue\\src\\module\\container\\index.vue":"45","D:\\project\\layui-vue\\src\\module\\count\\index.ts":"46","D:\\project\\layui-vue\\src\\module\\count\\index.vue":"47","D:\\project\\layui-vue\\src\\module\\dropdown\\index.ts":"48","D:\\project\\layui-vue\\src\\module\\dropdown\\index.vue":"49","D:\\project\\layui-vue\\src\\module\\dropdownItem\\index.ts":"50","D:\\project\\layui-vue\\src\\module\\dropdownItem\\index.vue":"51","D:\\project\\layui-vue\\src\\module\\empty\\index.ts":"52","D:\\project\\layui-vue\\src\\module\\empty\\index.vue":"53","D:\\project\\layui-vue\\src\\module\\field\\index.ts":"54","D:\\project\\layui-vue\\src\\module\\field\\index.vue":"55","D:\\project\\layui-vue\\src\\module\\footer\\index.ts":"56","D:\\project\\layui-vue\\src\\module\\footer\\index.vue":"57","D:\\project\\layui-vue\\src\\module\\form\\index.ts":"58","D:\\project\\layui-vue\\src\\module\\form\\index.vue":"59","D:\\project\\layui-vue\\src\\module\\formItem\\cnValidateMessage.ts":"60","D:\\project\\layui-vue\\src\\module\\formItem\\index.ts":"61","D:\\project\\layui-vue\\src\\module\\formItem\\index.vue":"62","D:\\project\\layui-vue\\src\\module\\header\\index.ts":"63","D:\\project\\layui-vue\\src\\module\\header\\index.vue":"64","D:\\project\\layui-vue\\src\\module\\icon\\index.ts":"65","D:\\project\\layui-vue\\src\\module\\iconPicker\\index.ts":"66","D:\\project\\layui-vue\\src\\module\\iconPicker\\index.vue":"67","D:\\project\\layui-vue\\src\\module\\input\\index.ts":"68","D:\\project\\layui-vue\\src\\module\\input\\index.vue":"69","D:\\project\\layui-vue\\src\\module\\inputNumber\\index.ts":"70","D:\\project\\layui-vue\\src\\module\\inputNumber\\index.vue":"71","D:\\project\\layui-vue\\src\\module\\layer\\modal\\index.ts":"72","D:\\project\\layui-vue\\src\\module\\layout\\index.ts":"73","D:\\project\\layui-vue\\src\\module\\layout\\index.vue":"74","D:\\project\\layui-vue\\src\\module\\line\\index.ts":"75","D:\\project\\layui-vue\\src\\module\\line\\index.vue":"76","D:\\project\\layui-vue\\src\\module\\logo\\index.ts":"77","D:\\project\\layui-vue\\src\\module\\logo\\index.vue":"78","D:\\project\\layui-vue\\src\\module\\menu\\index.ts":"79","D:\\project\\layui-vue\\src\\module\\menu\\index.vue":"80","D:\\project\\layui-vue\\src\\module\\menuChildItem\\index.ts":"81","D:\\project\\layui-vue\\src\\module\\menuChildItem\\index.vue":"82","D:\\project\\layui-vue\\src\\module\\menuItem\\index.ts":"83","D:\\project\\layui-vue\\src\\module\\menuItem\\index.vue":"84","D:\\project\\layui-vue\\src\\module\\page\\index.ts":"85","D:\\project\\layui-vue\\src\\module\\page\\index.vue":"86","D:\\project\\layui-vue\\src\\module\\panel\\index.ts":"87","D:\\project\\layui-vue\\src\\module\\panel\\index.vue":"88","D:\\project\\layui-vue\\src\\module\\popper\\calcPosition.ts":"89","D:\\project\\layui-vue\\src\\module\\popper\\index.vue":"90","D:\\project\\layui-vue\\src\\module\\popper\\usePopper.ts":"91","D:\\project\\layui-vue\\src\\module\\progress\\index.ts":"92","D:\\project\\layui-vue\\src\\module\\progress\\index.vue":"93","D:\\project\\layui-vue\\src\\module\\radio\\index.ts":"94","D:\\project\\layui-vue\\src\\module\\radio\\index.vue":"95","D:\\project\\layui-vue\\src\\module\\rate\\index.ts":"96","D:\\project\\layui-vue\\src\\module\\rate\\index.vue":"97","D:\\project\\layui-vue\\src\\module\\row\\index.ts":"98","D:\\project\\layui-vue\\src\\module\\row\\index.vue":"99","D:\\project\\layui-vue\\src\\module\\scroll\\index.ts":"100","D:\\project\\layui-vue\\src\\module\\scroll\\index.vue":"101","D:\\project\\layui-vue\\src\\module\\select\\index.ts":"102","D:\\project\\layui-vue\\src\\module\\select\\index.vue":"103","D:\\project\\layui-vue\\src\\module\\selectOption\\index.ts":"104","D:\\project\\layui-vue\\src\\module\\selectOption\\index.vue":"105","D:\\project\\layui-vue\\src\\module\\side\\index.ts":"106","D:\\project\\layui-vue\\src\\module\\side\\index.vue":"107","D:\\project\\layui-vue\\src\\module\\slider\\index.ts":"108","D:\\project\\layui-vue\\src\\module\\slider\\index.vue":"109","D:\\project\\layui-vue\\src\\module\\switch\\index.ts":"110","D:\\project\\layui-vue\\src\\module\\switch\\index.vue":"111","D:\\project\\layui-vue\\src\\module\\tab\\index.ts":"112","D:\\project\\layui-vue\\src\\module\\tab\\index.vue":"113","D:\\project\\layui-vue\\src\\module\\tabItem\\index.ts":"114","D:\\project\\layui-vue\\src\\module\\tabItem\\index.vue":"115","D:\\project\\layui-vue\\src\\module\\table\\index.ts":"116","D:\\project\\layui-vue\\src\\module\\table\\index.vue":"117","D:\\project\\layui-vue\\src\\module\\textarea\\index.ts":"118","D:\\project\\layui-vue\\src\\module\\textarea\\index.vue":"119","D:\\project\\layui-vue\\src\\module\\timeline\\index.ts":"120","D:\\project\\layui-vue\\src\\module\\timeline\\index.vue":"121","D:\\project\\layui-vue\\src\\module\\timelineItem\\index.ts":"122","D:\\project\\layui-vue\\src\\module\\timelineItem\\index.vue":"123","D:\\project\\layui-vue\\src\\module\\tooltip\\index.ts":"124","D:\\project\\layui-vue\\src\\module\\tooltip\\index.vue":"125","D:\\project\\layui-vue\\src\\module\\transfer\\index.ts":"126","D:\\project\\layui-vue\\src\\module\\transfer\\index.vue":"127","D:\\project\\layui-vue\\src\\module\\tree\\index.ts":"128","D:\\project\\layui-vue\\src\\module\\tree\\index.vue":"129","D:\\project\\layui-vue\\src\\module\\tree\\tree.ts":"130","D:\\project\\layui-vue\\src\\module\\tree\\tree.type.ts":"131","D:\\project\\layui-vue\\src\\module\\tree\\TreeNode.vue":"132","D:\\project\\layui-vue\\src\\module\\tree\\useTree.ts":"133","D:\\project\\layui-vue\\src\\module\\type\\form.ts":"134","D:\\project\\layui-vue\\src\\module\\type\\index.ts":"135","D:\\project\\layui-vue\\src\\module\\type\\public.ts":"136","D:\\project\\layui-vue\\src\\module\\type\\select.ts":"137","D:\\project\\layui-vue\\src\\tools\\guidUtil.ts":"138"},{"size":5418,"mtime":1640272189321},{"size":273,"mtime":1640050780266},{"size":434,"mtime":1640324493915,"results":"139","hashOfConfig":"140"},{"size":274,"mtime":1640050780267},{"size":5411,"mtime":1640324494320},{"size":272,"mtime":1640050780268},{"size":741,"mtime":1640324494423},{"size":272,"mtime":1640050780269},{"size":341,"mtime":1640324494480},{"size":271,"mtime":1640050780270},{"size":215,"mtime":1640324494533},{"size":277,"mtime":1640050780271},{"size":376,"mtime":1640324494572,"results":"141","hashOfConfig":"140"},{"size":281,"mtime":1640050780272},{"size":468,"mtime":1640324494621,"results":"142","hashOfConfig":"140"},{"size":273,"mtime":1640050780273},{"size":1276,"mtime":1640324494755},{"size":280,"mtime":1640050780274},{"size":220,"mtime":1640324494806},{"size":276,"mtime":1640050780275},{"size":212,"mtime":1640324494857},{"size":272,"mtime":1640050780276},{"size":565,"mtime":1640324494939},{"size":275,"mtime":1640050780277},{"size":2211,"mtime":1640324495096,"results":"143","hashOfConfig":"140"},{"size":279,"mtime":1640050780277},{"size":285,"mtime":1640324495131,"results":"144","hashOfConfig":"140"},{"size":275,"mtime":1640050780278},{"size":2562,"mtime":1640324495238},{"size":280,"mtime":1640050780279},{"size":884,"mtime":1640324495285,"results":"145","hashOfConfig":"140"},{"size":270,"mtime":1640050780280},{"size":922,"mtime":1640324495337},{"size":275,"mtime":1640050780282},{"size":785,"mtime":1640324495383},{"size":279,"mtime":1640050780283},{"size":1489,"mtime":1640324495451},{"size":2763,"mtime":1640324495551},{"size":1319,"mtime":1640050780284},{"size":2413,"mtime":1640324495639,"results":"146","hashOfConfig":"140"},{"size":2596,"mtime":1640050780285},{"size":278,"mtime":1640050780285},{"size":1079,"mtime":1640324495674},{"size":276,"mtime":1640050780286},{"size":476,"mtime":1640324495719},{"size":272,"mtime":1640050780287},{"size":105,"mtime":1640324495738},{"size":275,"mtime":1640050780287},{"size":1593,"mtime":1640324495809},{"size":279,"mtime":1640050780288},{"size":342,"mtime":1640324495834},{"size":272,"mtime":1640050780289},{"size":601,"mtime":1640324495886,"results":"147","hashOfConfig":"140"},{"size":272,"mtime":1640050780290},{"size":508,"mtime":1640324495926},{"size":273,"mtime":1640050780291},{"size":204,"mtime":1640324495956},{"size":271,"mtime":1640050780292},{"size":4082,"mtime":1640324496087},{"size":1823,"mtime":1640050780293},{"size":275,"mtime":1640050780293},{"size":5012,"mtime":1640324496216},{"size":273,"mtime":1640050780294},{"size":204,"mtime":1640324496256},{"size":291,"mtime":1640050780295},{"size":277,"mtime":1640050780295},{"size":5761,"mtime":1640324496417},{"size":272,"mtime":1640050780297},{"size":954,"mtime":1640324496461,"results":"148","hashOfConfig":"140"},{"size":278,"mtime":1640050780298},{"size":3312,"mtime":1640324496590},{"size":278,"mtime":1640050780299},{"size":273,"mtime":1640050780299},{"size":886,"mtime":1640324496673},{"size":271,"mtime":1640050780300},{"size":206,"mtime":1640324496696,"results":"149","hashOfConfig":"140"},{"size":271,"mtime":1640050780301},{"size":122,"mtime":1640324496712},{"size":271,"mtime":1640050780302},{"size":909,"mtime":1640324496748},{"size":280,"mtime":1640050780302},{"size":584,"mtime":1640324496787,"results":"150","hashOfConfig":"140"},{"size":275,"mtime":1640050780303},{"size":1425,"mtime":1640324496850},{"size":271,"mtime":1640050780304},{"size":3394,"mtime":1640324496981},{"size":270,"mtime":1640050780305},{"size":202,"mtime":1640324497017},{"size":1973,"mtime":1640050780306},{"size":3200,"mtime":1640324497111,"results":"151","hashOfConfig":"140"},{"size":1543,"mtime":1640050780307},{"size":275,"mtime":1640050780308},{"size":794,"mtime":1640324497167,"results":"152","hashOfConfig":"140"},{"size":273,"mtime":1640050780308},{"size":1053,"mtime":1640324497221},{"size":271,"mtime":1640050780310},{"size":2834,"mtime":1640324497332},{"size":268,"mtime":1640050780311},{"size":456,"mtime":1640324497400},{"size":273,"mtime":1640050780311},{"size":136,"mtime":1640324497414,"results":"153","hashOfConfig":"140"},{"size":273,"mtime":1640050780312},{"size":5433,"mtime":1640324497556},{"size":279,"mtime":1640050780313},{"size":1562,"mtime":1640324497601},{"size":271,"mtime":1640050780314},{"size":516,"mtime":1640324497638},{"size":273,"mtime":1640050780315},{"size":4289,"mtime":1640324497767,"results":"154","hashOfConfig":"140"},{"size":271,"mtime":1640050780316},{"size":1140,"mtime":1640324497818},{"size":270,"mtime":1640050780317},{"size":2768,"mtime":1640324497896},{"size":274,"mtime":1640050780318},{"size":599,"mtime":1640324497935},{"size":272,"mtime":1640050780319},{"size":7351,"mtime":1640324498207},{"size":275,"mtime":1640050780320},{"size":993,"mtime":1640324498262},{"size":275,"mtime":1640050780321},{"size":206,"mtime":1640324498301},{"size":279,"mtime":1640050780321},{"size":645,"mtime":1640324498343},{"size":274,"mtime":1640050780322},{"size":806,"mtime":1640324498365},{"size":275,"mtime":1640050780323},{"size":4910,"mtime":1640324498511},{"size":271,"mtime":1640050780325},{"size":2228,"mtime":1640324498566},{"size":5289,"mtime":1640050780326},{"size":884,"mtime":1640050780326},{"size":3723,"mtime":1640324498658},{"size":1129,"mtime":1640050780326},{"size":966,"mtime":1640050780327},{"size":76,"mtime":1640050780327},{"size":603,"mtime":1640050780327},{"size":318,"mtime":1640050780328},{"size":338,"mtime":1640322598692},{"filePath":"155","messages":"156","errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"1dzfhos",{"filePath":"157","messages":"158","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"159","messages":"160","errorCount":6,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"161","messages":"162","errorCount":8,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"163","messages":"164","errorCount":4,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"165","messages":"166","errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"167","messages":"168","errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"169","messages":"170","errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"171","messages":"172","errorCount":8,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"173","messages":"174","errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"175","messages":"176","errorCount":4,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"177","messages":"178","errorCount":6,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"179","messages":"180","errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"181","messages":"182","errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"183","messages":"184","errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"D:\\project\\layui-vue\\src\\module\\avatar\\index.vue",["185","186"],"D:\\project\\layui-vue\\src\\module\\breadcrumb\\index.vue",[],"D:\\project\\layui-vue\\src\\module\\breadcrumbItem\\index.vue",["187","188","189","190","191","192"],"D:\\project\\layui-vue\\src\\module\\carousel\\index.vue",["193","194","195","196","197","198","199","200"],"D:\\project\\layui-vue\\src\\module\\carouselItem\\index.vue",["201","202","203","204"],"D:\\project\\layui-vue\\src\\module\\checkboxGroup\\index.vue",["205","206"],"D:\\project\\layui-vue\\src\\module\\colorPicker\\ColorPicker.vue",["207","208"],"D:\\project\\layui-vue\\src\\module\\empty\\index.vue",["209","210"],"D:\\project\\layui-vue\\src\\module\\input\\index.vue",["211","212","213","214","215","216","217","218"],"D:\\project\\layui-vue\\src\\module\\line\\index.vue",["219","220"],"D:\\project\\layui-vue\\src\\module\\menuChildItem\\index.vue",["221","222","223","224"],"D:\\project\\layui-vue\\src\\module\\popper\\index.vue",["225","226","227","228","229","230"],"D:\\project\\layui-vue\\src\\module\\progress\\index.vue",["231","232"],"D:\\project\\layui-vue\\src\\module\\scroll\\index.vue",["233"],"D:\\project\\layui-vue\\src\\module\\slider\\index.vue",["234","235"],{"ruleId":"236","severity":2,"message":"237","line":11,"column":7,"nodeType":"238","messageId":"239","endLine":11,"endColumn":12},{"ruleId":"240","severity":2,"message":"237","line":11,"column":7,"nodeType":"238","messageId":"239","endLine":11,"endColumn":12},{"ruleId":"236","severity":2,"message":"241","line":16,"column":7,"nodeType":"238","messageId":"239","endLine":16,"endColumn":11},{"ruleId":"240","severity":2,"message":"241","line":16,"column":7,"nodeType":"238","messageId":"239","endLine":16,"endColumn":11},{"ruleId":"236","severity":2,"message":"237","line":18,"column":7,"nodeType":"238","messageId":"239","endLine":18,"endColumn":12},{"ruleId":"240","severity":2,"message":"237","line":18,"column":7,"nodeType":"238","messageId":"239","endLine":18,"endColumn":12},{"ruleId":"236","severity":2,"message":"242","line":22,"column":7,"nodeType":"238","messageId":"239","endLine":22,"endColumn":16},{"ruleId":"240","severity":2,"message":"242","line":22,"column":7,"nodeType":"238","messageId":"239","endLine":22,"endColumn":16},{"ruleId":"236","severity":2,"message":"243","line":43,"column":3,"nodeType":"238","messageId":"239","endLine":43,"endColumn":6},{"ruleId":"240","severity":2,"message":"243","line":43,"column":3,"nodeType":"238","messageId":"239","endLine":43,"endColumn":6},{"ruleId":"236","severity":2,"message":"244","line":79,"column":7,"nodeType":"238","messageId":"239","endLine":79,"endColumn":13},{"ruleId":"240","severity":2,"message":"244","line":79,"column":7,"nodeType":"238","messageId":"239","endLine":79,"endColumn":13},{"ruleId":"236","severity":2,"message":"245","line":86,"column":7,"nodeType":"238","messageId":"239","endLine":86,"endColumn":11},{"ruleId":"240","severity":2,"message":"245","line":86,"column":7,"nodeType":"238","messageId":"239","endLine":86,"endColumn":11},{"ruleId":"236","severity":2,"message":"246","line":98,"column":7,"nodeType":"238","messageId":"239","endLine":98,"endColumn":11},{"ruleId":"240","severity":2,"message":"246","line":98,"column":7,"nodeType":"238","messageId":"239","endLine":98,"endColumn":11},{"ruleId":"236","severity":2,"message":"237","line":9,"column":7,"nodeType":"238","messageId":"239","endLine":9,"endColumn":12},{"ruleId":"240","severity":2,"message":"237","line":9,"column":7,"nodeType":"238","messageId":"239","endLine":9,"endColumn":12},{"ruleId":"236","severity":2,"message":"247","line":13,"column":7,"nodeType":"238","messageId":"239","endLine":13,"endColumn":13},{"ruleId":"240","severity":2,"message":"247","line":13,"column":7,"nodeType":"238","messageId":"239","endLine":13,"endColumn":13},{"ruleId":"236","severity":2,"message":"248","line":14,"column":10,"nodeType":"238","messageId":"239","endLine":14,"endColumn":18},{"ruleId":"240","severity":2,"message":"248","line":14,"column":10,"nodeType":"238","messageId":"239","endLine":14,"endColumn":18},{"ruleId":"236","severity":2,"message":"237","line":15,"column":7,"nodeType":"238","messageId":"239","endLine":15,"endColumn":12},{"ruleId":"240","severity":2,"message":"237","line":15,"column":7,"nodeType":"238","messageId":"239","endLine":15,"endColumn":12},{"ruleId":"236","severity":2,"message":"237","line":16,"column":7,"nodeType":"238","messageId":"239","endLine":16,"endColumn":12},{"ruleId":"240","severity":2,"message":"237","line":16,"column":7,"nodeType":"238","messageId":"239","endLine":16,"endColumn":12},{"ruleId":"236","severity":2,"message":"237","line":27,"column":7,"nodeType":"238","messageId":"239","endLine":27,"endColumn":12},{"ruleId":"240","severity":2,"message":"237","line":27,"column":7,"nodeType":"238","messageId":"239","endLine":27,"endColumn":12},{"ruleId":"236","severity":2,"message":"249","line":31,"column":7,"nodeType":"238","messageId":"239","endLine":31,"endColumn":14},{"ruleId":"240","severity":2,"message":"249","line":31,"column":7,"nodeType":"238","messageId":"239","endLine":31,"endColumn":14},{"ruleId":"236","severity":2,"message":"250","line":37,"column":7,"nodeType":"238","messageId":"239","endLine":37,"endColumn":14},{"ruleId":"240","severity":2,"message":"250","line":37,"column":7,"nodeType":"238","messageId":"239","endLine":37,"endColumn":14},{"ruleId":"236","severity":2,"message":"251","line":41,"column":7,"nodeType":"238","messageId":"239","endLine":41,"endColumn":13},{"ruleId":"240","severity":2,"message":"251","line":41,"column":7,"nodeType":"238","messageId":"239","endLine":41,"endColumn":13},{"ruleId":"236","severity":2,"message":"237","line":8,"column":7,"nodeType":"238","messageId":"239","endLine":8,"endColumn":12},{"ruleId":"240","severity":2,"message":"237","line":8,"column":7,"nodeType":"238","messageId":"239","endLine":8,"endColumn":12},{"ruleId":"236","severity":2,"message":"252","line":13,"column":7,"nodeType":"238","messageId":"239","endLine":13,"endColumn":12},{"ruleId":"240","severity":2,"message":"252","line":13,"column":7,"nodeType":"238","messageId":"239","endLine":13,"endColumn":12},{"ruleId":"236","severity":2,"message":"253","line":22,"column":7,"nodeType":"238","messageId":"239","endLine":22,"endColumn":19},{"ruleId":"240","severity":2,"message":"253","line":22,"column":7,"nodeType":"238","messageId":"239","endLine":22,"endColumn":19},{"ruleId":"236","severity":2,"message":"254","line":28,"column":3,"nodeType":"238","messageId":"239","endLine":28,"endColumn":12},{"ruleId":"240","severity":2,"message":"254","line":28,"column":3,"nodeType":"238","messageId":"239","endLine":28,"endColumn":12},{"ruleId":"236","severity":2,"message":"255","line":29,"column":3,"nodeType":"238","messageId":"239","endLine":29,"endColumn":14},{"ruleId":"240","severity":2,"message":"255","line":29,"column":3,"nodeType":"238","messageId":"239","endLine":29,"endColumn":14},{"ruleId":"236","severity":2,"message":"256","line":68,"column":7,"nodeType":"238","messageId":"239","endLine":68,"endColumn":19},{"ruleId":"240","severity":2,"message":"256","line":68,"column":7,"nodeType":"238","messageId":"239","endLine":68,"endColumn":19},{"ruleId":"236","severity":2,"message":"257","line":19,"column":7,"nodeType":"238","messageId":"239","endLine":19,"endColumn":13},{"ruleId":"240","severity":2,"message":"257","line":19,"column":7,"nodeType":"238","messageId":"239","endLine":19,"endColumn":13},{"ruleId":"258","severity":2,"message":"259","line":1,"column":1,"nodeType":null,"messageId":"260"},{"ruleId":"236","severity":2,"message":"261","line":82,"column":10,"nodeType":"238","messageId":"239","endLine":82,"endColumn":26},{"ruleId":"240","severity":2,"message":"261","line":82,"column":10,"nodeType":"238","messageId":"239","endLine":82,"endColumn":26},"@typescript-eslint/no-unused-vars","'props' is assigned a value but never used. Allowed unused vars must match /^_/u.","Identifier","unusedVar","no-unused-vars","'slot' is assigned a value but never used. Allowed unused vars must match /^_/u.","'separator' is assigned a value but never used. Allowed unused vars must match /^_/u.","'ref' is defined but never used. Allowed unused vars must match /^_/u.","'change' is assigned a value but never used. Allowed unused vars must match /^_/u.","'prev' is assigned a value but never used. Allowed unused vars must match /^_/u.","'next' is assigned a value but never used. Allowed unused vars must match /^_/u.","'active' is assigned a value but never used. Allowed unused vars must match /^_/u.","'computed' is defined but never used. Allowed unused vars must match /^_/u.","'onInput' is assigned a value but never used. Allowed unused vars must match /^_/u.","'onFocus' is assigned a value but never used. Allowed unused vars must match /^_/u.","'onBlur' is assigned a value but never used. Allowed unused vars must match /^_/u.","'slots' is assigned a value but never used. Allowed unused vars must match /^_/u.","'selectHandle' is assigned a value but never used. Allowed unused vars must match /^_/u.","'onUpdated' is defined but never used. Allowed unused vars must match /^_/u.","'defineEmits' is defined but never used. Allowed unused vars must match /^_/u.","'innnerIsDark' is assigned a value but never used. Allowed unused vars must match /^_/u.","'styles' is assigned a value but never used. Allowed unused vars must match /^_/u.","vue/multi-word-component-names","Component name \"index\" should always be multi-word.","unexpected","'handle_mousedown' is defined but never used. Allowed unused vars must match /^_/u."] \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..b7477571 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,79 @@ +module.exports = { + root: true, + env: { + browser: true, + node: true, + es6: true + }, + parser: 'vue-eslint-parser', + parserOptions: { + parser: '@typescript-eslint/parser', + ecmaVersion: 2020, + sourceType: 'module', + jsxPragma: 'React', + ecmaFeatures: { + jsx: true + } + }, + globals: { + AMap: false, + AMapUI: false + }, + extends: [ + 'plugin:vue/vue3-recommended', + 'plugin:@typescript-eslint/recommended', + 'prettier', + 'plugin:prettier/recommended' + ], + rules: { + '@typescript-eslint/ban-ts-ignore': 'off', + '@typescript-eslint/explicit-function-return-type': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/no-empty-function': 'off', + 'vue/custom-event-name-casing': 'off', + 'no-use-before-define': 'off', + '@typescript-eslint/no-use-before-define': 'off', + '@typescript-eslint/ban-ts-comment': 'off', + '@typescript-eslint/ban-types': 'off', + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/no-unused-vars': [ + 'error', + { + argsIgnorePattern: '^_', + varsIgnorePattern: '^_' + } + ], + 'no-unused-vars': [ + 'error', + { + argsIgnorePattern: '^_', + varsIgnorePattern: '^_' + } + ], + 'space-before-function-paren': 'off', + 'vue/name-property-casing': ['error', 'PascalCase'], // vue/component-definition-name-casing 对组件定义名称强制使用特定的大小 + 'vue/attributes-order': 'off', + 'vue/one-component-per-file': 'off', + 'vue/html-closing-bracket-newline': 'off', + 'vue/max-attributes-per-line': 'off', + 'vue/multiline-html-element-content-newline': 'off', + 'vue/singleline-html-element-content-newline': 'off', + 'vue/attribute-hyphenation': 'off', + 'vue/require-default-prop': 'off', + 'vue/script-setup-uses-vars': 'off', + 'vue/html-self-closing': [ + 'error', + { + html: { + void: 'always', + normal: 'never', + component: 'always' + }, + svg: 'always', + math: 'always' + } + ] + } + } \ No newline at end of file diff --git a/package.json b/package.json index b04295f3..f39c66d1 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "build": "vite build --emptyOutDir && npm run build:types", "build:types": "rimraf types && tsc -d", "build:example": "vite build example", + "lint:eslint": "eslint --cache --max-warnings 0 \"src/**/*.{vue,ts,tsx}\" --fix", "lint:prettier": "prettier --write \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\"" }, "peerDependencies": { @@ -33,12 +34,14 @@ "vue-router": "^4.0.12" }, "dependencies": { - "vue": "^3.2.26", "@layui/hooks-vue": "^0.1.6", "@layui/icons-vue": "^1.0.1", "@layui/layer-vue": "^1.2.2", "async-validator": "^4.0.7", - "evtd": "^0.2.3" + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-prettier": "^4.0.0", + "evtd": "^0.2.3", + "vue": "^3.2.26" }, "devDependencies": { "@babel/core": "^7.15.8", @@ -48,10 +51,14 @@ "@types/markdown-it": "^12.2.3", "@types/markdown-it-container": "^2.0.4", "@types/node": "^16.11.9", + "@typescript-eslint/eslint-plugin": "^5.8.0", + "@typescript-eslint/parser": "^5.8.0", "@vitejs/plugin-vue": "^1.9.3", "@vue/compiler-sfc": "^3.2.26", "@vue/server-renderer": "^3.2.26", "escape-html": "^1.0.3", + "eslint": "^8.5.0", + "eslint-plugin-vue": "^8.2.0", "less": "^4.1.2", "markdown-it-container": "^3.0.0", "prettier": "^2.5.1", diff --git a/src/index.ts b/src/index.ts index 7c328900..68907494 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,72 +1,72 @@ -import type { App } from 'vue' -import type { IDefineComponent, InstallOptions } from './module/type/index' +import type { App } from "vue"; +import type { IDefineComponent, InstallOptions } from "./module/type/index"; -import './css/layui.css'; -import '@layui/layer-vue/lib/index.css'; -import '@layui/icons-vue/lib/index.css'; +import "./css/layui.css"; +import "@layui/layer-vue/lib/index.css"; +import "@layui/icons-vue/lib/index.css"; -import { layer } from '@layui/layer-vue' +import { layer } from "@layui/layer-vue"; -import LayModal from './module/layer/modal/index' -import LayBacktop from './module/backTop/index' -import LayAvatar from './module/avatar/index' -import LayRadio from './module/radio/index' -import LayButton from './module/button/index' -import LayButtonContainer from './module/buttonContainer/index' -import LayButtonGroup from './module/buttonGroup/index' -import LayIcon from './module/icon/index' -import LayIconPicker from './module/iconPicker/index' -import LayCard from './module/card/index' -import LayLayout from './module/layout/index' -import LaySide from './module/side/index' -import LayBody from './module/body/index' -import LayHeader from './module/header/index' -import LayFooter from './module/footer/index' -import LayLogo from './module/logo/index' -import LayPanel from './module/panel/index' -import LayProgress from './module/progress/index' -import LayCol from './module/col/index' -import LayRow from './module/row/index' -import LayInput from './module/input/index' -import LayBadge from './module/badge/index' -import LayBlock from './module/block/index' -import LayLine from './module/line/index' -import LayTimeline from './module/timeline/index' -import LayTimelineItem from './module/timelineItem/index' -import LayTextarea from './module/textarea/index' -import LaySwitch from './module/switch/index' -import LayCollapse from './module/collapse/index' -import LayCollapseItem from './module/collapseItem/index' -import LayContainer from './module/container/index' -import LayMenu from './module/menu/index' -import LayMenuItem from './module/menuItem/index' -import LayMenuChildItem from './module/menuChildItem/index' -import LayCheckbox from './module/checkbox/index' -import LayCheckboxGroup from './module/checkboxGroup/index' -import LayForm from './module/form/index' -import LayBreadcrumb from './module/breadcrumb/index' -import LayBreadcrumbItem from './module/breadcrumbItem/index' -import LayField from './module/field/index' -import LaySelect from './module/select/index' -import LaySelectOption from './module/selectOption/index' -import LayScroll from './module/scroll/index' -import LayEmpty from './module/empty/index' -import LayFormItem from './module/formItem/index' -import LayRate from './module/rate/index' -import LayDropdown from './module/dropdown/index' -import LayDropdownItem from './module/dropdownItem/index' -import LayTab from './module/tab/index' -import LayTabItem from './module/tabItem/index' -import LayTree from './module/tree/index' -import LayTable from './module/table/index' -import LayPage from './module/page/index' -import LayTransfer from './module/transfer/index' -import LaySlider from './module/slider/index' -import LayCarousel from './module/carousel/index' -import LayCarouselItem from './module/carouselItem/index' -import LayColorPicker from './module/colorPicker/index' -import LayTooltip from './module/tooltip/index' -import LayInputNumber from './module/inputNumber/index' +import LayModal from "./module/layer/modal/index"; +import LayBacktop from "./module/backTop/index"; +import LayAvatar from "./module/avatar/index"; +import LayRadio from "./module/radio/index"; +import LayButton from "./module/button/index"; +import LayButtonContainer from "./module/buttonContainer/index"; +import LayButtonGroup from "./module/buttonGroup/index"; +import LayIcon from "./module/icon/index"; +import LayIconPicker from "./module/iconPicker/index"; +import LayCard from "./module/card/index"; +import LayLayout from "./module/layout/index"; +import LaySide from "./module/side/index"; +import LayBody from "./module/body/index"; +import LayHeader from "./module/header/index"; +import LayFooter from "./module/footer/index"; +import LayLogo from "./module/logo/index"; +import LayPanel from "./module/panel/index"; +import LayProgress from "./module/progress/index"; +import LayCol from "./module/col/index"; +import LayRow from "./module/row/index"; +import LayInput from "./module/input/index"; +import LayBadge from "./module/badge/index"; +import LayBlock from "./module/block/index"; +import LayLine from "./module/line/index"; +import LayTimeline from "./module/timeline/index"; +import LayTimelineItem from "./module/timelineItem/index"; +import LayTextarea from "./module/textarea/index"; +import LaySwitch from "./module/switch/index"; +import LayCollapse from "./module/collapse/index"; +import LayCollapseItem from "./module/collapseItem/index"; +import LayContainer from "./module/container/index"; +import LayMenu from "./module/menu/index"; +import LayMenuItem from "./module/menuItem/index"; +import LayMenuChildItem from "./module/menuChildItem/index"; +import LayCheckbox from "./module/checkbox/index"; +import LayCheckboxGroup from "./module/checkboxGroup/index"; +import LayForm from "./module/form/index"; +import LayBreadcrumb from "./module/breadcrumb/index"; +import LayBreadcrumbItem from "./module/breadcrumbItem/index"; +import LayField from "./module/field/index"; +import LaySelect from "./module/select/index"; +import LaySelectOption from "./module/selectOption/index"; +import LayScroll from "./module/scroll/index"; +import LayEmpty from "./module/empty/index"; +import LayFormItem from "./module/formItem/index"; +import LayRate from "./module/rate/index"; +import LayDropdown from "./module/dropdown/index"; +import LayDropdownItem from "./module/dropdownItem/index"; +import LayTab from "./module/tab/index"; +import LayTabItem from "./module/tabItem/index"; +import LayTree from "./module/tree/index"; +import LayTable from "./module/table/index"; +import LayPage from "./module/page/index"; +import LayTransfer from "./module/transfer/index"; +import LaySlider from "./module/slider/index"; +import LayCarousel from "./module/carousel/index"; +import LayCarouselItem from "./module/carouselItem/index"; +import LayColorPicker from "./module/colorPicker/index"; +import LayTooltip from "./module/tooltip/index"; +import LayInputNumber from "./module/inputNumber/index"; const components: Record = { LayRadio, @@ -129,7 +129,7 @@ const components: Record = { LayModal, LayTooltip, LayInputNumber, -} +}; const install = (app: App, options?: InstallOptions): void => { const _options = options; @@ -138,7 +138,7 @@ const install = (app: App, options?: InstallOptions): void => { const item = components[key]; app.component(item.name || key, item); } -} +}; export { LayRadio, @@ -200,7 +200,7 @@ export { LayColorPicker, LayModal, install, - layer -} + layer, +}; -export default { install } \ No newline at end of file +export default { install }; diff --git a/src/module/avatar/index.ts b/src/module/avatar/index.ts index f9154769..db8117ab 100644 --- a/src/module/avatar/index.ts +++ b/src/module/avatar/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayAvatar', Component) -} + app.component(Component.name || "LayAvatar", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/backTop/index.ts b/src/module/backTop/index.ts index bf36d70e..7d1c9c99 100644 --- a/src/module/backTop/index.ts +++ b/src/module/backTop/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayBacktop', Component) -} + app.component(Component.name || "LayBacktop", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/backTop/index.vue b/src/module/backTop/index.vue index d84f0545..2a9c39bd 100644 --- a/src/module/backTop/index.vue +++ b/src/module/backTop/index.vue @@ -14,7 +14,7 @@ :size="`${props.iconSize}px`" :prefix="props.iconPrefix" :color="props.iconColor" - > + /> diff --git a/src/module/badge/index.ts b/src/module/badge/index.ts index 5e60d63e..30f6f449 100644 --- a/src/module/badge/index.ts +++ b/src/module/badge/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayBadge', Component) -} + app.component(Component.name || "LayBadge", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/badge/index.vue b/src/module/badge/index.vue index 845314b8..2e8b2825 100644 --- a/src/module/badge/index.vue +++ b/src/module/badge/index.vue @@ -33,6 +33,6 @@ const styles = computed(() => { diff --git a/src/module/block/index.ts b/src/module/block/index.ts index ffd84903..c74b4de5 100644 --- a/src/module/block/index.ts +++ b/src/module/block/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayBlock', Component) -} + app.component(Component.name || "LayBlock", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/block/index.vue b/src/module/block/index.vue index 91723f5b..b000dc68 100644 --- a/src/module/block/index.vue +++ b/src/module/block/index.vue @@ -15,6 +15,6 @@ const props = defineProps<{ diff --git a/src/module/body/index.ts b/src/module/body/index.ts index 077b236e..87272264 100644 --- a/src/module/body/index.ts +++ b/src/module/body/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayBody', Component) -} + app.component(Component.name || "LayBody", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/body/index.vue b/src/module/body/index.vue index 11e36209..3c4ef659 100644 --- a/src/module/body/index.vue +++ b/src/module/body/index.vue @@ -10,6 +10,6 @@ import "./index.less"; diff --git a/src/module/breadcrumb/index.ts b/src/module/breadcrumb/index.ts index dd6d64c5..b6cb7647 100644 --- a/src/module/breadcrumb/index.ts +++ b/src/module/breadcrumb/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayBreadcrumb', Component) -} + app.component(Component.name || "LayBreadcrumb", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/breadcrumbItem/index.ts b/src/module/breadcrumbItem/index.ts index d25c9287..4d19b831 100644 --- a/src/module/breadcrumbItem/index.ts +++ b/src/module/breadcrumbItem/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayBreadcrumbItem', Component) -} + app.component(Component.name || "LayBreadcrumbItem", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/button/index.ts b/src/module/button/index.ts index d4727aa1..ee323376 100644 --- a/src/module/button/index.ts +++ b/src/module/button/index.ts @@ -1,10 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayButton', Component) -} + app.component(Component.name || "LayButton", Component); +}; - -export default Component as IDefineComponent \ No newline at end of file +export default Component as IDefineComponent; diff --git a/src/module/button/index.vue b/src/module/button/index.vue index 53bb8f91..2e2be2b3 100644 --- a/src/module/button/index.vue +++ b/src/module/button/index.vue @@ -53,6 +53,6 @@ const classes = computed(() => { v-if="loading" class="layui-icon layui-icon-loading-one layui-anim layui-anim-rotate layui-anim-loop" > - + diff --git a/src/module/buttonContainer/index.ts b/src/module/buttonContainer/index.ts index c70e5d5c..8634f87a 100644 --- a/src/module/buttonContainer/index.ts +++ b/src/module/buttonContainer/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayButtonContainer', Component) -} + app.component(Component.name || "LayButtonContainer", Component); +}; -export default Component as IDefineComponent \ No newline at end of file +export default Component as IDefineComponent; diff --git a/src/module/buttonContainer/index.vue b/src/module/buttonContainer/index.vue index 2766f523..1ac051af 100644 --- a/src/module/buttonContainer/index.vue +++ b/src/module/buttonContainer/index.vue @@ -1,6 +1,6 @@ diff --git a/src/module/buttonGroup/index.ts b/src/module/buttonGroup/index.ts index 34342c69..1e544be5 100644 --- a/src/module/buttonGroup/index.ts +++ b/src/module/buttonGroup/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayButtonGroup', Component) -} + app.component(Component.name || "LayButtonGroup", Component); +}; -export default Component as IDefineComponent \ No newline at end of file +export default Component as IDefineComponent; diff --git a/src/module/buttonGroup/index.vue b/src/module/buttonGroup/index.vue index f54cb330..77736cd7 100644 --- a/src/module/buttonGroup/index.vue +++ b/src/module/buttonGroup/index.vue @@ -10,6 +10,6 @@ import "./index.less"; diff --git a/src/module/card/index.ts b/src/module/card/index.ts index 09ffbbe4..875c6537 100644 --- a/src/module/card/index.ts +++ b/src/module/card/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayCard ', Component) -} + app.component(Component.name || "LayCard ", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/card/index.vue b/src/module/card/index.vue index 54d29d71..64d1ff42 100644 --- a/src/module/card/index.vue +++ b/src/module/card/index.vue @@ -1,11 +1,11 @@ diff --git a/src/module/checkboxGroup/index.ts b/src/module/checkboxGroup/index.ts index 74ce1032..ead9a1d9 100644 --- a/src/module/checkboxGroup/index.ts +++ b/src/module/checkboxGroup/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayCheckboxGroup', Component) -} + app.component(Component.name || "LayCheckboxGroup", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/col/index.ts b/src/module/col/index.ts index 80f8f3e0..b8a32a8e 100644 --- a/src/module/col/index.ts +++ b/src/module/col/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayCol', Component) -} + app.component(Component.name || "LayCol", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/col/index.vue b/src/module/col/index.vue index 28d5263a..ea9acc40 100644 --- a/src/module/col/index.vue +++ b/src/module/col/index.vue @@ -34,6 +34,6 @@ const classes = computed(() => { diff --git a/src/module/collapse/index.ts b/src/module/collapse/index.ts index 2b840b2c..b7453552 100644 --- a/src/module/collapse/index.ts +++ b/src/module/collapse/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayCollapse', Component) -} + app.component(Component.name || "LayCollapse", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/collapse/index.vue b/src/module/collapse/index.vue index 9e663f70..7d7eda83 100644 --- a/src/module/collapse/index.vue +++ b/src/module/collapse/index.vue @@ -1,6 +1,6 @@ diff --git a/src/module/collapseItem/index.ts b/src/module/collapseItem/index.ts index fc7582d0..937f467c 100644 --- a/src/module/collapseItem/index.ts +++ b/src/module/collapseItem/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayCollapseItem', Component) -} + app.component(Component.name || "LayCollapseItem", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/collapseItem/index.vue b/src/module/collapseItem/index.vue index dee469e2..969e0358 100644 --- a/src/module/collapseItem/index.vue +++ b/src/module/collapseItem/index.vue @@ -9,7 +9,7 @@

- +

diff --git a/src/module/colorPicker/ColorBox.vue b/src/module/colorPicker/ColorBox.vue index 07af7a0a..c6e68d04 100644 --- a/src/module/colorPicker/ColorBox.vue +++ b/src/module/colorPicker/ColorBox.vue @@ -107,7 +107,7 @@ onMounted(() => { :visible="true" :alpha="alpha" :predefine="predefine" - > + /> diff --git a/src/module/colorPicker/colorPicker.type.ts b/src/module/colorPicker/colorPicker.type.ts index e8b8f671..a8adfef5 100644 --- a/src/module/colorPicker/colorPicker.type.ts +++ b/src/module/colorPicker/colorPicker.type.ts @@ -3,32 +3,32 @@ export interface ColorPickerProps { * 默认颜色,不管你是使用 hex、rgb 还是 rgba 的格式输入,最终会以指定的格式显示。 * v-model:color */ - color: string + color: string; /** * 颜色显示/输入格式,可选值: hex、rgb * 若在 rgb 格式下开启了透明度,格式会自动变成 rgba。在没有输入颜色的前提下,组件会默认为 #000 也就是黑色。 * default: hex(即 16 进制色值) */ - format: 'hex' | 'rgb' + format: "hex" | "rgb"; /** * 是否开启透明度,若不开启,则不会显示透明框。开启了透明度选项时,当你的默认颜色为 hex 或 rgb 格式, * 组件会默认加上值为 1 的透明度。相同的,当你没有开启透明度,却以 rgba 格式设置默认颜色时,组件会默认没有透明度。 * 注意:该参数必须配合 rgba 颜色值使用 * default: false */ - alpha: boolean + alpha: boolean; /** * 预定义颜色是否开启 * default: false */ - predefine: boolean + predefine: boolean; /** * 预定义颜色,此参数需配合 predefine: true 使用。 * 此处列举一部分:['#ff4500','#1e90ff','rgba(255, 69, 0, 0.68)','rgb(255, 120, 0)'] */ - colors: string[] + colors: string[]; /** * 下拉框大小,可以选择:lg、sm、xs。 */ - size: 'lg' | 'sm' | 'xs' + size: "lg" | "sm" | "xs"; } diff --git a/src/module/colorPicker/colorUtil.ts b/src/module/colorPicker/colorUtil.ts index be0c6122..3e4eae28 100644 --- a/src/module/colorPicker/colorUtil.ts +++ b/src/module/colorPicker/colorUtil.ts @@ -1,113 +1,113 @@ export interface RGB { - h: number - s: number - b: number + h: number; + s: number; + b: number; } // RGB转HSB export function RGBToHSB(rgb: any) { - const hsb = { h: 0, s: 0, b: 0 } - const min = Math.min(rgb.r, rgb.g, rgb.b) - const max = Math.max(rgb.r, rgb.g, rgb.b) - const delta = max - min - hsb.b = max - hsb.s = max != 0 ? (255 * delta) / max : 0 + const hsb = { h: 0, s: 0, b: 0 }; + const min = Math.min(rgb.r, rgb.g, rgb.b); + const max = Math.max(rgb.r, rgb.g, rgb.b); + const delta = max - min; + hsb.b = max; + hsb.s = max != 0 ? (255 * delta) / max : 0; if (hsb.s != 0) { if (rgb.r == max) { - hsb.h = (rgb.g - rgb.b) / delta + hsb.h = (rgb.g - rgb.b) / delta; } else if (rgb.g == max) { - hsb.h = 2 + (rgb.b - rgb.r) / delta + hsb.h = 2 + (rgb.b - rgb.r) / delta; } else { - hsb.h = 4 + (rgb.r - rgb.g) / delta + hsb.h = 4 + (rgb.r - rgb.g) / delta; } } else { - hsb.h = -1 + hsb.h = -1; } if (max == min) { - hsb.h = 0 + hsb.h = 0; } - hsb.h *= 60 + hsb.h *= 60; if (hsb.h < 0) { - hsb.h += 360 + hsb.h += 360; } - hsb.s *= 100 / 255 - hsb.b *= 100 / 255 - return hsb + hsb.s *= 100 / 255; + hsb.b *= 100 / 255; + return hsb; } // HEX转HSB export function HEXToHSB(hex: any) { - hex = hex.indexOf('#') > -1 ? hex.substring(1) : hex + hex = hex.indexOf("#") > -1 ? hex.substring(1) : hex; if (hex.length == 3) { - const num = hex.split('') - hex = num[0] + num[0] + num[1] + num[1] + num[2] + num[2] + const num = hex.split(""); + hex = num[0] + num[0] + num[1] + num[1] + num[2] + num[2]; } - hex = parseInt(hex, 16) - const rgb = { r: hex >> 16, g: (hex & 0x00ff00) >> 8, b: hex & 0x0000ff } - return RGBToHSB(rgb) + hex = parseInt(hex, 16); + const rgb = { r: hex >> 16, g: (hex & 0x00ff00) >> 8, b: hex & 0x0000ff }; + return RGBToHSB(rgb); } // HSB转RGB export function HSBToRGB(hsb: any) { - const rgb: any = {} - let h = hsb.h - const s = (hsb.s * 255) / 100 - const b = (hsb.b * 255) / 100 + const rgb: any = {}; + let h = hsb.h; + const s = (hsb.s * 255) / 100; + const b = (hsb.b * 255) / 100; if (s == 0) { - rgb.r = rgb.g = rgb.b = b + rgb.r = rgb.g = rgb.b = b; } else { - const t1 = b - const t2 = ((255 - s) * b) / 255 - const t3 = ((t1 - t2) * (h % 60)) / 60 - if (h == 360) h = 0 + const t1 = b; + const t2 = ((255 - s) * b) / 255; + const t3 = ((t1 - t2) * (h % 60)) / 60; + if (h == 360) h = 0; if (h < 60) { - rgb.r = t1 - rgb.b = t2 - rgb.g = t2 + t3 + rgb.r = t1; + rgb.b = t2; + rgb.g = t2 + t3; } else if (h < 120) { - rgb.g = t1 - rgb.b = t2 - rgb.r = t1 - t3 + rgb.g = t1; + rgb.b = t2; + rgb.r = t1 - t3; } else if (h < 180) { - rgb.g = t1 - rgb.r = t2 - rgb.b = t2 + t3 + rgb.g = t1; + rgb.r = t2; + rgb.b = t2 + t3; } else if (h < 240) { - rgb.b = t1 - rgb.r = t2 - rgb.g = t1 - t3 + rgb.b = t1; + rgb.r = t2; + rgb.g = t1 - t3; } else if (h < 300) { - rgb.b = t1 - rgb.g = t2 - rgb.r = t2 + t3 + rgb.b = t1; + rgb.g = t2; + rgb.r = t2 + t3; } else if (h < 360) { - rgb.r = t1 - rgb.g = t2 - rgb.b = t1 - t3 + rgb.r = t1; + rgb.g = t2; + rgb.b = t1 - t3; } else { - rgb.r = 0 - rgb.g = 0 - rgb.b = 0 + rgb.r = 0; + rgb.g = 0; + rgb.b = 0; } } - return { r: Math.round(rgb.r), g: Math.round(rgb.g), b: Math.round(rgb.b) } + return { r: Math.round(rgb.r), g: Math.round(rgb.g), b: Math.round(rgb.b) }; } // HSB转HEX export function HSBToHEX(hsb: any) { - const rgb = HSBToRGB(hsb) - const hex = [rgb.r.toString(16), rgb.g.toString(16), rgb.b.toString(16)] + const rgb = HSBToRGB(hsb); + const hex = [rgb.r.toString(16), rgb.g.toString(16), rgb.b.toString(16)]; hex.forEach((val, nr) => { if (val.length == 1) { - hex[nr] = '0' + val + hex[nr] = "0" + val; } - }) - return hex.join('') + }); + return hex.join(""); } //转化成所需rgb格式 export function RGBSTo(rgbs: any) { - const regexp = /[0-9]{1,3}/g - const re = rgbs.match(regexp) || [] - return { r: re[0], g: re[1], b: re[2] } + const regexp = /[0-9]{1,3}/g; + const re = rgbs.match(regexp) || []; + return { r: re[0], g: re[1], b: re[2] }; } diff --git a/src/module/colorPicker/index.ts b/src/module/colorPicker/index.ts index 2d4c93cd..b2433c77 100644 --- a/src/module/colorPicker/index.ts +++ b/src/module/colorPicker/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayColorPicker', Component) -} + app.component(Component.name || "LayColorPicker", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/colorPicker/index.vue b/src/module/colorPicker/index.vue index b8cda169..109072a9 100644 --- a/src/module/colorPicker/index.vue +++ b/src/module/colorPicker/index.vue @@ -53,6 +53,6 @@ const colorPickerProps = withDefaults(defineProps(), { diff --git a/src/module/container/index.ts b/src/module/container/index.ts index 032e75f4..b889f3d7 100644 --- a/src/module/container/index.ts +++ b/src/module/container/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayContainer', Component) -} + app.component(Component.name || "LayContainer", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/container/index.vue b/src/module/container/index.vue index d27db254..2c45d233 100644 --- a/src/module/container/index.vue +++ b/src/module/container/index.vue @@ -23,6 +23,6 @@ const classes = computed(() => diff --git a/src/module/count/index.ts b/src/module/count/index.ts index eb7aa237..9c5a1dc9 100644 --- a/src/module/count/index.ts +++ b/src/module/count/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayCount', Component) -} + app.component(Component.name || "LayCount", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/count/index.vue b/src/module/count/index.vue index 999be17a..00e7fb9a 100644 --- a/src/module/count/index.vue +++ b/src/module/count/index.vue @@ -1,5 +1,5 @@ diff --git a/src/module/dropdown/index.ts b/src/module/dropdown/index.ts index d0161417..c1db4311 100644 --- a/src/module/dropdown/index.ts +++ b/src/module/dropdown/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayDropdown', Component) -} + app.component(Component.name || "LayDropdown", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/dropdown/index.vue b/src/module/dropdown/index.vue index c7f875c1..c40c60ff 100644 --- a/src/module/dropdown/index.vue +++ b/src/module/dropdown/index.vue @@ -52,11 +52,11 @@ defineExpose({ open, hide, toggle }); :class="[openState ? 'layui-dropdown-up' : '']" >
- +
    - +
@@ -68,11 +68,11 @@ defineExpose({ open, hide, toggle }); @mouseleave="hide" >
- +
    - +
diff --git a/src/module/dropdownItem/index.ts b/src/module/dropdownItem/index.ts index b02c6c11..701fd5c0 100644 --- a/src/module/dropdownItem/index.ts +++ b/src/module/dropdownItem/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayDropdownItem', Component) -} + app.component(Component.name || "LayDropdownItem", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/dropdownItem/index.vue b/src/module/dropdownItem/index.vue index 6dbd6c64..d8941680 100644 --- a/src/module/dropdownItem/index.vue +++ b/src/module/dropdownItem/index.vue @@ -1,7 +1,7 @@ diff --git a/src/module/empty/index.ts b/src/module/empty/index.ts index 3e513058..2370fba7 100644 --- a/src/module/empty/index.ts +++ b/src/module/empty/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayEmpty', Component) -} + app.component(Component.name || "LayEmpty", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/field/index.ts b/src/module/field/index.ts index 3b9088f2..0e2db4e6 100644 --- a/src/module/field/index.ts +++ b/src/module/field/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayField', Component) -} + app.component(Component.name || "LayField", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/field/index.vue b/src/module/field/index.vue index b4f537f8..e9c7ddfb 100644 --- a/src/module/field/index.vue +++ b/src/module/field/index.vue @@ -2,7 +2,7 @@
{{ title }}
- +
diff --git a/src/module/footer/index.ts b/src/module/footer/index.ts index a4ed0ed1..6352f176 100644 --- a/src/module/footer/index.ts +++ b/src/module/footer/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayFooter', Component) -} + app.component(Component.name || "LayFooter", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/footer/index.vue b/src/module/footer/index.vue index 2f474d45..194eb9af 100644 --- a/src/module/footer/index.vue +++ b/src/module/footer/index.vue @@ -10,6 +10,6 @@ import "./index.less"; diff --git a/src/module/form/index.ts b/src/module/form/index.ts index a602f4c0..a00a6a02 100644 --- a/src/module/form/index.ts +++ b/src/module/form/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayForm', Component) -} + app.component(Component.name || "LayForm", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/form/index.vue b/src/module/form/index.vue index 484cb5f9..a072ab17 100644 --- a/src/module/form/index.vue +++ b/src/module/form/index.vue @@ -1,6 +1,6 @@ diff --git a/src/module/formItem/cnValidateMessage.ts b/src/module/formItem/cnValidateMessage.ts index 5e6dab9a..1313ce0a 100644 --- a/src/module/formItem/cnValidateMessage.ts +++ b/src/module/formItem/cnValidateMessage.ts @@ -1,49 +1,49 @@ import { ValidateMessages } from "async-validator"; // 中文翻译 --> 根据 async-validator 中 ValidateMessages 进行翻译 export default { - default: "%s验证失败", - required: "%s不能为空", - enum: "%s不在枚举%s里面", - whitespace: "%s不能为空", - date: { - format: "%s日期%s不是一个有效格式的日期%s", - parse: "%s无法解析为日期,%s是无效的", - invalid: "%s日期%s是无效的" - }, - types: { - number: '%s不是一个有效的数字', - boolean: '%s不是一个有效的布尔类型', - method: '%s不是一个有效的方法', - regexp: '%s不是一个有效的正则表达式', - integer: '%s不是一个有效的整型数字', - float: '%s不是一个有效的浮点小数', - array: '%s不是一个有效的数组', - object: '%s不是一个有效的对象', - enum: '%s不是一个有效的枚举', - date: '%s不是一个有效的日期', - url: '%s不是一个有效的url', - hex: '%s不是一个有效的十六进制', - email: '%s不是一个有效的邮箱' - }, - string: { - len: "%s必须是长度为%s个字符", - min: "%s最小长度为%s个字符", - max: "%s最长%s个字符", - range: "%s字符长度需要在%s和%s直接" - }, - number: { - len: "%s长度必须为%s", - min: "%s必须小于%s", - max: "%s必须大于%s", - range: "%s需要在%s和%s之间" - }, - array: { - len: "%s长度必须为%s", - min: "%s长度必须小于%s", - max: "%s长度必须大于%s", - range: "%s长度需要在%s和%s之间" - }, - pattern: { - "mismatch": "%s值%s不能匹配%s" - } -} as ValidateMessages; \ No newline at end of file + default: "%s验证失败", + required: "%s不能为空", + enum: "%s不在枚举%s里面", + whitespace: "%s不能为空", + date: { + format: "%s日期%s不是一个有效格式的日期%s", + parse: "%s无法解析为日期,%s是无效的", + invalid: "%s日期%s是无效的", + }, + types: { + number: "%s不是一个有效的数字", + boolean: "%s不是一个有效的布尔类型", + method: "%s不是一个有效的方法", + regexp: "%s不是一个有效的正则表达式", + integer: "%s不是一个有效的整型数字", + float: "%s不是一个有效的浮点小数", + array: "%s不是一个有效的数组", + object: "%s不是一个有效的对象", + enum: "%s不是一个有效的枚举", + date: "%s不是一个有效的日期", + url: "%s不是一个有效的url", + hex: "%s不是一个有效的十六进制", + email: "%s不是一个有效的邮箱", + }, + string: { + len: "%s必须是长度为%s个字符", + min: "%s最小长度为%s个字符", + max: "%s最长%s个字符", + range: "%s字符长度需要在%s和%s直接", + }, + number: { + len: "%s长度必须为%s", + min: "%s必须小于%s", + max: "%s必须大于%s", + range: "%s需要在%s和%s之间", + }, + array: { + len: "%s长度必须为%s", + min: "%s长度必须小于%s", + max: "%s长度必须大于%s", + range: "%s长度需要在%s和%s之间", + }, + pattern: { + mismatch: "%s值%s不能匹配%s", + }, +} as ValidateMessages; diff --git a/src/module/formItem/index.ts b/src/module/formItem/index.ts index 0fc6915b..84ee1c63 100644 --- a/src/module/formItem/index.ts +++ b/src/module/formItem/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayFormItem', Component) -} + app.component(Component.name || "LayFormItem", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/formItem/index.vue b/src/module/formItem/index.vue index 9f74fec2..d09fc882 100644 --- a/src/module/formItem/index.vue +++ b/src/module/formItem/index.vue @@ -17,7 +17,7 @@
- +
{ - app.component(Component.name || 'LayHeader', Component) -} + app.component(Component.name || "LayHeader", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/header/index.vue b/src/module/header/index.vue index 8ee50a92..79154577 100644 --- a/src/module/header/index.vue +++ b/src/module/header/index.vue @@ -10,6 +10,6 @@ import "./index.less"; diff --git a/src/module/icon/index.ts b/src/module/icon/index.ts index 6df53bbf..71405f3c 100644 --- a/src/module/icon/index.ts +++ b/src/module/icon/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import { LayIcon as Component } from '@layui/icons-vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import { LayIcon as Component } from "@layui/icons-vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayIcon', Component) -} + app.component(Component.name || "LayIcon", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/iconPicker/index.ts b/src/module/iconPicker/index.ts index efcee3c6..cd8a904c 100644 --- a/src/module/iconPicker/index.ts +++ b/src/module/iconPicker/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayIconPicker', Component) -} + app.component(Component.name || "LayIconPicker", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/iconPicker/index.vue b/src/module/iconPicker/index.vue index 32e77ec5..53f09442 100644 --- a/src/module/iconPicker/index.vue +++ b/src/module/iconPicker/index.vue @@ -4,18 +4,18 @@ class="layui-inline layui-border-box layui-iconpicker layui-iconpicker-split" >
- +
+ >
diff --git a/src/module/layer/modal/index.ts b/src/module/layer/modal/index.ts index 710d639a..d2d1dc0f 100644 --- a/src/module/layer/modal/index.ts +++ b/src/module/layer/modal/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import { LayModal } from '@layui/layer-vue'; -import type { IDefineComponent } from '../../type/index' +import type { App } from "vue"; +import { LayModal } from "@layui/layer-vue"; +import type { IDefineComponent } from "../../type/index"; LayModal.install = (app: App) => { - app.component(LayModal.name || 'LayModal', LayModal) -} + app.component(LayModal.name || "LayModal", LayModal); +}; -export default LayModal as IDefineComponent \ No newline at end of file +export default LayModal as IDefineComponent; diff --git a/src/module/layout/index.ts b/src/module/layout/index.ts index 2ad73d84..edcced67 100644 --- a/src/module/layout/index.ts +++ b/src/module/layout/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayLayout', Component) -} + app.component(Component.name || "LayLayout", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/layout/index.vue b/src/module/layout/index.vue index 17ab0603..c2f67490 100644 --- a/src/module/layout/index.vue +++ b/src/module/layout/index.vue @@ -36,6 +36,6 @@ const classes = computed(() => { diff --git a/src/module/line/index.ts b/src/module/line/index.ts index 7c3c69a2..b48a1bf1 100644 --- a/src/module/line/index.ts +++ b/src/module/line/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayLine', Component) -} + app.component(Component.name || "LayLine", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/logo/index.ts b/src/module/logo/index.ts index e10f4eec..20850bb1 100644 --- a/src/module/logo/index.ts +++ b/src/module/logo/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayLogo', Component) -} + app.component(Component.name || "LayLogo", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/logo/index.vue b/src/module/logo/index.vue index 1ef41c49..90f8b50c 100644 --- a/src/module/logo/index.vue +++ b/src/module/logo/index.vue @@ -1,6 +1,6 @@ diff --git a/src/module/menu/index.ts b/src/module/menu/index.ts index b57be799..ea05bb96 100644 --- a/src/module/menu/index.ts +++ b/src/module/menu/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayMenu', Component) -} + app.component(Component.name || "LayMenu", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/menu/index.vue b/src/module/menu/index.vue index bf918cd2..928697fc 100644 --- a/src/module/menu/index.vue +++ b/src/module/menu/index.vue @@ -1,6 +1,6 @@ diff --git a/src/module/menuChildItem/index.ts b/src/module/menuChildItem/index.ts index bd343f85..b7fcf188 100644 --- a/src/module/menuChildItem/index.ts +++ b/src/module/menuChildItem/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayMenuChildItem', Component) -} + app.component(Component.name || "LayMenuChildItem", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/menuItem/index.ts b/src/module/menuItem/index.ts index 0a69c018..7ac3314a 100644 --- a/src/module/menuItem/index.ts +++ b/src/module/menuItem/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayMenuItem', Component) -} + app.component(Component.name || "LayMenuItem", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/menuItem/index.vue b/src/module/menuItem/index.vue index 66eb2589..2bcb0e41 100644 --- a/src/module/menuItem/index.vue +++ b/src/module/menuItem/index.vue @@ -6,7 +6,7 @@ > {{ title }} - +
- +
diff --git a/src/module/page/index.ts b/src/module/page/index.ts index 748074cb..f218b6c8 100644 --- a/src/module/page/index.ts +++ b/src/module/page/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayPage', Component) -} + app.component(Component.name || "LayPage", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/page/index.vue b/src/module/page/index.vue index bd115f27..80bb23d7 100644 --- a/src/module/page/index.vue +++ b/src/module/page/index.vue @@ -15,7 +15,8 @@ >{{ index }}{{ index }} {{ index }} @@ -39,7 +40,7 @@ 到第 { - app.component(Component.name || 'LayPanel', Component) -} + app.component(Component.name || "LayPanel", Component); +}; -export default Component as IDefineComponent \ No newline at end of file +export default Component as IDefineComponent; diff --git a/src/module/panel/index.vue b/src/module/panel/index.vue index 062d9126..dc9f5836 100644 --- a/src/module/panel/index.vue +++ b/src/module/panel/index.vue @@ -10,6 +10,6 @@ import "./index.less"; diff --git a/src/module/popper/calcPosition.ts b/src/module/popper/calcPosition.ts index cea53dd3..ec10e87c 100644 --- a/src/module/popper/calcPosition.ts +++ b/src/module/popper/calcPosition.ts @@ -1,50 +1,73 @@ import { Ref } from "vue"; // 计算各个方向位置 const postionFns: any = { - top(el: HTMLElement, popper: HTMLElement, innnerPosition: Ref, called: boolean) { - let {top, left, bottom} = el.getBoundingClientRect() - if ((top = top - popper.offsetHeight - 6) < 0 && bottom > popper.offsetHeight) { - innnerPosition.value = 'bottom'; - top = bottom; - } - return { - top: `${top}px`, - left: `${left - (popper.offsetWidth - el.offsetWidth) / 2}px` - } - }, - bottom(el: HTMLElement, popper: HTMLElement, innnerPosition: Ref, called: boolean) { - let { top, left, bottom } = el.getBoundingClientRect() - if (window.innerHeight - bottom < popper.offsetHeight + 6) { - innnerPosition.value = 'top'; - bottom = top - popper.offsetHeight - 6; - } - return { - top: `${bottom}px`, - left: `${left - (popper.offsetWidth - el.offsetWidth) / 2}px` - } - }, - left(el: HTMLElement, popper: HTMLElement, innnerPosition: Ref, called : boolean) { - let {top, left, right} = el.getBoundingClientRect() - left = left - popper.offsetWidth - 6; - if (left < 0) { - innnerPosition.value = 'right'; - left = right; - } - return { - top: `${top - (popper.offsetHeight - el.offsetHeight) / 2}px`, - left: `${left}px` - } - }, - right(el: HTMLElement, popper: HTMLElement, innnerPosition: Ref, called: boolean) { - let { top, left, right } = el.getBoundingClientRect() - if (window.innerWidth < right + popper.offsetWidth + 6) { - innnerPosition.value = 'left'; - right = left - popper.offsetWidth - 6; - } - return { - top: `${top - (popper.offsetHeight - el.offsetHeight) / 2}px`, - left: `${right}px` - } + top( + el: HTMLElement, + popper: HTMLElement, + innnerPosition: Ref, + called: boolean + ) { + let { top, left, bottom } = el.getBoundingClientRect(); + if ( + (top = top - popper.offsetHeight - 6) < 0 && + bottom > popper.offsetHeight + ) { + innnerPosition.value = "bottom"; + top = bottom; } -} -export default postionFns; \ No newline at end of file + return { + top: `${top}px`, + left: `${left - (popper.offsetWidth - el.offsetWidth) / 2}px`, + }; + }, + bottom( + el: HTMLElement, + popper: HTMLElement, + innnerPosition: Ref, + called: boolean + ) { + let { top, left, bottom } = el.getBoundingClientRect(); + if (window.innerHeight - bottom < popper.offsetHeight + 6) { + innnerPosition.value = "top"; + bottom = top - popper.offsetHeight - 6; + } + return { + top: `${bottom}px`, + left: `${left - (popper.offsetWidth - el.offsetWidth) / 2}px`, + }; + }, + left( + el: HTMLElement, + popper: HTMLElement, + innnerPosition: Ref, + called: boolean + ) { + let { top, left, right } = el.getBoundingClientRect(); + left = left - popper.offsetWidth - 6; + if (left < 0) { + innnerPosition.value = "right"; + left = right; + } + return { + top: `${top - (popper.offsetHeight - el.offsetHeight) / 2}px`, + left: `${left}px`, + }; + }, + right( + el: HTMLElement, + popper: HTMLElement, + innnerPosition: Ref, + called: boolean + ) { + let { top, left, right } = el.getBoundingClientRect(); + if (window.innerWidth < right + popper.offsetWidth + 6) { + innnerPosition.value = "left"; + right = left - popper.offsetWidth - 6; + } + return { + top: `${top - (popper.offsetHeight - el.offsetHeight) / 2}px`, + left: `${right}px`, + }; + }, +}; +export default postionFns; diff --git a/src/module/popper/usePopper.ts b/src/module/popper/usePopper.ts index c60c44b2..7995f116 100644 --- a/src/module/popper/usePopper.ts +++ b/src/module/popper/usePopper.ts @@ -1,43 +1,47 @@ -import { h, ref, render, watchEffect, watch} from "vue"; +import { h, ref, render, watchEffect, watch } from "vue"; import popper from "./index.vue"; import { once } from "../../tools/domUtil"; -const EVENT_MAP : any = { - 'hover': 'mouseenter', - 'click': 'click' -} +const EVENT_MAP: any = { + hover: "mouseenter", + click: "click", +}; const usePopper = { - createPopper(el: HTMLElement, props: any, trigger : string) { - const _this = this; - once(el, EVENT_MAP[trigger], () => { - // TODO 临时解决方案 - const _props:any = {el}; - for (const key in props) { - _props[key] = ref(props[key]); - } - _props.updateVisible = function(val:boolean) { - _props.visible && (_props.visible.value = val); - } - _this.renderPopper(_props); - watchEffect(() => { - for (const key in _props) { - if (key === 'visible') { - continue; - } - _props[key].value = props[key]; - } - }); - watch(() => props.visible, (val: boolean)=> { - _props.updateVisible(val); - }) - }) - }, - renderPopper(props: any) { - const container: HTMLDivElement = document.createElement("div"); - // container.setAttribute("class", "lay-div"); - const node = h(popper, props); - render(node, container); - container.firstElementChild && document.body.appendChild(container.firstElementChild); - return node; - } -} -export default usePopper; \ No newline at end of file + createPopper(el: HTMLElement, props: any, trigger: string) { + const _this = this; + once(el, EVENT_MAP[trigger], () => { + // TODO 临时解决方案 + const _props: any = { el }; + for (const key in props) { + _props[key] = ref(props[key]); + } + _props.updateVisible = function (val: boolean) { + _props.visible && (_props.visible.value = val); + }; + _this.renderPopper(_props); + watchEffect(() => { + for (const key in _props) { + if (key === "visible") { + continue; + } + _props[key].value = props[key]; + } + }); + watch( + () => props.visible, + (val: boolean) => { + _props.updateVisible(val); + } + ); + }); + }, + renderPopper(props: any) { + const container: HTMLDivElement = document.createElement("div"); + // container.setAttribute("class", "lay-div"); + const node = h(popper, props); + render(node, container); + container.firstElementChild && + document.body.appendChild(container.firstElementChild); + return node; + }, +}; +export default usePopper; diff --git a/src/module/progress/index.ts b/src/module/progress/index.ts index 5fe87660..4322691a 100644 --- a/src/module/progress/index.ts +++ b/src/module/progress/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayProgress', Component) -} + app.component(Component.name || "LayProgress", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/radio/index.ts b/src/module/radio/index.ts index 45a6c966..4aa9f279 100644 --- a/src/module/radio/index.ts +++ b/src/module/radio/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayRadio ', Component) -} + app.component(Component.name || "LayRadio ", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/radio/index.vue b/src/module/radio/index.vue index 24c428fb..6c33fab9 100644 --- a/src/module/radio/index.vue +++ b/src/module/radio/index.vue @@ -19,7 +19,7 @@ class="layui-anim layui-icon layui-anim-scaleSpring layui-form-radioed" > - + diff --git a/src/module/rate/index.ts b/src/module/rate/index.ts index 6d0691c8..cb9fe32b 100644 --- a/src/module/rate/index.ts +++ b/src/module/rate/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayRate', Component) -} + app.component(Component.name || "LayRate", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/rate/index.vue b/src/module/rate/index.vue index 6767dcd3..0f00cc43 100644 --- a/src/module/rate/index.vue +++ b/src/module/rate/index.vue @@ -101,12 +101,12 @@ const action = function (index: number, event: any) { }`, ]" :style="{ color: theme }" - /> + >
+ > diff --git a/src/module/selectOption/index.ts b/src/module/selectOption/index.ts index 1cc5e6ae..39686fb3 100644 --- a/src/module/selectOption/index.ts +++ b/src/module/selectOption/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LaySelectOption', Component) -} + app.component(Component.name || "LaySelectOption", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/selectOption/index.vue b/src/module/selectOption/index.vue index 445594b4..65d05998 100644 --- a/src/module/selectOption/index.vue +++ b/src/module/selectOption/index.vue @@ -10,7 +10,7 @@ v-model="selected" @change="selectHandle" label="" - > + /> {{ label }} diff --git a/src/module/side/index.ts b/src/module/side/index.ts index cd96dc3e..56474525 100644 --- a/src/module/side/index.ts +++ b/src/module/side/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LaySide', Component) -} + app.component(Component.name || "LaySide", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/side/index.vue b/src/module/side/index.vue index f0b1688a..1ce5b1e2 100644 --- a/src/module/side/index.vue +++ b/src/module/side/index.vue @@ -25,6 +25,6 @@ const styles = computed(() => { diff --git a/src/module/slider/index.ts b/src/module/slider/index.ts index b2db3b4b..4c31ae47 100644 --- a/src/module/slider/index.ts +++ b/src/module/slider/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LaySlider', Component) -} + app.component(Component.name || "LaySlider", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/switch/index.ts b/src/module/switch/index.ts index 3261036c..46371b50 100644 --- a/src/module/switch/index.ts +++ b/src/module/switch/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LaySwitch', Component) -} + app.component(Component.name || "LaySwitch", Component); +}; -export default Component as IDefineComponent \ No newline at end of file +export default Component as IDefineComponent; diff --git a/src/module/switch/index.vue b/src/module/switch/index.vue index 7474bafc..838c4342 100644 --- a/src/module/switch/index.vue +++ b/src/module/switch/index.vue @@ -51,7 +51,7 @@ const handleClick = function () { }" > {{ isActive == true ? activeText : inactiveText }} - + diff --git a/src/module/tab/index.ts b/src/module/tab/index.ts index 58408184..60508e89 100644 --- a/src/module/tab/index.ts +++ b/src/module/tab/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayTab', Component) -} + app.component(Component.name || "LayTab", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/tab/index.vue b/src/module/tab/index.vue index ae33f7f0..033997d6 100644 --- a/src/module/tab/index.vue +++ b/src/module/tab/index.vue @@ -20,7 +20,7 @@
- +
diff --git a/src/module/tabItem/index.ts b/src/module/tabItem/index.ts index a0dc1f84..a6d38917 100644 --- a/src/module/tabItem/index.ts +++ b/src/module/tabItem/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayTabItem', Component) -} + app.component(Component.name || "LayTabItem", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/tabItem/index.vue b/src/module/tabItem/index.vue index bd05ad4c..1748e813 100644 --- a/src/module/tabItem/index.vue +++ b/src/module/tabItem/index.vue @@ -1,6 +1,6 @@ diff --git a/src/module/table/index.ts b/src/module/table/index.ts index 12d8b9d5..43fb4915 100644 --- a/src/module/table/index.ts +++ b/src/module/table/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayTable', Component) -} + app.component(Component.name || "LayTable", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/table/index.vue b/src/module/table/index.vue index 3155bdba..b751c8ac 100644 --- a/src/module/table/index.vue +++ b/src/module/table/index.vue @@ -108,7 +108,7 @@ const print = function () { diff --git a/src/module/timeline/index.ts b/src/module/timeline/index.ts index 47ccc1b3..c87e72c1 100644 --- a/src/module/timeline/index.ts +++ b/src/module/timeline/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayTimeline', Component) -} + app.component(Component.name || "LayTimeline", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/timeline/index.vue b/src/module/timeline/index.vue index fda3a9f6..0278c135 100644 --- a/src/module/timeline/index.vue +++ b/src/module/timeline/index.vue @@ -10,6 +10,6 @@ import "./index.less"; diff --git a/src/module/timelineItem/index.ts b/src/module/timelineItem/index.ts index 1092a8f9..13264076 100644 --- a/src/module/timelineItem/index.ts +++ b/src/module/timelineItem/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayTimelineItem', Component) -} + app.component(Component.name || "LayTimelineItem", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/timelineItem/index.vue b/src/module/timelineItem/index.vue index fd462db4..7ecc8f37 100644 --- a/src/module/timelineItem/index.vue +++ b/src/module/timelineItem/index.vue @@ -8,7 +8,7 @@

{{ title }}

- + diff --git a/src/module/tooltip/index.ts b/src/module/tooltip/index.ts index 82ddc5d6..c6f4fa0e 100644 --- a/src/module/tooltip/index.ts +++ b/src/module/tooltip/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayTooltip', Component) -} + app.component(Component.name || "LayTooltip", Component); +}; -export default Component as IDefineComponent \ No newline at end of file +export default Component as IDefineComponent; diff --git a/src/module/tooltip/index.vue b/src/module/tooltip/index.vue index 6884cfa1..9c82f39e 100644 --- a/src/module/tooltip/index.vue +++ b/src/module/tooltip/index.vue @@ -29,14 +29,14 @@ export default defineComponent({ default: true, }, }, - render() { - return this.$slots.default && this.$slots.default()[0]; - }, mounted() { const _this = this; this.$nextTick(() => { usePopper.createPopper(_this.$el, _this.$props, "hover"); }); }, + render() { + return this.$slots.default && this.$slots.default()[0]; + }, }); diff --git a/src/module/transfer/index.ts b/src/module/transfer/index.ts index 275ba7af..154cbb32 100644 --- a/src/module/transfer/index.ts +++ b/src/module/transfer/index.ts @@ -1,9 +1,9 @@ -import type { App } from 'vue' -import Component from './index.vue' -import type { IDefineComponent } from '../type/index' +import type { App } from "vue"; +import Component from "./index.vue"; +import type { IDefineComponent } from "../type/index"; Component.install = (app: App) => { - app.component(Component.name || 'LayTransfer', Component) -} + app.component(Component.name || "LayTransfer", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/transfer/index.vue b/src/module/transfer/index.vue index 1112c91b..2afc5055 100644 --- a/src/module/transfer/index.vue +++ b/src/module/transfer/index.vue @@ -136,7 +136,7 @@ const remove = function () { skin="primary" :label="dataSource[id]" > - + {{ dataSource.title }} @@ -147,14 +147,14 @@ const remove = function () { type="primary" :disabled="leftSelectedKeys.length == 0" @click="add" - > + > + >
@@ -174,7 +174,7 @@ const remove = function () { skin="primary" :label="dataSource[id]" > - + {{ dataSource.title }} diff --git a/src/module/tree/TreeNode.vue b/src/module/tree/TreeNode.vue index ca548da4..b0b8850a 100644 --- a/src/module/tree/TreeNode.vue +++ b/src/module/tree/TreeNode.vue @@ -124,8 +124,7 @@ function handleTitleClick(node: TreeData) { handleChange(checked, node); } " - > - + /> { - app.component(Component.name || 'LayTree', Component) -} + app.component(Component.name || "LayTree", Component); +}; -export default Component as IDefineComponent +export default Component as IDefineComponent; diff --git a/src/module/tree/index.vue b/src/module/tree/index.vue index 70188c51..d9a04494 100644 --- a/src/module/tree/index.vue +++ b/src/module/tree/index.vue @@ -94,6 +94,6 @@ function handleClick(node: TreeData) { :show-line="showLine" :only-icon-control="onlyIconControl" @node-click="handleClick" - > + />
diff --git a/src/module/tree/tree.ts b/src/module/tree/tree.ts index 9a97061e..a0c4aa46 100644 --- a/src/module/tree/tree.ts +++ b/src/module/tree/tree.ts @@ -1,82 +1,82 @@ -import { OriginalTreeData, StringOrNumber } from './tree.type' -import { Nullable } from '../type' -import { Ref, ref } from 'vue' +import { OriginalTreeData, StringOrNumber } from "./tree.type"; +import { Nullable } from "../type"; +import { Ref, ref } from "vue"; -type CustomKey = string | number -type CustomString = (() => string) | string +type CustomKey = string | number; +type CustomString = (() => string) | string; export interface TreeData { - id: CustomKey - title: CustomString - children: TreeData[] - parentKey: Nullable - isRoot: boolean - isChecked: Ref - isDisabled: Ref - isLeaf: Ref - hasNextSibling: boolean - parentNode: Nullable + id: CustomKey; + title: CustomString; + children: TreeData[]; + parentKey: Nullable; + isRoot: boolean; + isChecked: Ref; + isDisabled: Ref; + isLeaf: Ref; + hasNextSibling: boolean; + parentNode: Nullable; } interface ReplaceFields { - id: string - title: string - children: string + id: string; + title: string; + children: string; } interface TreeConfig { - showCheckbox: boolean - checkedKeys: StringOrNumber[] - expandKeys: StringOrNumber[] - nodeMap: Map - originMap: Map - replaceFields: ReplaceFields + showCheckbox: boolean; + checkedKeys: StringOrNumber[]; + expandKeys: StringOrNumber[]; + nodeMap: Map; + originMap: Map; + replaceFields: ReplaceFields; } class Tree { - protected config: TreeConfig - protected treeData: TreeData[] + protected config: TreeConfig; + protected treeData: TreeData[]; constructor( config: TreeConfig, origin: OriginalTreeData | OriginalTreeData[] ) { - this.config = config - this.treeData = [] - this.init(origin) + this.config = config; + this.treeData = []; + this.init(origin); } init(origin: OriginalTreeData | OriginalTreeData[]): void { - const tree = this.createTree(origin) - this.treeData = tree + const tree = this.createTree(origin); + this.treeData = tree; } createTree( origin: OriginalTreeData | OriginalTreeData[], - parentKey: StringOrNumber = '' + parentKey: StringOrNumber = "" ): TreeData[] { - let data + let data; if (!Array.isArray(origin)) { - data = Array.of(Object.assign({}, origin)) + data = Array.of(Object.assign({}, origin)); } else { - data = origin + data = origin; } - const nodeList: TreeData[] = [] - const { children } = this.config.replaceFields + const nodeList: TreeData[] = []; + const { children } = this.config.replaceFields; - const len = data.length + const len = data.length; for (let i = 0; i < len; i++) { - const node = this.getNode(data[i], parentKey, i < len - 1) - const nodeChildren = Reflect.get(node, children) - const nodeHasChildren = !!Reflect.get(node, children) + const node = this.getNode(data[i], parentKey, i < len - 1); + const nodeChildren = Reflect.get(node, children); + const nodeHasChildren = !!Reflect.get(node, children); if (nodeHasChildren) { - Reflect.set(node, children, this.createTree(nodeChildren, node.id)) + Reflect.set(node, children, this.createTree(nodeChildren, node.id)); } - nodeList.push(node) + nodeList.push(node); } - return nodeList + return nodeList; } getNode( @@ -90,113 +90,113 @@ class Tree { checkedKeys, expandKeys, replaceFields: { children, id, title }, - } = this.config + } = this.config; - const nodeKey = Reflect.get(origin, id) - const nodeTitle = Reflect.get(origin, title) - const nodeChildren = Reflect.get(origin, children) - const nodeDisabled = !!Reflect.get(origin, 'disabled') - const nodeIsLeaf = !!Reflect.get(origin, 'spread') + const nodeKey = Reflect.get(origin, id); + const nodeTitle = Reflect.get(origin, title); + const nodeChildren = Reflect.get(origin, children); + const nodeDisabled = !!Reflect.get(origin, "disabled"); + const nodeIsLeaf = !!Reflect.get(origin, "spread"); - const parentNode = nodeMap.get(parentKey) + const parentNode = nodeMap.get(parentKey); const node = Object.assign({}, origin, { id: nodeKey, title: nodeTitle, children: nodeChildren ? nodeChildren : [], parentKey: parentKey, - isRoot: parentKey === '', + isRoot: parentKey === "", isDisabled: ref(false), isChecked: ref(false), isLeaf: ref(false), hasNextSibling: hasNextSibling, parentNode: parentNode || null, - }) + }); - node.isDisabled.value = nodeDisabled + node.isDisabled.value = nodeDisabled; node.isChecked.value = parentNode ? parentNode.isChecked.value - : checkedKeys.includes(nodeKey) + : checkedKeys.includes(nodeKey); node.isLeaf.value = parentNode ? parentNode.isLeaf.value - : expandKeys.includes(nodeKey) - node.isLeaf.value = nodeIsLeaf + : expandKeys.includes(nodeKey); + node.isLeaf.value = nodeIsLeaf; if (!nodeMap.has(nodeKey)) { - nodeMap.set(nodeKey, node) + nodeMap.set(nodeKey, node); } if (!originMap.has(nodeKey)) { - originMap.set(nodeKey, origin) + originMap.set(nodeKey, origin); } - return node + return node; } setChildrenChecked(checked: boolean, nodes: TreeData[]) { - const len = nodes.length + const len = nodes.length; for (let i = 0; i < len; i++) { console.log(nodes[i], checked); - nodes[i].isChecked.value = checked + nodes[i].isChecked.value = checked; nodes[i].children && nodes[i].children.length > 0 && - this.setChildrenChecked(checked, nodes[i].children) + this.setChildrenChecked(checked, nodes[i].children); } } setParentChecked(checked: boolean, parent: TreeData) { if (!parent) { - return + return; } - parent.isChecked.value = checked - const pChild = parent.children - const pChildChecked = pChild.some((c) => c.isChecked.value) + parent.isChecked.value = checked; + const pChild = parent.children; + const pChildChecked = pChild.some((c) => c.isChecked.value); if (pChildChecked) { - parent.isChecked.value = true + parent.isChecked.value = true; } if (parent.parentNode) { - this.setParentChecked(checked, parent.parentNode) + this.setParentChecked(checked, parent.parentNode); } } setCheckedKeys(checked: boolean, node: TreeData) { - node.isChecked.value = checked + node.isChecked.value = checked; // 处理上级 if (node.parentNode) { - this.setParentChecked(checked, node.parentNode) + this.setParentChecked(checked, node.parentNode); } // 处理下级 if (node.children) { - this.setChildrenChecked(checked, node.children) + this.setChildrenChecked(checked, node.children); } console.log(this.getData()); } getData() { - return this.treeData + return this.treeData; } getKeys() { - const checkedKeys = [] - const expandKeys = [] - const iterator = this.config.nodeMap[Symbol.iterator]() - let next = iterator.next() + const checkedKeys = []; + const expandKeys = []; + const iterator = this.config.nodeMap[Symbol.iterator](); + let next = iterator.next(); while (!next.done) { - const [, node] = next.value - const id = Reflect.get(node, this.config.replaceFields.id) + const [, node] = next.value; + const id = Reflect.get(node, this.config.replaceFields.id); if (node.isChecked.value) { - checkedKeys.push(id) + checkedKeys.push(id); } if (node.isLeaf.value) { - expandKeys.push(id) + expandKeys.push(id); } - next = iterator.next() + next = iterator.next(); } - return { checkedKeys, expandKeys } + return { checkedKeys, expandKeys }; } getOriginData(key: StringOrNumber): OriginalTreeData { - return this.config.originMap.get(key)! + return this.config.originMap.get(key)!; } } -export { Tree } +export { Tree }; diff --git a/src/module/tree/tree.type.ts b/src/module/tree/tree.type.ts index d74f376c..6dc161fb 100644 --- a/src/module/tree/tree.type.ts +++ b/src/module/tree/tree.type.ts @@ -1,34 +1,34 @@ -export type StringFn = () => string -export type StringOrNumber = string | number -export type KeysType = (number | string)[] -export type EditType = boolean | ('add' | 'update' | 'delete') +export type StringFn = () => string; +export type StringOrNumber = string | number; +export type KeysType = (number | string)[]; +export type EditType = boolean | ("add" | "update" | "delete"); export interface OriginalTreeData { - title: StringFn | string - id: StringOrNumber - field: StringFn | string - children?: OriginalTreeData[] - disabled?: boolean + title: StringFn | string; + id: StringOrNumber; + field: StringFn | string; + children?: OriginalTreeData[]; + disabled?: boolean; } export interface TreeProps { - checkedKeys?: KeysType - expandKeys?: KeysType - data: OriginalTreeData - showCheckbox?: boolean - edit?: EditType - accordion?: boolean - onlyIconControl?: boolean - showLine?: boolean + checkedKeys?: KeysType; + expandKeys?: KeysType; + data: OriginalTreeData; + showCheckbox?: boolean; + edit?: EditType; + accordion?: boolean; + onlyIconControl?: boolean; + showLine?: boolean; replaceFields?: { - id?: string - children?: string - title?: string - } + id?: string; + children?: string; + title?: string; + }; } export interface TreeEmits { - (e: 'update:checkedKeys', keys: KeysType): void - (e: 'update:expandKeys', keys: KeysType): void - (e: 'node-click', node: OriginalTreeData, event: Event): void + (e: "update:checkedKeys", keys: KeysType): void; + (e: "update:expandKeys", keys: KeysType): void; + (e: "node-click", node: OriginalTreeData, event: Event): void; } diff --git a/src/module/tree/useTree.ts b/src/module/tree/useTree.ts index 631c6922..af0f2c4b 100644 --- a/src/module/tree/useTree.ts +++ b/src/module/tree/useTree.ts @@ -1,14 +1,14 @@ -import { TreeEmits, TreeProps } from './tree.type' -import { computed, ComputedRef, watch } from 'vue' -import { Tree, TreeData } from './tree' +import { TreeEmits, TreeProps } from "./tree.type"; +import { computed, ComputedRef, watch } from "vue"; +import { Tree, TreeData } from "./tree"; export declare type UseTree = ( props: TreeProps, emit: TreeEmits ) => { - tree: Tree - nodeList: ComputedRef -} + tree: Tree; + nodeList: ComputedRef; +}; export const useTree: UseTree = (props: TreeProps, emit: TreeEmits) => { const tree = new Tree( @@ -16,35 +16,35 @@ export const useTree: UseTree = (props: TreeProps, emit: TreeEmits) => { nodeMap: new Map(), originMap: new Map(), replaceFields: { - id: 'id', - title: 'title', - children: 'children', + id: "id", + title: "title", + children: "children", }, showCheckbox: props.showCheckbox ?? false, checkedKeys: props.checkedKeys ?? [], expandKeys: props.expandKeys ?? [], }, props.data - ) + ); const nodeList = computed(() => { - const nodes = tree.getData() + const nodes = tree.getData(); console.log(nodes); - return nodes - }) + return nodes; + }); watch( () => nodeList, (list) => { - const { checkedKeys, expandKeys } = tree.getKeys() - emit('update:checkedKeys', checkedKeys) + const { checkedKeys, expandKeys } = tree.getKeys(); + emit("update:checkedKeys", checkedKeys); // emit('update:expandKeys', expandKeys) }, { deep: true } - ) + ); return { tree, nodeList, - } -} + }; +}; diff --git a/src/module/type/form.ts b/src/module/type/form.ts index 0a14155a..1310dbbe 100644 --- a/src/module/type/form.ts +++ b/src/module/type/form.ts @@ -1,37 +1,37 @@ -import type { ValidateCallback, ValidateError, ValidateMessages } from 'async-validator' +import type { + ValidateCallback, + ValidateError, + ValidateMessages, +} from "async-validator"; -export const layFormKey = 'LayForm' +export const layFormKey = "LayForm"; export interface LayFormContext { - model: modelType - required?: boolean - requiredErrorMessage?: string - validateMessage: ValidateMessages - rules?: Record - useCN : boolean - requiredIcons?: string - addField: (field: LayFormItemContext) => void + model: modelType; + required?: boolean; + requiredErrorMessage?: string; + validateMessage: ValidateMessages; + rules?: Record; + useCN: boolean; + requiredIcons?: string; + addField: (field: LayFormItemContext) => void; } export interface LayFormItemContext { - prop?: string - $el: HTMLDivElement - required?: boolean - rules?: Record - validate(callback?: ValidateCallback): void - clearValidate(): void + prop?: string; + $el: HTMLDivElement; + required?: boolean; + rules?: Record; + validate(callback?: ValidateCallback): void; + clearValidate(): void; } -export declare type modelType = { [key: string]: any } +export declare type modelType = { [key: string]: any }; export declare interface FormCallback { - ( - isValid?: boolean, - model?: modelType, - errors?: ValidateError[] | null - ): void + (isValid?: boolean, model?: modelType, errors?: ValidateError[] | null): void; } export declare interface FieldValidateError extends ValidateError { - label ?: string -} \ No newline at end of file + label?: string; +} diff --git a/src/module/type/index.ts b/src/module/type/index.ts index 3c1ad287..a92c70de 100644 --- a/src/module/type/index.ts +++ b/src/module/type/index.ts @@ -1,3 +1,3 @@ -export * from './public' -export * from './select' -export * from './form' +export * from "./public"; +export * from "./select"; +export * from "./form"; diff --git a/src/module/type/public.ts b/src/module/type/public.ts index e3a622c4..ee4c1f90 100644 --- a/src/module/type/public.ts +++ b/src/module/type/public.ts @@ -1,22 +1,22 @@ -import type { App, DefineComponent, Ref } from 'vue' +import type { App, DefineComponent, Ref } from "vue"; -export type StringObject = Record +export type StringObject = Record; -export type UnknownObject = Record +export type UnknownObject = Record; -export type UnknownFunction = (...arg: unknown[]) => unknown +export type UnknownFunction = (...arg: unknown[]) => unknown; export type IDefineComponent = DefineComponent & { - install: (app: App, options?: InstallOptions) => void -} + install: (app: App, options?: InstallOptions) => void; +}; export interface InstallOptions extends StringObject { - pagination?: null - menu?: null + pagination?: null; + menu?: null; } -export type Nullable = T | null +export type Nullable = T | null; -export type MaybeRef = Ref | T +export type MaybeRef = Ref | T; -export type Recordable = Record +export type Recordable = Record; diff --git a/src/module/type/select.ts b/src/module/type/select.ts index 34df21d9..2d732bb2 100644 --- a/src/module/type/select.ts +++ b/src/module/type/select.ts @@ -1,11 +1,11 @@ export type SelectValueType = string | string[] | number | number[] | null; export interface SelectItem { - value?: SelectValueType - label?: null | string | string[] - disabled ?: boolean - multiple ?: boolean + value?: SelectValueType; + label?: null | string | string[]; + disabled?: boolean; + multiple?: boolean; } export interface SelectItemHandle { - (selectItem: SelectItem, isChecked ?: boolean) : void -} \ No newline at end of file + (selectItem: SelectItem, isChecked?: boolean): void; +} diff --git a/src/tools/guidUtil.ts b/src/tools/guidUtil.ts index 80f391e5..e66cfbaa 100644 --- a/src/tools/guidUtil.ts +++ b/src/tools/guidUtil.ts @@ -1,18 +1,30 @@ - /** * 随机数 *

* @param null 无参 - * */ + * */ export function S4() { - return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1) + return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); } /** * 随机数 *

* @param null 无参 - * */ + * */ export function guid() { - return (S4() + S4() + '-' + S4() + '-' + S4() + '-' + S4() + '-' + S4() + S4() + S4()) -} \ No newline at end of file + return ( + S4() + + S4() + + "-" + + S4() + + "-" + + S4() + + "-" + + S4() + + "-" + + S4() + + S4() + + S4() + ); +}