Skip to content

Commit 6468aa6

Browse files
committed
fix: warning
1 parent b880669 commit 6468aa6

21 files changed

+365
-638
lines changed

config/config.doc.js

+16-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* @Descripttion: 文档环境配置
77
*/
88

9+
const path = require('path')
10+
911
module.exports = {
1012
outputDir: './docs',
1113
publicPath: './',
@@ -39,12 +41,24 @@ module.exports = {
3941
.loader('babel-loader')
4042

4143
// 别名配置
42-
config.resolve.alias.set('@', '/doc').set('@packages', '/packages')
44+
config.resolve.alias
45+
.set('@', path.resolve(__dirname, '../doc'))
46+
.set('@packages', path.resolve(__dirname, '../packages'))
4347
},
4448
css: {
4549
loaderOptions: {
4650
sass: {
47-
data: '@import "~@/style/imports.scss";'
51+
sassOptions: {
52+
// 设置 Sass 的严格模式,这有助于减少一些警告
53+
charset: false,
54+
outputStyle: 'expanded'
55+
},
56+
additionalData: `
57+
@use "sass:color";
58+
@use "@/style/mixins" as mix;
59+
@use "@/style/vars" as var;
60+
@use "@/style/md-colors" as colors;
61+
`
4862
}
4963
}
5064
}

doc/App.vue

+43-41
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ body {
6666
}
6767
6868
header {
69-
background: $primary-color;
69+
background: var.$primary-color;
7070
padding: 32px 20px 20px;
7171
7272
.description {
@@ -82,43 +82,45 @@ header {
8282
word-break: break-word;
8383
}
8484
85-
section {
86-
.section-content {
87-
margin: 0;
88-
box-sizing: border-box;
89-
}
85+
section .section-content {
86+
margin: 0;
87+
box-sizing: border-box;
88+
}
9089
91-
&.nav {
92-
text-align: center;
93-
background: $primary-color;
94-
padding: 40px 20px 0;
95-
@include h-box;
96-
@include box-center;
97-
98-
a {
99-
display: inline-block;
100-
padding: 0 16px;
101-
height: 36px;
102-
line-height: 36px;
103-
color: white;
104-
background: lighten($primary-color, 10%);
105-
border-radius: 3px;
106-
107-
&:hover {
108-
background: lighten($primary-color, 20%);
109-
}
90+
section.nav {
91+
text-align: center;
92+
background: var.$primary-color;
93+
padding: 40px 20px 0;
94+
display: flex;
95+
flex-direction: row;
96+
align-items: center;
97+
justify-content: center;
98+
}
11099
111-
&:not(:last-child) {
112-
margin-right: 8px;
113-
}
114-
}
115-
}
100+
section.nav > * {
101+
flex: auto 0 0;
116102
}
117103
118-
.collapse {
119-
.section-content {
120-
padding: 12px 0 40px 0;
121-
}
104+
section.nav a {
105+
display: inline-block;
106+
padding: 0 16px;
107+
height: 36px;
108+
line-height: 36px;
109+
color: white;
110+
background: color.scale(var.$primary-color, $lightness: 20%);
111+
border-radius: 3px;
112+
}
113+
114+
section.nav a:hover {
115+
background: color.scale(var.$primary-color, $lightness: 40%);
116+
}
117+
118+
section.nav a:not(:last-child) {
119+
margin-right: 8px;
120+
}
121+
122+
.collapse .section-content {
123+
padding: 12px 0 40px 0;
122124
}
123125
124126
h1 {
@@ -133,17 +135,17 @@ h2 {
133135
}
134136
135137
a {
136-
color: $primary-color;
138+
color: var.$primary-color;
137139
text-decoration: none;
138140
cursor: pointer;
141+
}
139142
140-
&:hover {
141-
color: lighten($primary-color, 10%);
142-
}
143+
a:hover {
144+
color: color.scale(var.$primary-color, $lightness: 20%);
143145
}
144146
145147
.command {
146-
background: darken($primary-color, 10%);
148+
background: color.scale(var.$primary-color, $lightness: -20%);
147149
color: white;
148150
font-family: monospace;
149151
max-width: 500px;
@@ -167,7 +169,7 @@ a {
167169
168170
.plus {
169171
text-align: center;
170-
color: $primary-color;
172+
color: var.$primary-color;
171173
font-size: 32px;
172174
margin: 12px;
173175
}
@@ -188,7 +190,7 @@ a {
188190
.more {
189191
font-size: 18px;
190192
text-align: center;
191-
background: lighten($primary-color, 45%);
193+
background: color.scale(var.$primary-color, $lightness: 85%);
192194
padding: 10px 0;
193195
}
194196
</style>

doc/components/CodeSnippet.vue

+28-24
Original file line numberDiff line numberDiff line change
@@ -46,39 +46,43 @@ export default {
4646

4747
<style lang="scss">
4848
.code-snippet {
49-
@include h-box;
49+
position: relative;
5050
background: white;
5151
border-radius: 3px;
5252
font-family: 'Roboto Mono', monospace;
5353
font-size: 10pt;
5454
overflow: auto;
55-
border-bottom: solid 2px $md-grey-300;
56-
border-right: solid 1px $md-grey-100;
57-
position: relative;
55+
border-bottom: solid 2px colors.$md-grey-300;
56+
border-right: solid 1px colors.$md-grey-100;
57+
display: flex;
5858

59-
.line-numbers,
60-
.render {
61-
padding: 32px 24px;
59+
& > * {
60+
flex: auto 0 0;
6261
}
62+
}
6363

64-
.line-numbers {
65-
background: $md-grey-200;
66-
color: $md-grey-400;
67-
border-radius: 2px 0 0 2px;
68-
}
64+
.code-snippet .line-numbers,
65+
.code-snippet .render {
66+
padding: 32px 24px;
67+
}
6968

70-
.render {
71-
white-space: pre;
72-
}
69+
.code-snippet .line-numbers {
70+
background: colors.$md-grey-200;
71+
color: colors.$md-grey-400;
72+
border-radius: 2px 0 0 2px;
73+
}
7374

74-
.language {
75-
position: absolute;
76-
top: 0;
77-
right: 0;
78-
background: $md-grey-200;
79-
color: $md-grey-400;
80-
padding: 4px 4px 6px 6px;
81-
border-radius: 0 0 0 2px;
82-
}
75+
.code-snippet .render {
76+
white-space: pre;
77+
}
78+
79+
.code-snippet .language {
80+
position: absolute;
81+
top: 0;
82+
right: 0;
83+
background: colors.$md-grey-200;
84+
color: colors.$md-grey-400;
85+
padding: 4px 4px 6px 6px;
86+
border-radius: 0 0 0 2px;
8387
}
8488
</style>

doc/style/imports.scss

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import './mixins';
2-
@import './vars';
3-
@import './md-colors';
1+
@use './mixins' as mix;
2+
@use './vars' as var;
3+
@use './md-colors' as colors;
44

doc/style/mixins.scss

+17-3
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,29 @@
1919

2020
@mixin flex-box {
2121
display: flex;
22-
22+
2323
& > * {
2424
flex: auto 0 0;
2525
}
2626
}
2727

2828
@mixin h-box {
29-
@include flex-box;
29+
display: flex;
30+
31+
& > * {
32+
flex: auto 0 0;
33+
}
34+
3035
flex-direction: row;
3136
}
3237

3338
@mixin v-box {
34-
@include flex-box;
39+
display: flex;
40+
41+
& > * {
42+
flex: auto 0 0;
43+
}
44+
3545
flex-direction: column;
3646
}
3747

@@ -44,6 +54,10 @@
4454
justify-content: center;
4555
}
4656

57+
@function fade($color, $amount) {
58+
@return color.adjust($color, $alpha: -$amount / 100%);
59+
}
60+
4761
@mixin toolbar-btn ($bg) {
4862
background: fade($bg, 80%);
4963
color: black;

docs/file-viewer/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
margin: 0;
66
width: 100%;
77
height: 100%;
8-
}</style><link href="static/css/chunk-vendors.053867c8.css" rel="preload" as="style"><link href="static/css/index.9ca6ae10.css" rel="preload" as="style"><link href="static/js/chunk-vendors.101c5e96.js" rel="preload" as="script"><link href="static/js/index.7bf4e2db.js" rel="preload" as="script"><link href="static/css/chunk-vendors.053867c8.css" rel="stylesheet"><link href="static/css/index.9ca6ae10.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but @zuiyouliao/vue-file-viewer doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="static/js/chunk-vendors.101c5e96.js"></script><script src="static/js/index.7bf4e2db.js"></script></body></html>
8+
}</style><link href="static/css/chunk-vendors.053867c8.css" rel="preload" as="style"><link href="static/css/index.e440bd1e.css" rel="preload" as="style"><link href="static/js/chunk-vendors.101c5e96.js" rel="preload" as="script"><link href="static/js/index.1ad61d03.js" rel="preload" as="script"><link href="static/css/chunk-vendors.053867c8.css" rel="stylesheet"><link href="static/css/index.e440bd1e.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but @zuiyouliao/vue-file-viewer doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="static/js/chunk-vendors.101c5e96.js"></script><script src="static/js/index.1ad61d03.js"></script></body></html>

public/file-viewer/static/css/index.9ca6ae10.css renamed to docs/file-viewer/static/css/index.6fa2d135.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/file-viewer/static/css/index.e440bd1e.css

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/file-viewer/static/js/index.1ad61d03.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/file-viewer/static/js/index.1ad61d03.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@zuiyouliao/vue-file-viewer",
3-
"version": "1.2.7",
3+
"version": "1.2.8",
44
"private": false,
55
"author": "zhanghan <[email protected]>",
66
"license": "MIT",
@@ -53,10 +53,10 @@
5353
"eslint-plugin-vue": "^7.20.0",
5454
"fs-extra": "^9.1.0",
5555
"highlight.js": "^9.17.1",
56-
"node-sass": "^4.14.1",
5756
"prettier": "^1.19.1",
5857
"prettier-eslint": "^9.0.1",
59-
"sass-loader": "^7.1.0",
58+
"sass": "^1.32.13",
59+
"sass-loader": "^10.1.1",
6060
"screenfull": "^5.0.0",
6161
"vue": "^2.6.14",
6262
"vue-router": "^3.1.3",

packages/index.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
}
140140
}
141141

142-
/deep/ .output > div {
142+
:deep(.output > div) {
143143
height: 100%;
144144
}
145145
}

public/file-viewer/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
margin: 0;
66
width: 100%;
77
height: 100%;
8-
}</style><link href="static/css/chunk-vendors.053867c8.css" rel="preload" as="style"><link href="static/css/index.9ca6ae10.css" rel="preload" as="style"><link href="static/js/chunk-vendors.101c5e96.js" rel="preload" as="script"><link href="static/js/index.7bf4e2db.js" rel="preload" as="script"><link href="static/css/chunk-vendors.053867c8.css" rel="stylesheet"><link href="static/css/index.9ca6ae10.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but @zuiyouliao/vue-file-viewer doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="static/js/chunk-vendors.101c5e96.js"></script><script src="static/js/index.7bf4e2db.js"></script></body></html>
8+
}</style><link href="static/css/chunk-vendors.053867c8.css" rel="preload" as="style"><link href="static/css/index.e440bd1e.css" rel="preload" as="style"><link href="static/js/chunk-vendors.101c5e96.js" rel="preload" as="script"><link href="static/js/index.1ad61d03.js" rel="preload" as="script"><link href="static/css/chunk-vendors.053867c8.css" rel="stylesheet"><link href="static/css/index.e440bd1e.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but @zuiyouliao/vue-file-viewer doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="static/js/chunk-vendors.101c5e96.js"></script><script src="static/js/index.1ad61d03.js"></script></body></html>

public/file-viewer/static/css/index.e440bd1e.css

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/file-viewer/static/js/index.1ad61d03.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/file-viewer/static/js/index.1ad61d03.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/file-viewer/static/js/index.7bf4e2db.js

-2
This file was deleted.

public/file-viewer/static/js/index.7bf4e2db.js.map

-1
This file was deleted.

public/file-viewer/static/js/pptx.worker.cda6b685.worker.js renamed to public/file-viewer/static/js/pptx.worker.3c5d3299.worker.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/file-viewer/static/js/pptx.worker.cda6b685.worker.js.map renamed to public/file-viewer/static/js/pptx.worker.3c5d3299.worker.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)