You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-2
Original file line number
Diff line number
Diff line change
@@ -247,12 +247,15 @@ export interface Options {
247
247
*/
248
248
hiddenDismissButton?:boolean
249
249
/**
250
+
* After version 1.2.0, you not need to set this option, it will be automatically detected from the base of vite config、publicPath of webpack config or publicPath of umi config
251
+
*
250
252
* Base public path for inject file, Valid values include:
251
253
* * Absolute URL pathname, e.g. /foo/
252
254
* * Full URL, e.g. https://foo.com/
253
255
* * Empty string(default) or ./
256
+
*
254
257
* !!! Don't forget / at the end of the path
255
-
*/
258
+
*/
256
259
injectFileBase?:string
257
260
}
258
261
@@ -301,7 +304,7 @@ export type LocaleData = Record<string, NotificationProps>
1. `TypeScript`intellisense, if you use`window.pluginWebUpdateNotice_.`。
305
308
306
309
```ts
307
310
// src/shim.d.ts
@@ -351,6 +354,7 @@ export type LocaleData = Record<string, NotificationProps>
351
354
})
352
355
```
353
356
357
+
> After version 1.2.0, in most case, you not need to set injectFileBase, it will be automatically detected from the base of vite config、publicPath of webpack config or publicPath of umi config
Copy file name to clipboardExpand all lines: README.zh-CN.md
+13-8
Original file line number
Diff line number
Diff line change
@@ -245,12 +245,15 @@ export interface Options {
245
245
*/
246
246
hiddenDismissButton?:boolean
247
247
/**
248
+
* After version 1.2.0, you not need to set this option, it will be automatically detected from the base of vite config、publicPath of webpack config or publicPath of umi config
249
+
*
248
250
* Base public path for inject file, Valid values include:
249
251
* * Absolute URL pathname, e.g. /foo/
250
252
* * Full URL, e.g. https://foo.com/
251
253
* * Empty string(default) or ./
254
+
*
252
255
* !!! Don't forget / at the end of the path
253
-
*/
256
+
*/
254
257
injectFileBase?:string
255
258
}
256
259
@@ -303,11 +306,11 @@ export type LocaleData = Record<string, NotificationProps>
303
306
304
307
```ts
305
308
// vite.config.ts
306
-
309
+
307
310
const prod =process.env.NODE_ENV==='production'
308
-
311
+
309
312
const cdnServerUrl ='https://foo.com/'
310
-
313
+
311
314
exportdefaultdefineConfig({
312
315
base: prod?cdnServerUrl:'/',
313
316
plugins: [
@@ -323,11 +326,11 @@ export type LocaleData = Record<string, NotificationProps>
323
326
324
327
```ts
325
328
// vite.config.ts
326
-
329
+
327
330
const prod =process.env.NODE_ENV==='production'
328
-
331
+
329
332
const base ='/folder/'// https://example.com/folder/
330
-
333
+
331
334
exportdefaultdefineConfig({
332
335
base,
333
336
plugins: [
@@ -339,6 +342,8 @@ export type LocaleData = Record<string, NotificationProps>
339
342
})
340
343
```
341
344
345
+
> After version 1.2.0, you not need to set this option, it will be automatically detected from the base of vite config、publicPath of webpack config or publicPath of umi config
346
+
342
347
3. 自定义 `notification` 的刷新和忽略按钮事件。
343
348
344
349
```ts
@@ -355,7 +360,7 @@ export type LocaleData = Record<string, NotificationProps>
Copy file name to clipboardExpand all lines: packages/core/src/type.ts
+4-1
Original file line number
Diff line number
Diff line change
@@ -49,12 +49,15 @@ export interface Options {
49
49
*/
50
50
hiddenDismissButton?: boolean
51
51
/**
52
+
* After version 1.2.0, you not need to set this option, it will be automatically detected from the base of vite config、publicPath of webpack config or publicPath of umi config
53
+
*
52
54
* Base public path for inject file, Valid values include:
0 commit comments