Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
749ddb6a
U
uni-app
项目概览
DCloud
/
uni-app
3 个月 前同步成功
通知
725
Star
38705
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
7
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
7
Issue
7
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
749ddb6a
编写于
12月 06, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: cdn
上级
c511dee9
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
35 addition
and
10 deletion
+35
-10
packages/uni-app-plus/dist/uni-app-service.es.js
packages/uni-app-plus/dist/uni-app-service.es.js
+5
-8
packages/uni-mp-alipay/dist/uni.compiler.js
packages/uni-mp-alipay/dist/uni.compiler.js
+1
-0
packages/uni-mp-alipay/src/compiler/options.ts
packages/uni-mp-alipay/src/compiler/options.ts
+1
-0
packages/uni-mp-baidu/dist/uni.compiler.js
packages/uni-mp-baidu/dist/uni.compiler.js
+1
-0
packages/uni-mp-baidu/src/compiler/options.ts
packages/uni-mp-baidu/src/compiler/options.ts
+1
-0
packages/uni-mp-kuaishou/dist/uni.compiler.js
packages/uni-mp-kuaishou/dist/uni.compiler.js
+1
-0
packages/uni-mp-kuaishou/src/compiler/options.ts
packages/uni-mp-kuaishou/src/compiler/options.ts
+1
-0
packages/uni-mp-lark/dist/uni.compiler.js
packages/uni-mp-lark/dist/uni.compiler.js
+2
-0
packages/uni-mp-lark/src/compiler/index.ts
packages/uni-mp-lark/src/compiler/index.ts
+2
-0
packages/uni-mp-qq/dist/uni.compiler.js
packages/uni-mp-qq/dist/uni.compiler.js
+1
-0
packages/uni-mp-qq/src/compiler/options.ts
packages/uni-mp-qq/src/compiler/options.ts
+1
-0
packages/uni-mp-toutiao/dist/uni.compiler.js
packages/uni-mp-toutiao/dist/uni.compiler.js
+1
-0
packages/uni-mp-toutiao/src/compiler/options.ts
packages/uni-mp-toutiao/src/compiler/options.ts
+1
-0
packages/uni-mp-vite/src/plugin/configResolved.ts
packages/uni-mp-vite/src/plugin/configResolved.ts
+11
-2
packages/uni-mp-vite/src/plugin/index.ts
packages/uni-mp-vite/src/plugin/index.ts
+1
-0
packages/uni-mp-weixin/dist/uni.compiler.js
packages/uni-mp-weixin/dist/uni.compiler.js
+1
-0
packages/uni-mp-weixin/src/compiler/options.ts
packages/uni-mp-weixin/src/compiler/options.ts
+1
-0
packages/uni-quickapp-webview/dist/uni.compiler.js
packages/uni-quickapp-webview/dist/uni.compiler.js
+1
-0
packages/uni-quickapp-webview/src/compiler/options.ts
packages/uni-quickapp-webview/src/compiler/options.ts
+1
-0
未找到文件。
packages/uni-app-plus/dist/uni-app-service.es.js
浏览文件 @
749ddb6a
...
@@ -16110,11 +16110,7 @@ var serviceContext = (function (vue) {
...
@@ -16110,11 +16110,7 @@ var serviceContext = (function (vue) {
type: 'loading',
type: 'loading',
icon: 'loading',
icon: 'loading',
}), callbacks), ShowLoadingProtocol, ShowLoadingOptions);
}), callbacks), ShowLoadingProtocol, ShowLoadingOptions);
const _showToast = ({ title = '', icon = 'success', image = '', duration = 1500, mask = false, position,
const _showToast = ({ title = '', icon = 'success', image = '', duration = 1500, mask = false, position, type = 'toast', style, }, { resolve, reject }) => {
// @ts-ignore ToastType
type = 'toast',
// @ts-ignore PlusNativeUIWaitingStyles
style, }, { resolve, reject }) => {
hide('');
hide('');
toastType = type;
toastType = type;
if (['top', 'center', 'bottom'].includes(String(position))) {
if (['top', 'center', 'bottom'].includes(String(position))) {
...
@@ -16171,9 +16167,10 @@ var serviceContext = (function (vue) {
...
@@ -16171,9 +16167,10 @@ var serviceContext = (function (vue) {
reject(`${error}`);
reject(`${error}`);
}
}
}
}
timeout = setTimeout(() => {
if (toastType === 'toast')
hide('');
timeout = setTimeout(() => {
}, duration);
hide('');
}, duration);
return resolve();
return resolve();
};
};
const showToast = defineAsyncApi(API_SHOW_TOAST, _showToast, ShowToastProtocol, ShowToastOptions);
const showToast = defineAsyncApi(API_SHOW_TOAST, _showToast, ShowToastProtocol, ShowToastOptions);
...
...
packages/uni-mp-alipay/dist/uni.compiler.js
浏览文件 @
749ddb6a
...
@@ -161,6 +161,7 @@ const customElements = [
...
@@ -161,6 +161,7 @@ const customElements = [
'
mkt
'
,
'
mkt
'
,
];
];
const
options
=
{
const
options
=
{
cdn
:
2
,
vite
:
{
vite
:
{
inject
:
{
inject
:
{
uni
:
[
path__default
[
"
default
"
].
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
uni
:
[
path__default
[
"
default
"
].
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
...
...
packages/uni-mp-alipay/src/compiler/options.ts
浏览文件 @
749ddb6a
...
@@ -53,6 +53,7 @@ export const customElements = [
...
@@ -53,6 +53,7 @@ export const customElements = [
]
]
export
const
options
:
UniMiniProgramPluginOptions
=
{
export
const
options
:
UniMiniProgramPluginOptions
=
{
cdn
:
2
,
vite
:
{
vite
:
{
inject
:
{
inject
:
{
uni
:
[
path
.
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
uni
:
[
path
.
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
...
...
packages/uni-mp-baidu/dist/uni.compiler.js
浏览文件 @
749ddb6a
...
@@ -87,6 +87,7 @@ const compilerOptions = {
...
@@ -87,6 +87,7 @@ const compilerOptions = {
};
};
const
projectConfigFilename
=
'
project.swan.json
'
;
const
projectConfigFilename
=
'
project.swan.json
'
;
const
options
=
{
const
options
=
{
cdn
:
3
,
vite
:
{
vite
:
{
inject
:
{
inject
:
{
uni
:
[
path__default
[
"
default
"
].
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
uni
:
[
path__default
[
"
default
"
].
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
...
...
packages/uni-mp-baidu/src/compiler/options.ts
浏览文件 @
749ddb6a
...
@@ -38,6 +38,7 @@ export const compilerOptions: CompilerOptions = {
...
@@ -38,6 +38,7 @@ export const compilerOptions: CompilerOptions = {
const
projectConfigFilename
=
'
project.swan.json
'
const
projectConfigFilename
=
'
project.swan.json
'
export
const
options
:
UniMiniProgramPluginOptions
=
{
export
const
options
:
UniMiniProgramPluginOptions
=
{
cdn
:
3
,
vite
:
{
vite
:
{
inject
:
{
inject
:
{
uni
:
[
path
.
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
uni
:
[
path
.
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
...
...
packages/uni-mp-kuaishou/dist/uni.compiler.js
浏览文件 @
749ddb6a
...
@@ -152,6 +152,7 @@ const miniProgram = {
...
@@ -152,6 +152,7 @@ const miniProgram = {
};
};
const
projectConfigFilename
=
'
project.config.json
'
;
const
projectConfigFilename
=
'
project.config.json
'
;
const
options
=
{
const
options
=
{
cdn
:
9
,
vite
:
{
vite
:
{
inject
:
{
inject
:
{
uni
:
[
path__default
[
"
default
"
].
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
uni
:
[
path__default
[
"
default
"
].
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
...
...
packages/uni-mp-kuaishou/src/compiler/options.ts
浏览文件 @
749ddb6a
...
@@ -38,6 +38,7 @@ export const miniProgram: MiniProgramCompilerOptions = {
...
@@ -38,6 +38,7 @@ export const miniProgram: MiniProgramCompilerOptions = {
const
projectConfigFilename
=
'
project.config.json
'
const
projectConfigFilename
=
'
project.config.json
'
export
const
options
:
UniMiniProgramPluginOptions
=
{
export
const
options
:
UniMiniProgramPluginOptions
=
{
cdn
:
9
,
vite
:
{
vite
:
{
inject
:
{
inject
:
{
uni
:
[
path
.
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
uni
:
[
path
.
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
...
...
packages/uni-mp-lark/dist/uni.compiler.js
浏览文件 @
749ddb6a
...
@@ -86,6 +86,7 @@ const miniProgram = {
...
@@ -86,6 +86,7 @@ const miniProgram = {
},
},
};
};
const
options
=
{
const
options
=
{
cdn
:
4
,
vite
:
{
vite
:
{
inject
:
{
inject
:
{
uni
:
[
path__default
[
"
default
"
].
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
uni
:
[
path__default
[
"
default
"
].
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
...
@@ -137,6 +138,7 @@ const uniMiniProgramToutiaoPlugin = {
...
@@ -137,6 +138,7 @@ const uniMiniProgramToutiaoPlugin = {
};
};
},
},
};
};
options
.
cdn
=
10
;
options
.
template
.
slot
.
fallbackContent
=
false
;
options
.
template
.
slot
.
fallbackContent
=
false
;
// 飞书不支持:
// 飞书不支持:
// <view tt:for="{{items}}" tt:for-item="item" tt:key="id" slot="{{item.slot}}">{{item.text}}</view>
// <view tt:for="{{items}}" tt:for-item="item" tt:key="id" slot="{{item.slot}}">{{item.text}}</view>
...
...
packages/uni-mp-lark/src/compiler/index.ts
浏览文件 @
749ddb6a
...
@@ -19,6 +19,8 @@ const uniMiniProgramToutiaoPlugin: Plugin = {
...
@@ -19,6 +19,8 @@ const uniMiniProgramToutiaoPlugin: Plugin = {
},
},
}
}
options
.
cdn
=
10
options
.
template
.
slot
.
fallbackContent
=
false
options
.
template
.
slot
.
fallbackContent
=
false
// 飞书不支持:
// 飞书不支持:
// <view tt:for="{{items}}" tt:for-item="item" tt:key="id" slot="{{item.slot}}">{{item.text}}</view>
// <view tt:for="{{items}}" tt:for-item="item" tt:key="id" slot="{{item.slot}}">{{item.text}}</view>
...
...
packages/uni-mp-qq/dist/uni.compiler.js
浏览文件 @
749ddb6a
...
@@ -104,6 +104,7 @@ const miniProgram = {
...
@@ -104,6 +104,7 @@ const miniProgram = {
},
},
};
};
const
options
=
{
const
options
=
{
cdn
:
5
,
vite
:
{
vite
:
{
inject
:
{
inject
:
{
uni
:
[
path__default
[
"
default
"
].
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
uni
:
[
path__default
[
"
default
"
].
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
...
...
packages/uni-mp-qq/src/compiler/options.ts
浏览文件 @
749ddb6a
...
@@ -36,6 +36,7 @@ export const miniProgram: MiniProgramCompilerOptions = {
...
@@ -36,6 +36,7 @@ export const miniProgram: MiniProgramCompilerOptions = {
}
}
export
const
options
:
UniMiniProgramPluginOptions
=
{
export
const
options
:
UniMiniProgramPluginOptions
=
{
cdn
:
5
,
vite
:
{
vite
:
{
inject
:
{
inject
:
{
uni
:
[
path
.
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
uni
:
[
path
.
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
...
...
packages/uni-mp-toutiao/dist/uni.compiler.js
浏览文件 @
749ddb6a
...
@@ -86,6 +86,7 @@ const miniProgram = {
...
@@ -86,6 +86,7 @@ const miniProgram = {
},
},
};
};
const
options
=
{
const
options
=
{
cdn
:
4
,
vite
:
{
vite
:
{
inject
:
{
inject
:
{
uni
:
[
path__default
[
"
default
"
].
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
uni
:
[
path__default
[
"
default
"
].
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
...
...
packages/uni-mp-toutiao/src/compiler/options.ts
浏览文件 @
749ddb6a
...
@@ -39,6 +39,7 @@ export const miniProgram: MiniProgramCompilerOptions = {
...
@@ -39,6 +39,7 @@ export const miniProgram: MiniProgramCompilerOptions = {
}
}
export
const
options
:
UniMiniProgramPluginOptions
=
{
export
const
options
:
UniMiniProgramPluginOptions
=
{
cdn
:
4
,
vite
:
{
vite
:
{
inject
:
{
inject
:
{
uni
:
[
path
.
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
uni
:
[
path
.
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
...
...
packages/uni-mp-vite/src/plugin/configResolved.ts
浏览文件 @
749ddb6a
...
@@ -23,11 +23,15 @@ import {
...
@@ -23,11 +23,15 @@ import {
const
debugNVueCss
=
debug
(
'
vite:uni:nvue-css
'
)
const
debugNVueCss
=
debug
(
'
vite:uni:nvue-css
'
)
const
cssVars
=
`page{--status-bar-height:25px;--top-window-height:0px;--window-top:0px;--window-bottom:0px;--window-left:0px;--window-right:0px;--window-magin:0px}`
const
cssVars
=
`page{--status-bar-height:25px;--top-window-height:0px;--window-top:0px;--window-bottom:0px;--window-left:0px;--window-right:0px;--window-magin:0px}`
const
shadowCss
=
`page::after{position:fixed;content:'';left:-1000px;top:-1000px;-webkit-animation:shadow-preload .1s;-webkit-animation-delay:3s;animation:shadow-preload .1s;animation-delay:3s}@-webkit-keyframes shadow-preload{0%{background-image:url(https://cdn.dcloud.net.cn/img/shadow-grey.png)}100%{background-image:url(https://cdn.dcloud.net.cn/img/shadow-grey.png)}}@keyframes shadow-preload{0%{background-image:url(https://cdn.dcloud.net.cn/img/shadow-grey.png)}100%{background-image:url(https://cdn.dcloud.net.cn/img/shadow-grey.png)}}`
const
genShadowCss
=
(
cdn
:
string
)
=>
{
return
`page::after{position:fixed;content:'';left:-1000px;top:-1000px;-webkit-animation:shadow-preload .1s;-webkit-animation-delay:3s;animation:shadow-preload .1s;animation-delay:3s}@-webkit-keyframes shadow-preload{0%{background-image:url(
${
cdn
}
/img/shadow-grey.png)}100%{background-image:url(
${
cdn
}
/img/shadow-grey.png)}}@keyframes shadow-preload{0%{background-image:url(
${
cdn
}
/img/shadow-grey.png)}100%{background-image:url(
${
cdn
}
/img/shadow-grey.png)}}`
}
const
genComponentCustomHiddenCss
=
(
name
:
string
)
=>
const
genComponentCustomHiddenCss
=
(
name
:
string
)
=>
`[
${
name
.
replace
(
'
:
'
,
''
)}
="true"]{display: none !important;}`
`[
${
name
.
replace
(
'
:
'
,
''
)}
="true"]{display: none !important;}`
export
function
createConfigResolved
({
export
function
createConfigResolved
({
cdn
,
style
:
{
extname
},
style
:
{
extname
},
template
:
{
component
},
template
:
{
component
},
}:
UniMiniProgramPluginOptions
):
Plugin
[
'
configResolved
'
]
{
}:
UniMiniProgramPluginOptions
):
Plugin
[
'
configResolved
'
]
{
...
@@ -63,7 +67,12 @@ export function createConfigResolved({
...
@@ -63,7 +67,12 @@ export function createConfigResolved({
genComponentCustomHiddenCss
(
component
.
vShow
))
||
genComponentCustomHiddenCss
(
component
.
vShow
))
||
''
''
if
(
config
.
isProduction
)
{
if
(
config
.
isProduction
)
{
return
cssCode
+
shadowCss
+
cssVars
+
componentCustomHiddenCss
return
(
cssCode
+
genShadowCss
(
`https://cdn
${
cdn
||
''
}
.dcloud.net.cn`
)
+
cssVars
+
componentCustomHiddenCss
)
}
else
{
}
else
{
return
cssCode
+
cssVars
+
componentCustomHiddenCss
return
cssCode
+
cssVars
+
componentCustomHiddenCss
}
}
...
...
packages/uni-mp-vite/src/plugin/index.ts
浏览文件 @
749ddb6a
...
@@ -24,6 +24,7 @@ import {
...
@@ -24,6 +24,7 @@ import {
}
from
'
@vue/compiler-sfc
'
}
from
'
@vue/compiler-sfc
'
export
interface
UniMiniProgramPluginOptions
{
export
interface
UniMiniProgramPluginOptions
{
cdn
?:
number
vite
:
{
vite
:
{
alias
:
AliasOptions
alias
:
AliasOptions
copyOptions
:
CopyOptions
copyOptions
:
CopyOptions
...
...
packages/uni-mp-weixin/dist/uni.compiler.js
浏览文件 @
749ddb6a
...
@@ -81,6 +81,7 @@ const miniProgram = {
...
@@ -81,6 +81,7 @@ const miniProgram = {
};
};
const
projectConfigFilename
=
'
project.config.json
'
;
const
projectConfigFilename
=
'
project.config.json
'
;
const
options
=
{
const
options
=
{
cdn
:
1
,
vite
:
{
vite
:
{
inject
:
{
inject
:
{
uni
:
[
path__default
[
"
default
"
].
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
uni
:
[
path__default
[
"
default
"
].
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
...
...
packages/uni-mp-weixin/src/compiler/options.ts
浏览文件 @
749ddb6a
...
@@ -37,6 +37,7 @@ export const miniProgram: MiniProgramCompilerOptions = {
...
@@ -37,6 +37,7 @@ export const miniProgram: MiniProgramCompilerOptions = {
const
projectConfigFilename
=
'
project.config.json
'
const
projectConfigFilename
=
'
project.config.json
'
export
const
options
:
UniMiniProgramPluginOptions
=
{
export
const
options
:
UniMiniProgramPluginOptions
=
{
cdn
:
1
,
vite
:
{
vite
:
{
inject
:
{
inject
:
{
uni
:
[
path
.
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
uni
:
[
path
.
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
...
...
packages/uni-quickapp-webview/dist/uni.compiler.js
浏览文件 @
749ddb6a
...
@@ -70,6 +70,7 @@ const miniProgram = {
...
@@ -70,6 +70,7 @@ const miniProgram = {
};
};
const
projectConfigFilename
=
'
jsconfig.json
'
;
const
projectConfigFilename
=
'
jsconfig.json
'
;
const
options
=
{
const
options
=
{
cdn
:
process
.
env
.
UNI_SUB_PLATFORM
===
'
quickapp-webview-huawei
'
?
200
:
201
,
vite
:
{
vite
:
{
inject
:
{
inject
:
{
uni
:
[
path__default
[
"
default
"
].
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
uni
:
[
path__default
[
"
default
"
].
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
...
...
packages/uni-quickapp-webview/src/compiler/options.ts
浏览文件 @
749ddb6a
...
@@ -28,6 +28,7 @@ export const miniProgram: MiniProgramCompilerOptions = {
...
@@ -28,6 +28,7 @@ export const miniProgram: MiniProgramCompilerOptions = {
const
projectConfigFilename
=
'
jsconfig.json
'
const
projectConfigFilename
=
'
jsconfig.json
'
export
const
options
:
UniMiniProgramPluginOptions
=
{
export
const
options
:
UniMiniProgramPluginOptions
=
{
cdn
:
process
.
env
.
UNI_SUB_PLATFORM
===
'
quickapp-webview-huawei
'
?
200
:
201
,
vite
:
{
vite
:
{
inject
:
{
inject
:
{
uni
:
[
path
.
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
uni
:
[
path
.
resolve
(
__dirname
,
'
uni.api.esm.js
'
),
'
default
'
],
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录