This commit is contained in:
539943419 committed 2024-08-29 18:50:38 +08:00
commit d0bad77387
11 files changed
+726 -30

No files matched your search

+1
View File
@@ -24,3 +24,4 @@ dist-ssr
*.sw? *.sw?
.vscode .vscode
serve serve
miao-directory.exe
+15
View File
@@ -7,16 +7,31 @@
"dev": "vite", "dev": "vite",
"dev:host": "vite --host 0.0.0.0", "dev:host": "vite --host 0.0.0.0",
"build": "vue-tsc -b && vite build", "build": "vue-tsc -b && vite build",
"build:auto": "pnpm run build && rm -rf ./serve/web/* && cp -r ./dist/* ./serve/web/ && cd ./serve && go build && mv ./miao-directory.exe ../",
"preview": "vite preview" "preview": "vite preview"
}, },
"dependencies": { "dependencies": {
"@codemirror/lang-go": "^6.0.1",
"@codemirror/lang-html": "^6.4.9",
"@codemirror/lang-javascript": "^6.2.2",
"@codemirror/lang-json": "^6.0.1",
"@codemirror/lang-markdown": "^6.2.5",
"@codemirror/lang-python": "^6.1.6",
"@codemirror/lang-sass": "^6.0.2",
"@codemirror/lang-sql": "^6.7.1",
"@codemirror/lang-vue": "^0.1.3",
"@codemirror/lang-xml": "^6.1.0",
"@codemirror/lang-yaml": "^6.1.1",
"@uiw/codemirror-theme-vscode": "^4.23.0",
"@vicons/ionicons5": "^0.12.0", "@vicons/ionicons5": "^0.12.0",
"axios": "^1.7.3", "axios": "^1.7.3",
"codemirror": "^6.0.1",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"naive-ui": "^2.39.0", "naive-ui": "^2.39.0",
"pdfjs-dist": "^4.5.136", "pdfjs-dist": "^4.5.136",
"sass": "^1.77.8", "sass": "^1.77.8",
"vue": "^3.4.35", "vue": "^3.4.35",
"vue-codemirror": "^6.1.1",
"xgplayer": "^3.0.20", "xgplayer": "^3.0.20",
"xgplayer-subtitles": "^3.0.20" "xgplayer-subtitles": "^3.0.20"
}, },
+441
View File
@@ -8,12 +8,51 @@ importers:
.: .:
dependencies: dependencies:
'@codemirror/lang-go':
specifier: ^6.0.1
version: 6.0.1(@codemirror/view@6.33.0)
'@codemirror/lang-html':
specifier: ^6.4.9
version: 6.4.9
'@codemirror/lang-javascript':
specifier: ^6.2.2
version: 6.2.2
'@codemirror/lang-json':
specifier: ^6.0.1
version: 6.0.1
'@codemirror/lang-markdown':
specifier: ^6.2.5
version: 6.2.5
'@codemirror/lang-python':
specifier: ^6.1.6
version: 6.1.6(@codemirror/view@6.33.0)
'@codemirror/lang-sass':
specifier: ^6.0.2
version: 6.0.2(@codemirror/view@6.33.0)
'@codemirror/lang-sql':
specifier: ^6.7.1
version: 6.7.1(@codemirror/view@6.33.0)
'@codemirror/lang-vue':
specifier: ^0.1.3
version: 0.1.3
'@codemirror/lang-xml':
specifier: ^6.1.0
version: 6.1.0
'@codemirror/lang-yaml':
specifier: ^6.1.1
version: 6.1.1(@codemirror/view@6.33.0)
'@uiw/codemirror-theme-vscode':
specifier: ^4.23.0
version: 4.23.0(@codemirror/language@6.10.2)(@codemirror/state@6.4.1)(@codemirror/view@6.33.0)
'@vicons/ionicons5': '@vicons/ionicons5':
specifier: ^0.12.0 specifier: ^0.12.0
version: 0.12.0 version: 0.12.0
axios: axios:
specifier: ^1.7.3 specifier: ^1.7.3
version: 1.7.3 version: 1.7.3
codemirror:
specifier: ^6.0.1
version: 6.0.1(@lezer/common@1.2.1)
lodash: lodash:
specifier: ^4.17.21 specifier: ^4.17.21
version: 4.17.21 version: 4.17.21
@@ -29,6 +68,9 @@ importers:
vue: vue:
specifier: ^3.4.35 specifier: ^3.4.35
version: 3.4.37(typescript@5.5.4) version: 3.4.37(typescript@5.5.4)
vue-codemirror:
specifier: ^6.1.1
version: 6.1.1(codemirror@6.0.1(@lezer/common@1.2.1))(vue@3.4.37(typescript@5.5.4))
xgplayer: xgplayer:
specifier: ^3.0.20 specifier: ^3.0.20
version: 3.0.20(core-js@3.38.1) version: 3.0.20(core-js@3.38.1)
@@ -84,6 +126,68 @@ packages:
resolution: {integrity: sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==} resolution: {integrity: sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==}
engines: {node: '>=6.9.0'} engines: {node: '>=6.9.0'}
'@codemirror/autocomplete@6.18.0':
resolution: {integrity: sha512-5DbOvBbY4qW5l57cjDsmmpDh3/TeK1vXfTHa+BUMrRzdWdcxKZ4U4V7vQaTtOpApNU4kLS4FQ6cINtLg245LXA==}
peerDependencies:
'@codemirror/language': ^6.0.0
'@codemirror/state': ^6.0.0
'@codemirror/view': ^6.0.0
'@lezer/common': ^1.0.0
'@codemirror/commands@6.6.0':
resolution: {integrity: sha512-qnY+b7j1UNcTS31Eenuc/5YJB6gQOzkUoNmJQc0rznwqSRpeaWWpjkWy2C/MPTcePpsKJEM26hXrOXl1+nceXg==}
'@codemirror/lang-css@6.2.1':
resolution: {integrity: sha512-/UNWDNV5Viwi/1lpr/dIXJNWiwDxpw13I4pTUAsNxZdg6E0mI2kTQb0P2iHczg1Tu+H4EBgJR+hYhKiHKko7qg==}
'@codemirror/lang-go@6.0.1':
resolution: {integrity: sha512-7fNvbyNylvqCphW9HD6WFnRpcDjr+KXX/FgqXy5H5ZS0eC5edDljukm/yNgYkwTsgp2busdod50AOTIy6Jikfg==}
'@codemirror/lang-html@6.4.9':
resolution: {integrity: sha512-aQv37pIMSlueybId/2PVSP6NPnmurFDVmZwzc7jszd2KAF8qd4VBbvNYPXWQq90WIARjsdVkPbw29pszmHws3Q==}
'@codemirror/lang-javascript@6.2.2':
resolution: {integrity: sha512-VGQfY+FCc285AhWuwjYxQyUQcYurWlxdKYT4bqwr3Twnd5wP5WSeu52t4tvvuWmljT4EmgEgZCqSieokhtY8hg==}
'@codemirror/lang-json@6.0.1':
resolution: {integrity: sha512-+T1flHdgpqDDlJZ2Lkil/rLiRy684WMLc74xUnjJH48GQdfJo/pudlTRreZmKwzP8/tGdKf83wlbAdOCzlJOGQ==}
'@codemirror/lang-markdown@6.2.5':
resolution: {integrity: sha512-Hgke565YcO4fd9pe2uLYxnMufHO5rQwRr+AAhFq8ABuhkrjyX8R5p5s+hZUTdV60O0dMRjxKhBLxz8pu/MkUVA==}
'@codemirror/lang-python@6.1.6':
resolution: {integrity: sha512-ai+01WfZhWqM92UqjnvorkxosZ2aq2u28kHvr+N3gu012XqY2CThD67JPMHnGceRfXPDBmn1HnyqowdpF57bNg==}
'@codemirror/lang-sass@6.0.2':
resolution: {integrity: sha512-l/bdzIABvnTo1nzdY6U+kPAC51czYQcOErfzQ9zSm9D8GmNPD0WTW8st/CJwBTPLO8jlrbyvlSEcN20dc4iL0Q==}
'@codemirror/lang-sql@6.7.1':
resolution: {integrity: sha512-flQa7zemrLKk0TIrOJnpeyH/b29BcVybtsTeZMgAo40O6kGbrnUSCgwI3TF5iJY3O9VXJKKCA+i0CBVvDfr88w==}
'@codemirror/lang-vue@0.1.3':
resolution: {integrity: sha512-QSKdtYTDRhEHCfo5zOShzxCmqKJvgGrZwDQSdbvCRJ5pRLWBS7pD/8e/tH44aVQT6FKm0t6RVNoSUWHOI5vNug==}
'@codemirror/lang-xml@6.1.0':
resolution: {integrity: sha512-3z0blhicHLfwi2UgkZYRPioSgVTo9PV5GP5ducFH6FaHy0IAJRg+ixj5gTR1gnT/glAIC8xv4w2VL1LoZfs+Jg==}
'@codemirror/lang-yaml@6.1.1':
resolution: {integrity: sha512-HV2NzbK9bbVnjWxwObuZh5FuPCowx51mEfoFT9y3y+M37fA3+pbxx4I7uePuygFzDsAmCTwQSc/kXh/flab4uw==}
'@codemirror/language@6.10.2':
resolution: {integrity: sha512-kgbTYTo0Au6dCSc/TFy7fK3fpJmgHDv1sG1KNQKJXVi+xBTEeBPY/M30YXiU6mMXeH+YIDLsbrT4ZwNRdtF+SA==}
'@codemirror/lint@6.8.1':
resolution: {integrity: sha512-IZ0Y7S4/bpaunwggW2jYqwLuHj0QtESf5xcROewY6+lDNwZ/NzvR4t+vpYgg9m7V8UXLPYqG+lu3DF470E5Oxg==}
'@codemirror/search@6.5.6':
resolution: {integrity: sha512-rpMgcsh7o0GuCDUXKPvww+muLA1pDJaFrpq/CCHtpQJYz8xopu4D1hPcKRoDD0YlF8gZaqTNIRa4VRBWyhyy7Q==}
'@codemirror/state@6.4.1':
resolution: {integrity: sha512-QkEyUiLhsJoZkbumGZlswmAhA7CBU02Wrz7zvH4SrcifbsqwlXShVXg65f3v/ts57W3dqyamEriMhij1Z3Zz4A==}
'@codemirror/view@6.33.0':
resolution: {integrity: sha512-AroaR3BvnjRW8fiZBalAaK+ZzB5usGgI014YKElYZvQdNH5ZIidHlO+cyf/2rWzyBFRkvG6VhiXeAEbC53P2YQ==}
'@css-render/plugin-bem@0.15.14': '@css-render/plugin-bem@0.15.14':
resolution: {integrity: sha512-QK513CJ7yEQxm/P3EwsI+d+ha8kSOcjGvD6SevM41neEMxdULE+18iuQK6tEChAWMOQNQPLG/Rw3Khb69r5neg==} resolution: {integrity: sha512-QK513CJ7yEQxm/P3EwsI+d+ha8kSOcjGvD6SevM41neEMxdULE+18iuQK6tEChAWMOQNQPLG/Rw3Khb69r5neg==}
peerDependencies: peerDependencies:
@@ -241,6 +345,45 @@ packages:
'@juggle/resize-observer@3.4.0': '@juggle/resize-observer@3.4.0':
resolution: {integrity: sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==} resolution: {integrity: sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==}
'@lezer/common@1.2.1':
resolution: {integrity: sha512-yemX0ZD2xS/73llMZIK6KplkjIjf2EvAHcinDi/TfJ9hS25G0388+ClHt6/3but0oOxinTcQHJLDXh6w1crzFQ==}
'@lezer/css@1.1.8':
resolution: {integrity: sha512-7JhxupKuMBaWQKjQoLtzhGj83DdnZY9MckEOG5+/iLKNK2ZJqKc6hf6uc0HjwCX7Qlok44jBNqZhHKDhEhZYLA==}
'@lezer/go@1.0.0':
resolution: {integrity: sha512-co9JfT3QqX1YkrMmourYw2Z8meGC50Ko4d54QEcQbEYpvdUvN4yb0NBZdn/9ertgvjsySxHsKzH3lbm3vqJ4Jw==}
'@lezer/highlight@1.2.1':
resolution: {integrity: sha512-Z5duk4RN/3zuVO7Jq0pGLJ3qynpxUVsh7IbUbGj88+uV2ApSAn6kWg2au3iJb+0Zi7kKtqffIESgNcRXWZWmSA==}
'@lezer/html@1.3.10':
resolution: {integrity: sha512-dqpT8nISx/p9Do3AchvYGV3qYc4/rKr3IBZxlHmpIKam56P47RSHkSF5f13Vu9hebS1jM0HmtJIwLbWz1VIY6w==}
'@lezer/javascript@1.4.17':
resolution: {integrity: sha512-bYW4ctpyGK+JMumDApeUzuIezX01H76R1foD6LcRX224FWfyYit/HYxiPGDjXXe/wQWASjCvVGoukTH68+0HIA==}
'@lezer/json@1.0.2':
resolution: {integrity: sha512-xHT2P4S5eeCYECyKNPhr4cbEL9tc8w83SPwRC373o9uEdrvGKTZoJVAGxpOsZckMlEh9W23Pc72ew918RWQOBQ==}
'@lezer/lr@1.4.2':
resolution: {integrity: sha512-pu0K1jCIdnQ12aWNaAVU5bzi7Bd1w54J3ECgANPmYLtQKP0HBj2cE/5coBD66MT10xbtIuUr7tg0Shbsvk0mDA==}
'@lezer/markdown@1.3.0':
resolution: {integrity: sha512-ErbEQ15eowmJUyT095e9NJc3BI9yZ894fjSDtHftD0InkfUBGgnKSU6dvan9jqsZuNHg2+ag/1oyDRxNsENupQ==}
'@lezer/python@1.1.14':
resolution: {integrity: sha512-ykDOb2Ti24n76PJsSa4ZoDF0zH12BSw1LGfQXCYJhJyOGiFTfGaX0Du66Ze72R+u/P35U+O6I9m8TFXov1JzsA==}
'@lezer/sass@1.0.6':
resolution: {integrity: sha512-w/RCO2dIzZH1To8p+xjs8cE+yfgGus8NZ/dXeWl/QzHyr+TeBs71qiE70KPImEwvTsmEjoWh0A5SxMzKd5BWBQ==}
'@lezer/xml@1.0.5':
resolution: {integrity: sha512-VFouqOzmUWfIg+tfmpcdV33ewtK+NSwd4ngSe1aG7HFb4BN0ExyY1b8msp+ndFrnlG4V4iC8yXacjFtrwERnaw==}
'@lezer/yaml@1.0.3':
resolution: {integrity: sha512-GuBLekbw9jDBDhGur82nuwkxKQ+a3W5H0GfaAthDXcAu+XdpS43VlnxA9E9hllkpSP5ellRDKjLLj7Lu9Wr6xA==}
'@mapbox/node-pre-gyp@1.0.11': '@mapbox/node-pre-gyp@1.0.11':
resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==}
hasBin: true hasBin: true
@@ -353,6 +496,16 @@ packages:
resolution: {integrity: sha512-TRdIPqdsvKmPla44kVy4jv5Nt5vjMfVjbIEke1CRULIrwKNRC4lIiZvNYDJvbUMNCFPNIUcOKhXTyMJrX18IMA==} resolution: {integrity: sha512-TRdIPqdsvKmPla44kVy4jv5Nt5vjMfVjbIEke1CRULIrwKNRC4lIiZvNYDJvbUMNCFPNIUcOKhXTyMJrX18IMA==}
deprecated: This is a stub types definition. pdfjs-dist provides its own type definitions, so you do not need this installed. deprecated: This is a stub types definition. pdfjs-dist provides its own type definitions, so you do not need this installed.
'@uiw/codemirror-theme-vscode@4.23.0':
resolution: {integrity: sha512-zl1FD7U1b58tqlF216jYv2okvVkTe+FP1ztqO/DF129bcH99QjszkakshyfxQEvvF4ys3zyzqZ7vU3VYBir8tg==}
'@uiw/codemirror-themes@4.23.0':
resolution: {integrity: sha512-9fiji9xooZyBQozR1i6iTr56YP7j/Dr/VgsNWbqf5Szv+g+4WM1iZuiDGwNXmFMWX8gbkDzp6ASE21VCPSofWw==}
peerDependencies:
'@codemirror/language': '>=6.0.0'
'@codemirror/state': '>=6.0.0'
'@codemirror/view': '>=6.0.0'
'@vicons/ionicons5@0.12.0': '@vicons/ionicons5@0.12.0':
resolution: {integrity: sha512-Iy1EUVRpX0WWxeu1VIReR1zsZLMc4fqpt223czR+Rpnrwu7pt46nbnC2ycO7ItI/uqDLJxnbcMC7FujKs9IfFA==} resolution: {integrity: sha512-Iy1EUVRpX0WWxeu1VIReR1zsZLMc4fqpt223czR+Rpnrwu7pt46nbnC2ycO7ItI/uqDLJxnbcMC7FujKs9IfFA==}
@@ -473,6 +626,9 @@ packages:
resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==}
engines: {node: '>=10'} engines: {node: '>=10'}
codemirror@6.0.1:
resolution: {integrity: sha512-J8j+nZ+CdWmIeFIGXEFbFPtpiYacFMDR8GlHK3IyHQJMCaVRfGx9NT+Hxivv1ckLWPvNdZqndbr/7lVhrf/Svg==}
color-support@1.1.3: color-support@1.1.3:
resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==}
hasBin: true hasBin: true
@@ -493,6 +649,9 @@ packages:
core-js@3.38.1: core-js@3.38.1:
resolution: {integrity: sha512-OP35aUorbU3Zvlx7pjsFdu1rGNnD4pgw/CWoYzRY3t2EzoVT7shKHY1dlAy3f41cGIO7ZDPQimhGFTlEYkG/Hw==} resolution: {integrity: sha512-OP35aUorbU3Zvlx7pjsFdu1rGNnD4pgw/CWoYzRY3t2EzoVT7shKHY1dlAy3f41cGIO7ZDPQimhGFTlEYkG/Hw==}
crelt@1.0.6:
resolution: {integrity: sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==}
css-render@0.15.14: css-render@0.15.14:
resolution: {integrity: sha512-9nF4PdUle+5ta4W5SyZdLCCmFd37uVimSjg1evcTqKJCyvCEEj12WKzOSBNak6r4im4J4iYXKH1OWpUV5LBYFg==} resolution: {integrity: sha512-9nF4PdUle+5ta4W5SyZdLCCmFd37uVimSjg1evcTqKJCyvCEEj12WKzOSBNak6r4im4J4iYXKH1OWpUV5LBYFg==}
@@ -881,6 +1040,9 @@ packages:
resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
engines: {node: '>=8'} engines: {node: '>=8'}
style-mod@4.1.2:
resolution: {integrity: sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==}
tar@6.2.1: tar@6.2.1:
resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==}
engines: {node: '>=10'} engines: {node: '>=10'}
@@ -964,6 +1126,12 @@ packages:
vscode-uri@3.0.8: vscode-uri@3.0.8:
resolution: {integrity: sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==} resolution: {integrity: sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==}
vue-codemirror@6.1.1:
resolution: {integrity: sha512-rTAYo44owd282yVxKtJtnOi7ERAcXTeviwoPXjIc6K/IQYUsoDkzPvw/JDFtSP6T7Cz/2g3EHaEyeyaQCKoDMg==}
peerDependencies:
codemirror: 6.x
vue: 3.x
vue-tsc@2.0.29: vue-tsc@2.0.29:
resolution: {integrity: sha512-MHhsfyxO3mYShZCGYNziSbc63x7cQ5g9kvijV7dRe1TTXBRLxXyL0FnXWpUF1xII2mJ86mwYpYsUmMwkmerq7Q==} resolution: {integrity: sha512-MHhsfyxO3mYShZCGYNziSbc63x7cQ5g9kvijV7dRe1TTXBRLxXyL0FnXWpUF1xII2mJ86mwYpYsUmMwkmerq7Q==}
hasBin: true hasBin: true
@@ -983,6 +1151,9 @@ packages:
peerDependencies: peerDependencies:
vue: ^3.0.11 vue: ^3.0.11
w3c-keyname@2.2.8:
resolution: {integrity: sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==}
webidl-conversions@3.0.1: webidl-conversions@3.0.1:
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
@@ -1028,6 +1199,166 @@ snapshots:
'@babel/helper-validator-identifier': 7.24.7 '@babel/helper-validator-identifier': 7.24.7
to-fast-properties: 2.0.0 to-fast-properties: 2.0.0
'@codemirror/autocomplete@6.18.0(@codemirror/language@6.10.2)(@codemirror/state@6.4.1)(@codemirror/view@6.33.0)(@lezer/common@1.2.1)':
dependencies:
'@codemirror/language': 6.10.2
'@codemirror/state': 6.4.1
'@codemirror/view': 6.33.0
'@lezer/common': 1.2.1
'@codemirror/commands@6.6.0':
dependencies:
'@codemirror/language': 6.10.2
'@codemirror/state': 6.4.1
'@codemirror/view': 6.33.0
'@lezer/common': 1.2.1
'@codemirror/lang-css@6.2.1(@codemirror/view@6.33.0)':
dependencies:
'@codemirror/autocomplete': 6.18.0(@codemirror/language@6.10.2)(@codemirror/state@6.4.1)(@codemirror/view@6.33.0)(@lezer/common@1.2.1)
'@codemirror/language': 6.10.2
'@codemirror/state': 6.4.1
'@lezer/common': 1.2.1
'@lezer/css': 1.1.8
transitivePeerDependencies:
- '@codemirror/view'
'@codemirror/lang-go@6.0.1(@codemirror/view@6.33.0)':
dependencies:
'@codemirror/autocomplete': 6.18.0(@codemirror/language@6.10.2)(@codemirror/state@6.4.1)(@codemirror/view@6.33.0)(@lezer/common@1.2.1)
'@codemirror/language': 6.10.2
'@codemirror/state': 6.4.1
'@lezer/common': 1.2.1
'@lezer/go': 1.0.0
transitivePeerDependencies:
- '@codemirror/view'
'@codemirror/lang-html@6.4.9':
dependencies:
'@codemirror/autocomplete': 6.18.0(@codemirror/language@6.10.2)(@codemirror/state@6.4.1)(@codemirror/view@6.33.0)(@lezer/common@1.2.1)
'@codemirror/lang-css': 6.2.1(@codemirror/view@6.33.0)
'@codemirror/lang-javascript': 6.2.2
'@codemirror/language': 6.10.2
'@codemirror/state': 6.4.1
'@codemirror/view': 6.33.0
'@lezer/common': 1.2.1
'@lezer/css': 1.1.8
'@lezer/html': 1.3.10
'@codemirror/lang-javascript@6.2.2':
dependencies:
'@codemirror/autocomplete': 6.18.0(@codemirror/language@6.10.2)(@codemirror/state@6.4.1)(@codemirror/view@6.33.0)(@lezer/common@1.2.1)
'@codemirror/language': 6.10.2
'@codemirror/lint': 6.8.1
'@codemirror/state': 6.4.1
'@codemirror/view': 6.33.0
'@lezer/common': 1.2.1
'@lezer/javascript': 1.4.17
'@codemirror/lang-json@6.0.1':
dependencies:
'@codemirror/language': 6.10.2
'@lezer/json': 1.0.2
'@codemirror/lang-markdown@6.2.5':
dependencies:
'@codemirror/autocomplete': 6.18.0(@codemirror/language@6.10.2)(@codemirror/state@6.4.1)(@codemirror/view@6.33.0)(@lezer/common@1.2.1)
'@codemirror/lang-html': 6.4.9
'@codemirror/language': 6.10.2
'@codemirror/state': 6.4.1
'@codemirror/view': 6.33.0
'@lezer/common': 1.2.1
'@lezer/markdown': 1.3.0
'@codemirror/lang-python@6.1.6(@codemirror/view@6.33.0)':
dependencies:
'@codemirror/autocomplete': 6.18.0(@codemirror/language@6.10.2)(@codemirror/state@6.4.1)(@codemirror/view@6.33.0)(@lezer/common@1.2.1)
'@codemirror/language': 6.10.2
'@codemirror/state': 6.4.1
'@lezer/common': 1.2.1
'@lezer/python': 1.1.14
transitivePeerDependencies:
- '@codemirror/view'
'@codemirror/lang-sass@6.0.2(@codemirror/view@6.33.0)':
dependencies:
'@codemirror/lang-css': 6.2.1(@codemirror/view@6.33.0)
'@codemirror/language': 6.10.2
'@codemirror/state': 6.4.1
'@lezer/common': 1.2.1
'@lezer/sass': 1.0.6
transitivePeerDependencies:
- '@codemirror/view'
'@codemirror/lang-sql@6.7.1(@codemirror/view@6.33.0)':
dependencies:
'@codemirror/autocomplete': 6.18.0(@codemirror/language@6.10.2)(@codemirror/state@6.4.1)(@codemirror/view@6.33.0)(@lezer/common@1.2.1)
'@codemirror/language': 6.10.2
'@codemirror/state': 6.4.1
'@lezer/common': 1.2.1
'@lezer/highlight': 1.2.1
'@lezer/lr': 1.4.2
transitivePeerDependencies:
- '@codemirror/view'
'@codemirror/lang-vue@0.1.3':
dependencies:
'@codemirror/lang-html': 6.4.9
'@codemirror/lang-javascript': 6.2.2
'@codemirror/language': 6.10.2
'@lezer/common': 1.2.1
'@lezer/highlight': 1.2.1
'@lezer/lr': 1.4.2
'@codemirror/lang-xml@6.1.0':
dependencies:
'@codemirror/autocomplete': 6.18.0(@codemirror/language@6.10.2)(@codemirror/state@6.4.1)(@codemirror/view@6.33.0)(@lezer/common@1.2.1)
'@codemirror/language': 6.10.2
'@codemirror/state': 6.4.1
'@codemirror/view': 6.33.0
'@lezer/common': 1.2.1
'@lezer/xml': 1.0.5
'@codemirror/lang-yaml@6.1.1(@codemirror/view@6.33.0)':
dependencies:
'@codemirror/autocomplete': 6.18.0(@codemirror/language@6.10.2)(@codemirror/state@6.4.1)(@codemirror/view@6.33.0)(@lezer/common@1.2.1)
'@codemirror/language': 6.10.2
'@codemirror/state': 6.4.1
'@lezer/common': 1.2.1
'@lezer/highlight': 1.2.1
'@lezer/yaml': 1.0.3
transitivePeerDependencies:
- '@codemirror/view'
'@codemirror/language@6.10.2':
dependencies:
'@codemirror/state': 6.4.1
'@codemirror/view': 6.33.0
'@lezer/common': 1.2.1
'@lezer/highlight': 1.2.1
'@lezer/lr': 1.4.2
style-mod: 4.1.2
'@codemirror/lint@6.8.1':
dependencies:
'@codemirror/state': 6.4.1
'@codemirror/view': 6.33.0
crelt: 1.0.6
'@codemirror/search@6.5.6':
dependencies:
'@codemirror/state': 6.4.1
'@codemirror/view': 6.33.0
crelt: 1.0.6
'@codemirror/state@6.4.1': {}
'@codemirror/view@6.33.0':
dependencies:
'@codemirror/state': 6.4.1
style-mod: 4.1.2
w3c-keyname: 2.2.8
'@css-render/plugin-bem@0.15.14(css-render@0.15.14)': '@css-render/plugin-bem@0.15.14(css-render@0.15.14)':
dependencies: dependencies:
css-render: 0.15.14 css-render: 0.15.14
@@ -1111,6 +1442,75 @@ snapshots:
'@juggle/resize-observer@3.4.0': {} '@juggle/resize-observer@3.4.0': {}
'@lezer/common@1.2.1': {}
'@lezer/css@1.1.8':
dependencies:
'@lezer/common': 1.2.1
'@lezer/highlight': 1.2.1
'@lezer/lr': 1.4.2
'@lezer/go@1.0.0':
dependencies:
'@lezer/common': 1.2.1
'@lezer/highlight': 1.2.1
'@lezer/lr': 1.4.2
'@lezer/highlight@1.2.1':
dependencies:
'@lezer/common': 1.2.1
'@lezer/html@1.3.10':
dependencies:
'@lezer/common': 1.2.1
'@lezer/highlight': 1.2.1
'@lezer/lr': 1.4.2
'@lezer/javascript@1.4.17':
dependencies:
'@lezer/common': 1.2.1
'@lezer/highlight': 1.2.1
'@lezer/lr': 1.4.2
'@lezer/json@1.0.2':
dependencies:
'@lezer/common': 1.2.1
'@lezer/highlight': 1.2.1
'@lezer/lr': 1.4.2
'@lezer/lr@1.4.2':
dependencies:
'@lezer/common': 1.2.1
'@lezer/markdown@1.3.0':
dependencies:
'@lezer/common': 1.2.1
'@lezer/highlight': 1.2.1
'@lezer/python@1.1.14':
dependencies:
'@lezer/common': 1.2.1
'@lezer/highlight': 1.2.1
'@lezer/lr': 1.4.2
'@lezer/sass@1.0.6':
dependencies:
'@lezer/common': 1.2.1
'@lezer/highlight': 1.2.1
'@lezer/lr': 1.4.2
'@lezer/xml@1.0.5':
dependencies:
'@lezer/common': 1.2.1
'@lezer/highlight': 1.2.1
'@lezer/lr': 1.4.2
'@lezer/yaml@1.0.3':
dependencies:
'@lezer/common': 1.2.1
'@lezer/highlight': 1.2.1
'@lezer/lr': 1.4.2
'@mapbox/node-pre-gyp@1.0.11': '@mapbox/node-pre-gyp@1.0.11':
dependencies: dependencies:
detect-libc: 2.0.3 detect-libc: 2.0.3
@@ -1196,6 +1596,20 @@ snapshots:
- encoding - encoding
- supports-color - supports-color
'@uiw/codemirror-theme-vscode@4.23.0(@codemirror/language@6.10.2)(@codemirror/state@6.4.1)(@codemirror/view@6.33.0)':
dependencies:
'@uiw/codemirror-themes': 4.23.0(@codemirror/language@6.10.2)(@codemirror/state@6.4.1)(@codemirror/view@6.33.0)
transitivePeerDependencies:
- '@codemirror/language'
- '@codemirror/state'
- '@codemirror/view'
'@uiw/codemirror-themes@4.23.0(@codemirror/language@6.10.2)(@codemirror/state@6.4.1)(@codemirror/view@6.33.0)':
dependencies:
'@codemirror/language': 6.10.2
'@codemirror/state': 6.4.1
'@codemirror/view': 6.33.0
'@vicons/ionicons5@0.12.0': {} '@vicons/ionicons5@0.12.0': {}
'@vitejs/plugin-vue@5.1.2(vite@5.4.0(@types/node@22.1.0)(sass@1.77.8))(vue@3.4.37(typescript@5.5.4))': '@vitejs/plugin-vue@5.1.2(vite@5.4.0(@types/node@22.1.0)(sass@1.77.8))(vue@3.4.37(typescript@5.5.4))':
@@ -1369,6 +1783,18 @@ snapshots:
chownr@2.0.0: chownr@2.0.0:
optional: true optional: true
codemirror@6.0.1(@lezer/common@1.2.1):
dependencies:
'@codemirror/autocomplete': 6.18.0(@codemirror/language@6.10.2)(@codemirror/state@6.4.1)(@codemirror/view@6.33.0)(@lezer/common@1.2.1)
'@codemirror/commands': 6.6.0
'@codemirror/language': 6.10.2
'@codemirror/lint': 6.8.1
'@codemirror/search': 6.5.6
'@codemirror/state': 6.4.1
'@codemirror/view': 6.33.0
transitivePeerDependencies:
- '@lezer/common'
color-support@1.1.3: color-support@1.1.3:
optional: true optional: true
@@ -1386,6 +1812,8 @@ snapshots:
core-js@3.38.1: {} core-js@3.38.1: {}
crelt@1.0.6: {}
css-render@0.15.14: css-render@0.15.14:
dependencies: dependencies:
'@emotion/hash': 0.8.0 '@emotion/hash': 0.8.0
@@ -1833,6 +2261,8 @@ snapshots:
ansi-regex: 5.0.1 ansi-regex: 5.0.1
optional: true optional: true
style-mod@4.1.2: {}
tar@6.2.1: tar@6.2.1:
dependencies: dependencies:
chownr: 2.0.0 chownr: 2.0.0
@@ -1891,6 +2321,15 @@ snapshots:
vscode-uri@3.0.8: {} vscode-uri@3.0.8: {}
vue-codemirror@6.1.1(codemirror@6.0.1(@lezer/common@1.2.1))(vue@3.4.37(typescript@5.5.4)):
dependencies:
'@codemirror/commands': 6.6.0
'@codemirror/language': 6.10.2
'@codemirror/state': 6.4.1
'@codemirror/view': 6.33.0
codemirror: 6.0.1(@lezer/common@1.2.1)
vue: 3.4.37(typescript@5.5.4)
vue-tsc@2.0.29(typescript@5.5.4): vue-tsc@2.0.29(typescript@5.5.4):
dependencies: dependencies:
'@volar/typescript': 2.4.0-alpha.18 '@volar/typescript': 2.4.0-alpha.18
@@ -1919,6 +2358,8 @@ snapshots:
vooks: 0.2.12(vue@3.4.37(typescript@5.5.4)) vooks: 0.2.12(vue@3.4.37(typescript@5.5.4))
vue: 3.4.37(typescript@5.5.4) vue: 3.4.37(typescript@5.5.4)
w3c-keyname@2.2.8: {}
webidl-conversions@3.0.1: webidl-conversions@3.0.1:
optional: true optional: true
+1 -1
View File
@@ -327,7 +327,7 @@ $tag-width: 170px;
display: flex; display: flex;
// flex-direction: column; // flex-direction: column;
height: calc(100% - $controller-height); height: calc(100% - $controller-height);
overflow-y: overlay; overflow-y: hidden;
overflow-x: overlay; overflow-x: overlay;
.view-container-item { .view-container-item {
+25 -10
View File
@@ -1,5 +1,5 @@
import useViretualPages from "@/hooks/useVirtualPages" import useVirtualPages from '@/hooks/useVirtualPages'
import VirtualDirectory, { VirtualFile } from "./VirtualDirectory" import VirtualDirectory, { VirtualFile } from './VirtualDirectory'
type plugin = { type plugin = {
// 用于显示的名字 // 用于显示的名字
@@ -20,22 +20,34 @@ export default class PluginCenter {
register(key: string, plugin: plugin) { register(key: string, plugin: plugin) {
this.pluginsMap[key] = plugin this.pluginsMap[key] = plugin
console.log(this.pluginsMap)
} }
/** /**
* 便捷地注册一个组件为插件,触发时直接用新页面打开 * 便捷地注册一个组件为插件,触发时直接用新页面打开
*/ */
registerComponent(key: string,name: string, component: any, filter:(VDirectorys: VirtualDirectory[], VFiles: VirtualFile[]) => boolean): void { registerComponent(
key: string,
name: string,
getComponent: () => Promise<any>,
filter: (
VDirectorys: VirtualDirectory[],
VFiles: VirtualFile[]
) => boolean
): void {
let _component: any
const views = useVirtualPages()
this.register(key, { this.register(key, {
name, name,
filter, filter,
func: (VDirectorys: VirtualDirectory[], VFiles: VirtualFile[]) => { func: async (
VDirectorys: VirtualDirectory[],
VFiles: VirtualFile[]
) => {
if (filter(VDirectorys, VFiles) === false) { if (filter(VDirectorys, VFiles) === false) {
return return
} }
const views = useViretualPages() if (_component === undefined) _component = await getComponent()
views.push(component, VDirectorys, VFiles) views.push(_component, VDirectorys, VFiles)
} }
}) })
} }
@@ -47,14 +59,17 @@ export default class PluginCenter {
usableList.push(key) usableList.push(key)
} }
} }
return usableList.map(key=>({ return usableList.map((key) => ({
key, key,
...this.pluginsMap[key] ...this.pluginsMap[key]
})) }))
} }
usePlugin(key: string, VDirectorys: VirtualDirectory[], VFiles: VirtualFile[]) { usePlugin(
key: string,
VDirectorys: VirtualDirectory[],
VFiles: VirtualFile[]
) {
this.pluginsMap[key].func(VDirectorys, VFiles) this.pluginsMap[key].func(VDirectorys, VFiles)
} }
} }
+46 -8
View File
@@ -1,15 +1,12 @@
import MiaoDirectory from '@/views/miaoDirectory.vue' import MiaoDirectory from '@/views/miaoDirectory.vue'
import usePluginCenter from './usePluginCenter' import usePluginCenter from './usePluginCenter'
import MiaoVideoPlayer from '@/views/miaoVideoPlayer.vue'
import MiaoIframe from '@/views/miaoIframe.vue'
import MiaoPDF from '@/views/miaoPDF.vue'
export default function init() { export default function init() {
const pluginCenter = usePluginCenter() const pluginCenter = usePluginCenter()
pluginCenter.registerComponent( pluginCenter.registerComponent(
'miaoDirectory', 'miaoDirectory',
'文件夹', '文件夹',
MiaoDirectory, async () => MiaoDirectory,
(vDirs, vFiles) => { (vDirs, vFiles) => {
if (vFiles.length) { if (vFiles.length) {
return false return false
@@ -20,7 +17,7 @@ export default function init() {
pluginCenter.registerComponent( pluginCenter.registerComponent(
'miaoVideoPlayer', 'miaoVideoPlayer',
'视频', '视频',
MiaoVideoPlayer, async () => (await import('@/views/miaoVideoPlayer.vue')).default,
(vDirs, vFiles) => { (vDirs, vFiles) => {
if (vDirs.length !== 0) { if (vDirs.length !== 0) {
return false return false
@@ -41,15 +38,21 @@ export default function init() {
pluginCenter.registerComponent( pluginCenter.registerComponent(
'miaoIframe', 'miaoIframe',
'框架', '框架',
MiaoIframe, async () => (await import('@/views/miaoIframe.vue')).default,
() => { (vDirs, vFiles) => {
if (vDirs.length !== 0) {
return false return false
} }
if (vFiles.length !== 1) {
return false
}
return vFiles[0].name.endsWith('html')
}
) )
pluginCenter.registerComponent( pluginCenter.registerComponent(
'miaoPDF', 'miaoPDF',
'PDF浏览', 'PDF浏览',
MiaoPDF, async () => (await import('@/views/miaoPDF.vue')).default,
(vDirs, vFiles) => { (vDirs, vFiles) => {
if (vDirs.length !== 0) { if (vDirs.length !== 0) {
return false return false
@@ -60,4 +63,39 @@ export default function init() {
return vFiles[0].name.endsWith('pdf') return vFiles[0].name.endsWith('pdf')
} }
) )
pluginCenter.registerComponent(
'miaoCodeMirror',
'代码编辑',
async () => (await import('@/views/miaoCodeMirror.vue')).default,
(vDirs, vFiles) => {
if (vDirs.length !== 0) {
return false
}
if (vFiles.length !== 1) {
return false
}
for (let end of [
'js',
'ts',
'jsx',
'tsx',
'py',
'html',
'css',
'scss',
'go',
'json',
'md',
'yaml',
'txt',
'xml',
'vue',
]) {
if (vFiles[0].name.endsWith(end)) {
return true
}
}
return false
}
)
} }
+21
View File
@@ -67,6 +67,27 @@ const miaoFetchApi = {
return response.data return response.data
}, },
/**
* 获取对应文件夹下的数据
*/
async getFile(
vFile: VirtualFile,
option?: getOption
): Promise<getResponse> {
// const { baseUrl, api } = Config
const url = vFile.url
const retry = option?.retry ?? 0
const axiosOption = option?.axiosOption ?? {}
const { miaoFetch } = useMiaoFetch({
retry
})
const response = await miaoFetch({
url, ...axiosOption
})
return response.data
},
/** /**
* 上传单个文件到对应文件夹, 后续要将data类型改成buffer以支持分片上传 * 上传单个文件到对应文件夹, 后续要将data类型改成buffer以支持分片上传
* 正常上传文件请使用uploadQueue * 正常上传文件请使用uploadQueue
+4 -2
View File
@@ -1,8 +1,10 @@
import { AxiosRequestConfig } from "axios";
import { directory, file } from "./type"; import { directory, file } from "./type";
export type miaoFetchConfig = { export type miaoFetchConfig = {
retry?: number; retry?: number
}; axiosOption?: AxiosRequestConfig<any>
}
export type getOption = {} & miaoFetchConfig; export type getOption = {} & miaoFetchConfig;
+155
View File
@@ -0,0 +1,155 @@
<template>
<div
class="codemirror-container"
ref="rootRef"
:class="`codemirror-container-${theme}`">
<div class="codemirror-container-top">
<button @click="handleSave">保存</button>
<button @click="switchTheme">切换主题</button>
</div>
<!-- <NScrollbar :key="_key"> -->
<codemirror
v-model="codeData"
:extensions="extensions"
:style="{ height: '100%' }" />
<!-- </NScrollbar> -->
</div>
</template>
<script setup lang="ts">
import { VirtualFile } from '@/class/VirtualDirectory'
import useMiaoFetchApi from '@/hooks/useMiaoFetchApi'
import { onMounted, ref } from 'vue'
import { Codemirror } from 'vue-codemirror'
import { NScrollbar } from 'naive-ui'
import { vscodeDark, vscodeLight } from '@uiw/codemirror-theme-vscode'
const miaoFetchApi = useMiaoFetchApi()
const currentFiles = defineModel<VirtualFile[]>('currentFiles', {
required: true
})
const vFile = ref<VirtualFile>()
const rootRef = ref<HTMLDivElement>()
const _key = ref(Math.random())
const codeData = ref<string>()
// 第一次点击保存时自动备份data,暂时懒得做
const bakData = ref<string>()
const extensions = ref<any[]>([])
const theme = ref<'light' | 'dark'>('light')
const handleSave = async () => {
if (bakData.value === codeData.value || !vFile.value) {
return
}
const parentDir = vFile.value?.parent
const file_bak = new File(
[new Blob([bakData.value ?? ''])],
`${vFile.value?.name}.bak`
)
const file = new File([new Blob([codeData.value ?? ''])], vFile.value.name)
bakData.value = codeData.value
miaoFetchApi.upload(file, parentDir)
false && miaoFetchApi.upload(file_bak, parentDir)
}
const switchTheme = async () => {
if (!vFile.value) {
return
}
theme.value = theme.value === 'dark' ? 'light' : 'dark'
extensions.value = [
...(await getLangExtensions(vFile.value?.name)),
theme.value === 'dark' ? vscodeDark : vscodeLight
]
_key.value = Math.random()
}
const getLangExtensions = async (fileName: string) => {
const ext = fileName.split('.').pop()?.toLocaleLowerCase()
switch (ext) {
case 'js':
case 'jsx':
case 'ts':
case 'tsx':
const { javascript } = await import('@codemirror/lang-javascript')
return [javascript()]
break
case 'css':
case 'scss':
const { sass } = await import('@codemirror/lang-sass')
return [sass()]
break
case 'html':
const { html } = await import('@codemirror/lang-html')
return [html()]
break
case 'py':
const { python } = await import('@codemirror/lang-python')
return [python()]
break
case 'go':
const { go } = await import('@codemirror/lang-go')
return [go()]
break
case 'json':
const { json } = await import('@codemirror/lang-json')
return [json()]
break
case 'md':
const { markdown } = await import('@codemirror/lang-markdown')
return [markdown()]
break
case 'yaml':
const { yaml } = await import('@codemirror/lang-yaml')
return [yaml()]
break
case 'vue':
const { vue } = await import('@codemirror/lang-vue')
return [vue()]
break
case 'xml':
const { xml } = await import('@codemirror/lang-xml')
return [xml()]
break
default:
return []
}
}
onMounted(async () => {
vFile.value = currentFiles.value[0]
const fileName = currentFiles.value[0].name
codeData.value = (
await miaoFetchApi.getFile(currentFiles.value[0], {
axiosOption: { responseType: 'text' }
})
).toString()
bakData.value = codeData.value
extensions.value = [...(await getLangExtensions(fileName)), vscodeLight]
rootRef.value?.addEventListener('keydown', (event) => {
if (event.ctrlKey && event.key === 's') {
event.preventDefault()
handleSave()
}
})
})
</script>
<style scoped lang="scss">
.codemirror-container {
width: 100%;
height: 100%;
&-top {
background-color: aqua;
}
}
.codemirror-container-dark {
background-color: rgb(30, 30, 30);
}
.codemirror-container-light {
background-color: rgb(255, 255, 255);
}
</style>
+2 -2
View File
@@ -13,7 +13,7 @@
</div> </div>
</div> </div>
</NScrollbar> </NScrollbar>
<div class="miao-container-loading" v-if="isLoading">{{ loadingPercent === -1 ? '缓存中' : <div class="miao-container-loading" v-if="isLoading">{{ loadingPercent === -1 ? '加载插件中' :
`渲染进度:${canvasList.length}/${pdfPageCount}` }}</div> `渲染进度:${canvasList.length}/${pdfPageCount}` }}</div>
</div> </div>
</template> </template>
@@ -103,7 +103,7 @@ onMounted(async () => {
.miao-container { .miao-container {
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: rgb(53, 53, 53); background-color: rgb(201, 201, 201);
overflow: hidden; overflow: hidden;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
+15 -7
View File
@@ -1,11 +1,15 @@
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue' import vue from '@vitejs/plugin-vue'
import { resolve } from 'path' import { resolve } from 'path'
import { viteSingleFile } from 'vite-plugin-singlefile' // import { viteSingleFile } from 'vite-plugin-singlefile'
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [vue(), viteSingleFile()], base: './',
plugins: [
vue()
// viteSingleFile()
],
resolve: { resolve: {
alias: { alias: {
'@': resolve(__dirname, 'src') '@': resolve(__dirname, 'src')
@@ -59,11 +63,15 @@ export default defineConfig({
}, },
output: { output: {
// 配置输出为单文件 // 配置输出为单文件
inlineDynamicImports: true, // inlineDynamicImports: true,
manualChunks: undefined, manualChunks(id) {
entryFileNames: 'bundle.js', if (id.includes('@codemirror')) {
format: 'iife', // 立即执行函数格式 return id.split('@')[1].replace('+', '-')
name: 'MyBundle' }
}
// entryFileNames: 'bundle.js',
// format: 'iife', // 立即执行函数格式
// name: 'MyBundle'
} }
} }
} }