Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
陈庄旺
uni-app
提交
a8a51d3d
U
uni-app
项目概览
陈庄旺
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a8a51d3d
编写于
7月 09, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip(app): uni-app-plus
上级
2e759719
变更
35
展开全部
隐藏空白更改
内联
并排
Showing
35 changed file
with
5233 addition
and
1530 deletion
+5233
-1530
packages/uni-app-plus/build.json
packages/uni-app-plus/build.json
+38
-26
packages/uni-app-plus/dist/style.css
packages/uni-app-plus/dist/style.css
+375
-0
packages/uni-app-plus/dist/tools.umd.js
packages/uni-app-plus/dist/tools.umd.js
+124
-0
packages/uni-app-plus/dist/uni-app-service.es.js
packages/uni-app-plus/dist/uni-app-service.es.js
+342
-48
packages/uni-app-plus/dist/uni-app-view.umd.js
packages/uni-app-plus/dist/uni-app-view.umd.js
+4076
-965
packages/uni-app-plus/package.json
packages/uni-app-plus/package.json
+1
-3
packages/uni-app-plus/src/view/components/index.ts
packages/uni-app-plus/src/view/components/index.ts
+0
-1
packages/uni-app-plus/src/view/components/view.ts
packages/uni-app-plus/src/view/components/view.ts
+0
-4
packages/uni-app-plus/src/view/framework/dom/elements/UniElement.ts
...ni-app-plus/src/view/framework/dom/elements/UniElement.ts
+4
-4
packages/uni-app-plus/src/view/framework/dom/elements/UniNode.ts
...s/uni-app-plus/src/view/framework/dom/elements/UniNode.ts
+1
-1
packages/uni-app-plus/src/view/framework/dom/elements/UniViewElement.ts
...pp-plus/src/view/framework/dom/elements/UniViewElement.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/elements/components/UniButtonElement.ts
...iew/framework/dom/elements/components/UniButtonElement.ts
+58
-0
packages/uni-app-plus/src/view/framework/dom/elements/components/index.ts
...-plus/src/view/framework/dom/elements/components/index.ts
+40
-0
packages/uni-app-plus/src/view/framework/dom/elements/index.ts
...ges/uni-app-plus/src/view/framework/dom/elements/index.ts
+22
-1
packages/uni-app-plus/src/view/framework/dom/elements/modules/events.ts
...pp-plus/src/view/framework/dom/elements/modules/events.ts
+2
-2
packages/uni-app-plus/src/view/framework/dom/elements/utils.ts
...ges/uni-app-plus/src/view/framework/dom/elements/utils.ts
+0
-32
packages/uni-app-plus/src/view/index.ts
packages/uni-app-plus/src/view/index.ts
+17
-3
packages/uni-app-plus/src/view/ready.ts
packages/uni-app-plus/src/view/ready.ts
+0
-14
packages/uni-app-plus/style/framework/base.css
packages/uni-app-plus/style/framework/base.css
+54
-0
packages/uni-app-plus/vite.config.ts
packages/uni-app-plus/vite.config.ts
+15
-1
packages/uni-app-vue/dist/service.runtime.esm.js
packages/uni-app-vue/dist/service.runtime.esm.js
+12
-9
packages/uni-app/dist/uni-app.cjs.js
packages/uni-app/dist/uni-app.cjs.js
+0
-42
packages/uni-app/dist/uni-app.es.js
packages/uni-app/dist/uni-app.es.js
+1
-43
packages/uni-core/src/helpers/page.ts
packages/uni-core/src/helpers/page.ts
+4
-0
packages/uni-mp-alipay/dist/uni.mp.esm.js
packages/uni-mp-alipay/dist/uni.mp.esm.js
+1
-43
packages/uni-mp-baidu/dist/uni.mp.esm.js
packages/uni-mp-baidu/dist/uni.mp.esm.js
+1
-43
packages/uni-mp-qq/dist/uni.mp.esm.js
packages/uni-mp-qq/dist/uni.mp.esm.js
+1
-43
packages/uni-mp-toutiao/dist/uni.mp.esm.js
packages/uni-mp-toutiao/dist/uni.mp.esm.js
+1
-43
packages/uni-mp-vue/dist/vue.runtime.esm.js
packages/uni-mp-vue/dist/vue.runtime.esm.js
+1
-43
packages/uni-mp-weixin/dist/uni.mp.esm.js
packages/uni-mp-weixin/dist/uni.mp.esm.js
+1
-43
packages/uni-quickapp-webview/dist/uni.mp.esm.js
packages/uni-quickapp-webview/dist/uni.mp.esm.js
+1
-43
packages/uni-shared/dist/uni-shared.cjs.js
packages/uni-shared/dist/uni-shared.cjs.js
+11
-8
packages/uni-shared/dist/uni-shared.es.js
packages/uni-shared/dist/uni-shared.es.js
+11
-8
packages/uni-shared/src/vdom/encode.ts
packages/uni-shared/src/vdom/encode.ts
+14
-13
packages/vite-plugin-uni/src/vue/options.ts
packages/vite-plugin-uni/src/vue/options.ts
+2
-0
未找到文件。
packages/uni-app-plus/build.json
浏览文件 @
a8a51d3d
{
"input"
:
{
"src/service/index.ts"
:
"dist/uni-app-service.es.js"
[
{
"input"
:
{
"src/service/index.ts"
:
"dist/uni-app-service.es.js"
},
"output"
:
{
"name"
:
"serviceContext"
,
"format"
:
"iife"
,
"banner"
:
"export function createServiceContext(Vue,weex, plus,instanceContext){
\n
const setTimeout = instanceContext.setTimeout;
\n
const clearTimeout = instanceContext.clearTimeout;
\n
const setInterval = instanceContext.setInterval;
\n
const clearInterval = instanceContext.clearInterval;
\n
const __uniConfig = instanceContext.__uniConfig;
\n
const __uniRoutes = instanceContext.__uniRoutes;
\n
"
,
"footer"
:
"const uni = serviceContext.uni;
\n
const getApp = serviceContext.getApp;
\n
const getCurrentPages = serviceContext.getCurrentPages;
\n
const UniServiceJSBridge = serviceContext.UniServiceJSBridge;
\n
return serviceContext;
\n
}"
,
"globals"
:
{
"vue"
:
"Vue"
}
},
"replacements"
:
{
"__PLATFORM__"
:
"'app'"
,
"__VUE_OPTIONS_API__"
:
"true"
,
"__VUE_PROD_DEVTOOLS__"
:
"false"
,
"__UNI_FEATURE_WX__"
:
"true"
,
"__UNI_FEATURE_PROMISE__"
:
"false"
,
"__UNI_FEATURE_I18N_EN__"
:
"true"
,
"__UNI_FEATURE_I18N_ES__"
:
"true"
,
"__UNI_FEATURE_I18N_FR__"
:
"true"
,
"__UNI_FEATURE_I18N_ZH_HANS__"
:
"true"
,
"__UNI_FEATURE_I18N_ZH_HANT__"
:
"true"
},
"external"
:
[
"vue"
]
},
"output"
:
{
"name"
:
"serviceContext"
,
"format"
:
"iife"
,
"banner"
:
"export function createServiceContext(Vue,weex, plus,instanceContext){
\n
const setTimeout = instanceContext.setTimeout;
\n
const clearTimeout = instanceContext.clearTimeout;
\n
const setInterval = instanceContext.setInterval;
\n
const clearInterval = instanceContext.clearInterval;
\n
const __uniConfig = instanceContext.__uniConfig;
\n
const __uniRoutes = instanceContext.__uniRoutes;
\n
"
,
"footer"
:
"const uni = serviceContext.uni;
\n
const getApp = serviceContext.getApp;
\n
const getCurrentPages = serviceContext.getCurrentPages;
\n
const UniServiceJSBridge = serviceContext.UniServiceJSBridge;
\n
return serviceContext;
\n
}"
,
"globals"
:
{
"vue"
:
"Vue"
}
},
"replacements"
:
{
"__PLATFORM__"
:
"'app'"
,
"__VUE_OPTIONS_API__"
:
"true"
,
"__VUE_PROD_DEVTOOLS__"
:
"false"
,
"__UNI_FEATURE_WX__"
:
"true"
,
"__UNI_FEATURE_PROMISE__"
:
"false"
,
"__UNI_FEATURE_I18N_EN__"
:
"true"
,
"__UNI_FEATURE_I18N_ES__"
:
"true"
,
"__UNI_FEATURE_I18N_FR__"
:
"true"
,
"__UNI_FEATURE_I18N_ZH_HANS__"
:
"true"
,
"__UNI_FEATURE_I18N_ZH_HANT__"
:
"true"
},
"external"
:
[
"vue"
]
}
{
"input"
:
{
"src/service/framework/dom/decodeActions.ts"
:
"dist/tools.umd.js"
},
"output"
:
{
"name"
:
"Tools"
,
"format"
:
"umd"
},
"external"
:
false
}
]
packages/uni-app-plus/dist/style.css
浏览文件 @
a8a51d3d
*
{
margin
:
0
;
-webkit-tap-highlight-color
:
rgba
(
0
,
0
,
0
,
0
);
-webkit-tap-highlight-color
:
transparent
;
}
html
,
body
{
-webkit-user-select
:
none
;
user-select
:
none
;
width
:
100%
;
}
html
{
height
:
100%
;
height
:
100vh
;
width
:
100%
;
width
:
100vw
;
}
body
{
overflow-x
:
hidden
;
background-color
:
white
;
}
input
[
type
=
'search'
]
::-webkit-search-cancel-button
{
display
:
none
;
}
.uni-loading
,
uni-button
[
loading
]
:before
{
background
:
transparent
url('data:image/svg+xml;base64, PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=')
no-repeat
;
}
.uni-loading
{
width
:
20px
;
height
:
20px
;
display
:
inline-block
;
vertical-align
:
middle
;
animation
:
uni-loading
1s
steps
(
12
,
end
)
infinite
;
background-size
:
100%
;
}
@keyframes
uni-loading
{
0
%
{
transform
:
rotate3d
(
0
,
0
,
1
,
0deg
);
}
100
%
{
transform
:
rotate3d
(
0
,
0
,
1
,
360deg
);
}
}
[
nvue
]
uni-view
,
[
nvue
]
uni-label
,
[
nvue
]
uni-swiper-item
,
[
nvue
]
uni-scroll-view
{
display
:
flex
;
flex-shrink
:
0
;
flex-grow
:
0
;
flex-basis
:
auto
;
align-items
:
stretch
;
align-content
:
flex-start
;
}
[
nvue
]
uni-button
{
margin
:
0
;
}
[
nvue-dir-row
]
uni-view
,
[
nvue-dir-row
]
uni-label
,
[
nvue-dir-row
]
uni-swiper-item
{
flex-direction
:
row
;
}
[
nvue-dir-column
]
uni-view
,
[
nvue-dir-column
]
uni-label
,
[
nvue-dir-column
]
uni-swiper-item
{
flex-direction
:
column
;
}
[
nvue-dir-row-reverse
]
uni-view
,
[
nvue-dir-row-reverse
]
uni-label
,
[
nvue-dir-row-reverse
]
uni-swiper-item
{
flex-direction
:
row-reverse
;
}
[
nvue-dir-column-reverse
]
uni-view
,
[
nvue-dir-column-reverse
]
uni-label
,
[
nvue-dir-column-reverse
]
uni-swiper-item
{
flex-direction
:
column-reverse
;
}
[
nvue
]
uni-view
,
[
nvue
]
uni-image
,
[
nvue
]
uni-input
,
[
nvue
]
uni-scroll-view
,
[
nvue
]
uni-swiper
,
[
nvue
]
uni-swiper-item
,
[
nvue
]
uni-text
,
[
nvue
]
uni-textarea
,
[
nvue
]
uni-video
{
position
:
relative
;
border
:
0px
solid
#000000
;
box-sizing
:
border-box
;
}
[
nvue
]
uni-swiper-item
{
position
:
absolute
;
}
uni-view
{
display
:
block
;
}
uni-view
[
hidden
]
{
display
:
none
;
}
uni-button
{
position
:
relative
;
display
:
block
;
margin-left
:
auto
;
margin-right
:
auto
;
padding-left
:
14px
;
padding-right
:
14px
;
box-sizing
:
border-box
;
font-size
:
18px
;
text-align
:
center
;
text-decoration
:
none
;
line-height
:
2.55555556
;
border-radius
:
5px
;
-webkit-tap-highlight-color
:
transparent
;
overflow
:
hidden
;
color
:
#000000
;
background-color
:
#f8f8f8
;
cursor
:
pointer
;
}
uni-button
[
hidden
]
{
display
:
none
!important
;
}
uni-button
:after
{
content
:
' '
;
width
:
200%
;
height
:
200%
;
position
:
absolute
;
top
:
0
;
left
:
0
;
border
:
1px
solid
rgba
(
0
,
0
,
0
,
0.2
);
transform
:
scale
(
0.5
);
transform-origin
:
0
0
;
box-sizing
:
border-box
;
border-radius
:
10px
;
}
uni-button
[
native
]
{
padding-left
:
0
;
padding-right
:
0
;
}
uni-button
[
native
]
.uni-button-cover-view-wrapper
{
border
:
inherit
;
border-color
:
inherit
;
border-radius
:
inherit
;
background-color
:
inherit
;
}
uni-button
[
native
]
.uni-button-cover-view-inner
{
padding-left
:
14px
;
padding-right
:
14px
;
}
uni-button
uni-cover-view
{
line-height
:
inherit
;
white-space
:
inherit
;
}
uni-button
[
type
=
'default'
]
{
color
:
#000000
;
background-color
:
#f8f8f8
;
}
uni-button
[
type
=
'primary'
]
{
color
:
#ffffff
;
background-color
:
#007aff
;
}
uni-button
[
type
=
'warn'
]
{
color
:
#ffffff
;
background-color
:
#e64340
;
}
uni-button
[
disabled
]
{
color
:
rgba
(
255
,
255
,
255
,
0.6
);
cursor
:
not-allowed
;
}
uni-button
[
disabled
][
type
=
'default'
],
uni-button
[
disabled
]
:not
([
type
])
{
color
:
rgba
(
0
,
0
,
0
,
0.3
);
background-color
:
#f7f7f7
;
}
uni-button
[
disabled
][
type
=
'primary'
]
{
background-color
:
rgba
(
0
,
122
,
255
,
0.6
);
}
uni-button
[
disabled
][
type
=
'warn'
]
{
background-color
:
#ec8b89
;
}
uni-button
[
type
=
'primary'
][
plain
]
{
color
:
#007aff
;
border
:
1px
solid
#007aff
;
background-color
:
transparent
;
}
uni-button
[
type
=
'primary'
][
plain
][
disabled
]
{
color
:
rgba
(
0
,
0
,
0
,
0.2
);
border-color
:
rgba
(
0
,
0
,
0
,
0.2
);
}
uni-button
[
type
=
'primary'
][
plain
]
:after
{
border-width
:
0
;
}
uni-button
[
type
=
'default'
][
plain
]
{
color
:
#353535
;
border
:
1px
solid
#353535
;
background-color
:
transparent
;
}
uni-button
[
type
=
'default'
][
plain
][
disabled
]
{
color
:
rgba
(
0
,
0
,
0
,
0.2
);
border-color
:
rgba
(
0
,
0
,
0
,
0.2
);
}
uni-button
[
type
=
'default'
][
plain
]
:after
{
border-width
:
0
;
}
uni-button
[
plain
]
{
color
:
#353535
;
border
:
1px
solid
#353535
;
background-color
:
transparent
;
}
uni-button
[
plain
][
disabled
]
{
color
:
rgba
(
0
,
0
,
0
,
0.2
);
border-color
:
rgba
(
0
,
0
,
0
,
0.2
);
}
uni-button
[
plain
]
:after
{
border-width
:
0
;
}
uni-button
[
plain
][
native
]
.uni-button-cover-view-inner
{
padding
:
0
;
}
uni-button
[
type
=
'warn'
][
plain
]
{
color
:
#e64340
;
border
:
1px
solid
#e64340
;
background-color
:
transparent
;
}
uni-button
[
type
=
'warn'
][
plain
][
disabled
]
{
color
:
rgba
(
0
,
0
,
0
,
0.2
);
border-color
:
rgba
(
0
,
0
,
0
,
0.2
);
}
uni-button
[
type
=
'warn'
][
plain
]
:after
{
border-width
:
0
;
}
uni-button
[
size
=
'mini'
]
{
display
:
inline-block
;
line-height
:
2.3
;
font-size
:
13px
;
padding
:
0
1.34em
;
}
uni-button
[
size
=
'mini'
][
native
]
{
padding
:
0
;
}
uni-button
[
size
=
'mini'
][
native
]
.uni-button-cover-view-inner
{
padding
:
0
1.34em
;
}
uni-button
[
loading
]
:not
([
disabled
])
{
cursor
:
progress
;
}
uni-button
[
loading
]
:before
{
content
:
' '
;
display
:
inline-block
;
width
:
18px
;
height
:
18px
;
vertical-align
:
middle
;
animation
:
uni-loading
1s
steps
(
12
,
end
)
infinite
;
background-size
:
100%
;
}
uni-button
[
loading
][
type
=
'primary'
]
{
color
:
rgba
(
255
,
255
,
255
,
0.6
);
background-color
:
#0062cc
;
}
uni-button
[
loading
][
type
=
'primary'
][
plain
]
{
color
:
#007aff
;
background-color
:
transparent
;
}
uni-button
[
loading
][
type
=
'default'
]
{
color
:
rgba
(
0
,
0
,
0
,
0.6
);
background-color
:
#dedede
;
}
uni-button
[
loading
][
type
=
'default'
][
plain
]
{
color
:
#353535
;
background-color
:
transparent
;
}
uni-button
[
loading
][
type
=
'warn'
]
{
color
:
rgba
(
255
,
255
,
255
,
0.6
);
background-color
:
#ce3c39
;
}
uni-button
[
loading
][
type
=
'warn'
][
plain
]
{
color
:
#e64340
;
background-color
:
transparent
;
}
uni-button
[
loading
][
native
]
:before
{
content
:
none
;
}
.button-hover
{
color
:
rgba
(
0
,
0
,
0
,
0.6
);
background-color
:
#dedede
;
}
.button-hover
[
plain
]
{
color
:
rgba
(
53
,
53
,
53
,
0.6
);
border-color
:
rgba
(
53
,
53
,
53
,
0.6
);
background-color
:
transparent
;
}
.button-hover
[
type
=
'primary'
]
{
color
:
rgba
(
255
,
255
,
255
,
0.6
);
background-color
:
#0062cc
;
}
.button-hover
[
type
=
'primary'
][
plain
]
{
color
:
rgba
(
26
,
173
,
25
,
0.6
);
border-color
:
rgba
(
26
,
173
,
25
,
0.6
);
background-color
:
transparent
;
}
.button-hover
[
type
=
'default'
]
{
color
:
rgba
(
0
,
0
,
0
,
0.6
);
background-color
:
#dedede
;
}
.button-hover
[
type
=
'default'
][
plain
]
{
color
:
rgba
(
53
,
53
,
53
,
0.6
);
border-color
:
rgba
(
53
,
53
,
53
,
0.6
);
background-color
:
transparent
;
}
.button-hover
[
type
=
'warn'
]
{
color
:
rgba
(
255
,
255
,
255
,
0.6
);
background-color
:
#ce3c39
;
}
.button-hover
[
type
=
'warn'
][
plain
]
{
color
:
rgba
(
230
,
67
,
64
,
0.6
);
border-color
:
rgba
(
230
,
67
,
64
,
0.6
);
background-color
:
transparent
;
}
packages/uni-app-plus/dist/tools.umd.js
0 → 100644
浏览文件 @
a8a51d3d
(
function
(
window
,
factory
)
{
typeof
exports
===
'
object
'
&&
typeof
module
!==
'
undefined
'
?
factory
(
exports
)
:
typeof
define
===
'
function
'
&&
define
.
amd
?
define
([
'
exports
'
],
factory
)
:
(
global
=
typeof
globalThis
!==
'
undefined
'
?
globalThis
:
window
||
self
,
factory
(
window
.
Tools
=
{}));
}(
this
,
(
function
(
exports
)
{
'
use strict
'
;
const
COMPONENT_MAP
=
{
VIEW
:
1
,
IMAGE
:
2
,
TEXT
:
3
,
'
#text
'
:
4
,
'
#comment
'
:
5
,
NAVIGATOR
:
6
,
FORM
:
7
,
BUTTON
:
8
,
INPUT
:
9
,
LABEL
:
10
,
RADIO
:
11
,
CHECKBOX
:
12
,
'
CHECKBOX-GROUP
'
:
13
,
AD
:
14
,
AUDIO
:
15
,
CAMERA
:
16
,
CANVAS
:
17
,
'
COVER-IMAGE
'
:
18
,
'
COVER-VIEW
'
:
19
,
EDITOR
:
20
,
'
FUNCTIONAL-PAGE-NAVIGATOR
'
:
21
,
ICON
:
22
,
'
RADIO-GROUP
'
:
23
,
'
LIVE-PLAYER
'
:
24
,
'
LIVE-PUSHER
'
:
25
,
MAP
:
26
,
'
MOVABLE-AREA
'
:
27
,
'
MOVABLE-VIEW
'
:
28
,
'
OFFICIAL-ACCOUNT
'
:
29
,
'
OPEN-DATA
'
:
30
,
PICKER
:
31
,
'
PICKER-VIEW
'
:
32
,
'
PICKER-VIEW-COLUMN
'
:
33
,
PROGRESS
:
34
,
'
RICH-TEXT
'
:
35
,
'
SCROLL-VIEW
'
:
36
,
SLIDER
:
37
,
SWIPER
:
38
,
'
SWIPER-ITEM
'
:
39
,
SWITCH
:
40
,
TEXTAREA
:
41
,
VIDEO
:
42
,
'
WEB-VIEW
'
:
43
,
};
function
decodeArrMap
(
objMap
)
{
return
Object
.
keys
(
objMap
).
reduce
((
arr
,
name
)
=>
{
arr
.
push
(
name
.
toLowerCase
());
return
arr
;
},
[
''
]);
}
const
DECODED_COMPONENT_ARR
=
/*#__PURE__*/
decodeArrMap
(
COMPONENT_MAP
);
function
decodeTag
(
tag
)
{
return
(
DECODED_COMPONENT_ARR
[
tag
]
||
tag
);
}
const
ACTION_TYPE_PAGE_CREATE
=
1
;
const
ACTION_TYPE_PAGE_CREATED
=
2
;
const
ACTION_TYPE_CREATE
=
3
;
const
ACTION_TYPE_INSERT
=
4
;
const
ACTION_TYPE_REMOVE
=
5
;
const
ACTION_TYPE_SET_ATTRIBUTE
=
6
;
const
ACTION_TYPE_REMOVE_ATTRIBUTE
=
7
;
const
ACTION_TYPE_SET_TEXT
=
8
;
function
decodePageCreateAction
([,
pageCreateData
])
{
return
[
'
pageCreate
'
,
pageCreateData
];
}
function
decodePageCreatedAction
([])
{
return
[
'
pageCreated
'
];
}
function
decodeCreateAction
([,
nodeId
,
nodeName
])
{
return
[
'
create
'
,
nodeId
,
decodeTag
(
nodeName
)];
}
function
decodeInsertAction
([,
...
action
])
{
return
[
'
insert
'
,
...
action
];
}
function
decodeRemoveAction
([,
...
action
])
{
return
[
'
remove
'
,
...
action
];
}
function
decodeSetAttributeAction
([,
...
action
])
{
return
[
'
setAttr
'
,
...
action
];
}
function
decodeRemoveAttributeAction
([,
...
action
])
{
return
[
'
removeAttr
'
,
...
action
];
}
function
decodeSetTextAction
([,
...
action
])
{
return
[
'
setText
'
,
action
];
}
function
decodeActions
(
actions
)
{
return
actions
.
map
((
action
)
=>
{
switch
(
action
[
0
])
{
case
ACTION_TYPE_PAGE_CREATE
:
return
decodePageCreateAction
(
action
);
case
ACTION_TYPE_PAGE_CREATED
:
return
decodePageCreatedAction
(
action
);
case
ACTION_TYPE_CREATE
:
return
decodeCreateAction
(
action
);
case
ACTION_TYPE_INSERT
:
return
decodeInsertAction
(
action
);
case
ACTION_TYPE_REMOVE
:
return
decodeRemoveAction
(
action
);
case
ACTION_TYPE_SET_ATTRIBUTE
:
return
decodeSetAttributeAction
(
action
);
case
ACTION_TYPE_REMOVE_ATTRIBUTE
:
return
decodeRemoveAttributeAction
(
action
);
case
ACTION_TYPE_SET_TEXT
:
return
decodeSetTextAction
(
action
);
}
return
action
;
});
}
exports
.
decodeActions
=
decodeActions
;
Object
.
defineProperty
(
exports
,
'
__esModule
'
,
{
value
:
true
});
})));
packages/uni-app-plus/dist/uni-app-service.es.js
浏览文件 @
a8a51d3d
...
...
@@ -141,6 +141,8 @@ var serviceContext = (function (vue) {
*/
const
capitalize
=
cacheStringFunction$1
((
str
)
=>
str
.
charAt
(
0
).
toUpperCase
()
+
str
.
slice
(
1
));
const
CHOOSE_SIZE_TYPES
=
[
'
original
'
,
'
compressed
'
];
const
CHOOSE_SOURCE_TYPES
=
[
'
album
'
,
'
camera
'
];
const
HTTP_METHODS
=
[
'
GET
'
,
'
OPTIONS
'
,
...
...
@@ -157,6 +159,14 @@ var serviceContext = (function (vue) {
}
return
str
;
}
function
elemsInArray
(
strArr
,
optionalVal
)
{
if
(
!
isArray
(
strArr
)
||
strArr
.
length
===
0
||
strArr
.
find
((
val
)
=>
optionalVal
.
indexOf
(
val
)
===
-
1
))
{
return
optionalVal
;
}
return
strArr
;
}
function
validateProtocolFail
(
name
,
msg
)
{
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
}
...
...
@@ -774,48 +784,6 @@ var serviceContext = (function (vue) {
}
return
[
hyphenate
(
name
.
slice
(
2
)),
options
];
}
const
EVENT_MAP
=
{
onClick
:
'
.e0
'
,
onChange
:
'
.e1
'
,
onInput
:
'
.e2
'
,
onLoad
:
'
.e3
'
,
onError
:
'
.e4
'
,
onTouchstart
:
'
.e5
'
,
onTouchmove
:
'
.e6
'
,
onTouchcancel
:
'
.e7
'
,
onTouchend
:
'
.e8
'
,
onLongpress
:
'
.e9
'
,
onTransitionend
:
'
.ea
'
,
onAnimationstart
:
'
.eb
'
,
onAnimationiteration
:
'
.ec
'
,
onAnimationend
:
'
.ed
'
,
onTouchforcechange
:
'
.ee
'
,
};
const
OPTIONS
=
[
'
Capture
'
,
'
CaptureOnce
'
,
'
CapturePassive
'
,
'
CaptureOncePassive
'
,
'
Once
'
,
'
OncePassive
'
,
'
Passive
'
,
];
const
BASE_ATTR_MAP
=
{
class
:
'
.c
'
,
style
:
'
.s
'
,
'
hover-class
'
:
'
.h0
'
,
'
hover-stop-propagation
'
:
'
.h1
'
,
'
hover-start-time
'
:
'
.h2
'
,
'
hover-stay-time
'
:
'
.h3
'
,
};
/*#__PURE__*/
extend
(
BASE_ATTR_MAP
,
Object
.
keys
(
EVENT_MAP
).
reduce
((
res
,
name
)
=>
{
const
value
=
EVENT_MAP
[
name
];
res
[
name
]
=
value
;
OPTIONS
.
forEach
((
v
,
i
)
=>
{
res
[
name
+
v
]
=
value
+
i
;
});
return
res
;
},
Object
.
create
(
null
)));
const
COMPONENT_MAP
=
{
VIEW
:
1
,
IMAGE
:
2
,
...
...
@@ -1444,6 +1412,44 @@ var serviceContext = (function (vue) {
}));
}
});
const
initI18nChooseVideoMsgsOnce
=
/*#__PURE__*/
once
(()
=>
{
const
name
=
'
uni.chooseVideo.
'
;
{
useI18n
().
add
(
LOCALE_EN
,
normalizeMessages
(
name
,
{
cancel
:
'
Cancel
'
,
'
sourceType.album
'
:
'
Album
'
,
'
sourceType.camera
'
:
'
Camera
'
,
}));
}
{
useI18n
().
add
(
LOCALE_ES
,
normalizeMessages
(
name
,
{
cancel
:
'
Cancelar
'
,
'
sourceType.album
'
:
'
Álbum
'
,
'
sourceType.camera
'
:
'
Cámara
'
,
}));
}
{
useI18n
().
add
(
LOCALE_FR
,
normalizeMessages
(
name
,
{
cancel
:
'
Annuler
'
,
'
sourceType.album
'
:
'
Album
'
,
'
sourceType.camera
'
:
'
Caméra
'
,
}));
}
{
useI18n
().
add
(
LOCALE_ZH_HANS
,
normalizeMessages
(
name
,
{
cancel
:
'
取消
'
,
'
sourceType.album
'
:
'
从相册选择
'
,
'
sourceType.camera
'
:
'
拍摄
'
,
}));
}
{
useI18n
().
add
(
LOCALE_ZH_HANT
,
normalizeMessages
(
name
,
{
cancel
:
'
取消
'
,
'
sourceType.album
'
:
'
從相冊選擇
'
,
'
sourceType.camera
'
:
'
拍攝
'
,
}));
}
});
const
initI18nStartSoterAuthenticationMsgsOnce
=
/*#__PURE__*/
once
(()
=>
{
const
name
=
'
uni.startSoterAuthentication.
'
;
{
...
...
@@ -2168,6 +2174,62 @@ var serviceContext = (function (vue) {
altitude
:
Boolean
,
};
const
API_CHOOSE_IMAGE
=
'
chooseImage
'
;
const
ChooseImageOptions
=
{
formatArgs
:
{
count
(
value
,
params
)
{
if
(
!
value
||
value
<=
0
)
{
params
.
count
=
9
;
}
},
sizeType
(
sizeType
,
params
)
{
params
.
sizeType
=
elemsInArray
(
sizeType
,
CHOOSE_SIZE_TYPES
);
},
sourceType
(
sourceType
,
params
)
{
params
.
sourceType
=
elemsInArray
(
sourceType
,
CHOOSE_SOURCE_TYPES
);
},
extension
(
extension
,
params
)
{
if
(
extension
instanceof
Array
&&
extension
.
length
===
0
)
{
return
'
param extension should not be empty.
'
;
}
if
(
!
extension
)
params
.
extension
=
[
''
];
},
},
};
const
ChooseImageProtocol
=
{
count
:
Number
,
sizeType
:
[
Array
,
String
],
sourceType
:
Array
,
extension
:
Array
,
};
const
API_CHOOSE_VIDEO
=
'
chooseVideo
'
;
const
ChooseVideoOptions
=
{
formatArgs
:
{
sourceType
(
sourceType
,
params
)
{
params
.
sourceType
=
elemsInArray
(
sourceType
,
CHOOSE_SOURCE_TYPES
);
},
compressed
:
true
,
maxDuration
:
60
,
camera
:
'
back
'
,
extension
(
extension
,
params
)
{
if
(
extension
instanceof
Array
&&
extension
.
length
===
0
)
{
return
'
param extension should not be empty.
'
;
}
if
(
!
extension
)
params
.
extension
=
[
''
];
},
},
};
const
ChooseVideoProtocol
=
{
sourceType
:
Array
,
compressed
:
Boolean
,
maxDuration
:
Number
,
camera
:
String
,
extension
:
Array
,
};
const
API_GET_IMAGE_INFO
=
'
getImageInfo
'
;
const
GetImageInfoOptions
=
{
formatArgs
:
{
...
...
@@ -3119,7 +3181,7 @@ var serviceContext = (function (vue) {
resolve
(
getStorageInfoSync
());
}));
const
getFileInfo
=
defineAsyncApi
(
API_GET_FILE_INFO
,
(
options
,
{
resolve
,
reject
})
=>
{
const
getFileInfo
$1
=
defineAsyncApi
(
API_GET_FILE_INFO
,
(
options
,
{
resolve
,
reject
})
=>
{
plus
.
io
.
getFileInfo
(
extend
(
options
,
{
success
:
warpPlusSuccessCallback
(
resolve
),
fail
:
warpPlusErrorCallback
(
reject
),
...
...
@@ -3899,7 +3961,7 @@ var serviceContext = (function (vue) {
return
array
[
array
.
length
-
1
];
}
const
compressImage
=
defineAsyncApi
(
API_COMPRESS_IMAGE
,
(
options
,
{
resolve
,
reject
})
=>
{
const
compressImage
$1
=
defineAsyncApi
(
API_COMPRESS_IMAGE
,
(
options
,
{
resolve
,
reject
})
=>
{
const
dst
=
`
${
TEMP_PATH
}
/compressed/
${
Date
.
now
()}
_
${
getFileName
(
options
.
src
)}
`
;
plus
.
zip
.
compressImage
(
extend
({},
options
,
{
dst
,
...
...
@@ -3921,6 +3983,236 @@ var serviceContext = (function (vue) {
},
reject
);
},
CompressVideoProtocol
,
CompressVideoOptions
);
/**
* 获取文件信息
* @param {string} filePath 文件路径
* @returns {Promise} 文件信息Promise
*/
function
getFileInfo
(
filePath
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
plus
.
io
.
resolveLocalFileSystemURL
(
filePath
,
function
(
entry
)
{
entry
.
getMetadata
(
resolve
,
reject
,
false
);
},
reject
);
});
}
function
compressImage
(
tempFilePath
)
{
const
dst
=
`
${
TEMP_PATH
}
/compressed/
${
Date
.
now
()}
_
${
getFileName
(
tempFilePath
)}
`
;
return
new
Promise
((
resolve
)
=>
{
plus
.
nativeUI
.
showWaiting
();
plus
.
zip
.
compressImage
({
src
:
tempFilePath
,
dst
,
overwrite
:
true
,
},
()
=>
{
plus
.
nativeUI
.
closeWaiting
();
resolve
(
dst
);
},
()
=>
{
plus
.
nativeUI
.
closeWaiting
();
resolve
(
tempFilePath
);
});
});
}
const
chooseImage
=
defineAsyncApi
(
API_CHOOSE_IMAGE
,
// @ts-ignore crop 属性App特有
({
count
,
sizeType
,
sourceType
,
crop
}
=
{},
{
resolve
,
reject
})
=>
{
initI18nChooseImageMsgsOnce
();
const
{
t
}
=
useI18n
();
const
errorCallback
=
warpPlusErrorCallback
(
reject
);
function
successCallback
(
paths
)
{
const
tempFiles
=
[];
const
tempFilePaths
=
[];
// plus.zip.compressImage 压缩文件并发调用在iOS端容易出现问题(图像错误、闪退),改为队列执行
paths
.
reduce
((
promise
,
path
)
=>
{
return
promise
.
then
(()
=>
{
return
getFileInfo
(
path
);
})
.
then
((
fileInfo
)
=>
{
const
size
=
fileInfo
.
size
;
// 压缩阈值 0.5 兆
const
THRESHOLD
=
1024
*
1024
*
0.5
;
// 判断是否需要压缩
if
(
!
crop
&&
sizeType
.
includes
(
'
compressed
'
)
&&
size
>
THRESHOLD
)
{
return
compressImage
(
path
).
then
((
dstPath
)
=>
{
path
=
dstPath
;
return
getFileInfo
(
path
);
});
}
return
fileInfo
;
})
.
then
(({
size
})
=>
{
tempFilePaths
.
push
(
path
);
tempFiles
.
push
({
path
,
size
:
size
,
});
});
},
Promise
.
resolve
())
.
then
(()
=>
{
resolve
({
tempFilePaths
,
tempFiles
,
});
})
.
catch
(
errorCallback
);
}
function
openCamera
()
{
const
camera
=
plus
.
camera
.
getCamera
();
camera
.
captureImage
((
path
)
=>
successCallback
([
path
]),
errorCallback
,
{
filename
:
TEMP_PATH
+
'
/camera/
'
,
resolution
:
'
high
'
,
crop
,
});
}
function
openAlbum
()
{
// NOTE 5+此API分单选和多选,多选返回files:string[]
// @ts-ignore
plus
.
gallery
.
pick
(({
files
})
=>
successCallback
(
files
),
errorCallback
,
{
maximum
:
count
,
multiple
:
true
,
system
:
false
,
filename
:
TEMP_PATH
+
'
/gallery/
'
,
permissionAlert
:
true
,
crop
,
});
}
if
(
sourceType
.
length
===
1
)
{
if
(
sourceType
.
includes
(
'
album
'
))
{
openAlbum
();
return
;
}
else
if
(
sourceType
.
includes
(
'
camera
'
))
{
openCamera
();
return
;
}
}
plus
.
nativeUI
.
actionSheet
({
cancel
:
t
(
'
uni.chooseImage.cancel
'
),
buttons
:
[
{
title
:
t
(
'
uni.chooseImage.sourceType.camera
'
),
},
{
title
:
t
(
'
uni.chooseImage.sourceType.album
'
),
},
],
},
(
e
)
=>
{
switch
(
e
.
index
)
{
case
1
:
openCamera
();
break
;
case
2
:
openAlbum
();
break
;
default
:
errorCallback
();
break
;
}
});
},
ChooseImageProtocol
,
ChooseImageOptions
);
const
chooseVideo
=
defineAsyncApi
(
API_CHOOSE_VIDEO
,
({
sourceType
,
compressed
,
maxDuration
,
camera
},
{
resolve
,
reject
})
=>
{
initI18nChooseVideoMsgsOnce
();
const
{
t
}
=
useI18n
();
const
errorCallback
=
warpPlusErrorCallback
(
reject
);
function
successCallback
(
tempFilePath
=
''
)
{
const
filename
=
`
${
TEMP_PATH
}
/compressed/
${
Date
.
now
()}
_
${
getFileName
(
tempFilePath
)}
`
;
const
compressVideo
=
compressed
?
new
Promise
((
resolve
)
=>
{
plus
.
zip
.
compressVideo
({
src
:
tempFilePath
,
filename
,
},
({
tempFilePath
})
=>
{
resolve
(
tempFilePath
);
},
()
=>
{
resolve
(
tempFilePath
);
});
})
:
Promise
.
resolve
(
tempFilePath
);
if
(
compressed
)
{
plus
.
nativeUI
.
showWaiting
();
}
compressVideo
.
then
((
tempFilePath
)
=>
{
if
(
compressed
)
{
plus
.
nativeUI
.
closeWaiting
();
}
plus
.
io
.
getVideoInfo
({
filePath
:
tempFilePath
,
success
(
videoInfo
)
{
const
result
=
{
errMsg
:
'
chooseVideo:ok
'
,
tempFilePath
:
tempFilePath
,
size
:
videoInfo
.
size
,
duration
:
videoInfo
.
duration
,
width
:
videoInfo
.
width
,
height
:
videoInfo
.
height
,
};
resolve
(
result
);
},
fail
:
errorCallback
,
});
});
}
function
openAlbum
()
{
plus
.
gallery
.
pick
(
// NOTE 5+此API分单选和多选,多选返回files:string[]
// @ts-ignore
({
files
})
=>
successCallback
(
files
[
0
]),
errorCallback
,
{
filter
:
'
video
'
,
system
:
false
,
// 不启用 multiple 时 system 无效
multiple
:
true
,
maximum
:
1
,
filename
:
TEMP_PATH
+
'
/gallery/
'
,
permissionAlert
:
true
,
});
}
function
openCamera
()
{
const
plusCamera
=
plus
.
camera
.
getCamera
();
plusCamera
.
startVideoCapture
(
successCallback
,
errorCallback
,
{
index
:
camera
===
'
front
'
?
'
2
'
:
'
1
'
,
videoMaximumDuration
:
maxDuration
,
filename
:
TEMP_PATH
+
'
/camera/
'
,
});
}
if
(
sourceType
.
length
===
1
)
{
if
(
sourceType
.
includes
(
'
album
'
))
{
openAlbum
();
return
;
}
else
if
(
sourceType
.
includes
(
'
camera
'
))
{
openCamera
();
return
;
}
}
plus
.
nativeUI
.
actionSheet
({
cancel
:
t
(
'
uni.chooseVideo.cancel
'
),
buttons
:
[
{
title
:
t
(
'
uni.chooseVideo.sourceType.camera
'
),
},
{
title
:
t
(
'
uni.chooseVideo.sourceType.album
'
),
},
],
},
(
e
)
=>
{
switch
(
e
.
index
)
{
case
1
:
openCamera
();
break
;
case
2
:
openAlbum
();
break
;
default
:
errorCallback
();
break
;
}
});
},
ChooseVideoProtocol
,
ChooseVideoOptions
);
const
showKeyboard
=
defineAsyncApi
(
API_SHOW_KEYBOARD
,
(
_
,
{
resolve
})
=>
{
plus
.
key
.
showSoftKeybord
();
resolve
();
...
...
@@ -4483,7 +4775,7 @@ var serviceContext = (function (vue) {
audio
.
__timing
=
setInterval
(()
=>
{
const
currentTime
=
audio
.
currentTime
;
if
(
currentTime
!==
oldCurrentTime
)
{
emit
(
audio
,
'
time
u
pdate
'
);
emit
(
audio
,
'
time
U
pdate
'
);
}
},
200
);
}
...
...
@@ -4623,7 +4915,7 @@ var serviceContext = (function (vue) {
});
});
function
emit
(
audio
,
state
,
errMsg
,
errCode
)
{
const
name
=
`on
${
state
[
0
].
toUpperCase
()
+
state
.
substr
(
1
)}
`
;
const
name
=
`on
${
capitalize
(
state
)}
`
;
audio
.
_callbacks
[
name
].
forEach
((
callback
)
=>
{
if
(
typeof
callback
===
'
function
'
)
{
callback
(
state
===
'
error
'
...
...
@@ -7338,7 +7630,7 @@ var serviceContext = (function (vue) {
clearStorage
:
clearStorage
,
getStorageInfoSync
:
getStorageInfoSync
,
getStorageInfo
:
getStorageInfo
,
getFileInfo
:
getFileInfo
,
getFileInfo
:
getFileInfo
$1
,
openDocument
:
openDocument
,
onCompassChange
:
onCompassChange
,
offCompassChange
:
offCompassChange
,
...
...
@@ -7391,8 +7683,10 @@ var serviceContext = (function (vue) {
getRecorderManager
:
getRecorderManager
,
saveVideoToPhotosAlbum
:
saveVideoToPhotosAlbum
,
saveImageToPhotosAlbum
:
saveImageToPhotosAlbum
,
compressImage
:
compressImage
,
compressImage
:
compressImage
$1
,
compressVideo
:
compressVideo
,
chooseImage
:
chooseImage
,
chooseVideo
:
chooseVideo
,
showKeyboard
:
showKeyboard
,
hideKeyboard
:
hideKeyboard
,
downloadFile
:
downloadFile
,
...
...
packages/uni-app-plus/dist/uni-app-view.umd.js
浏览文件 @
a8a51d3d
此差异已折叠。
点击以展开。
packages/uni-app-plus/package.json
浏览文件 @
a8a51d3d
...
...
@@ -17,9 +17,7 @@
"url"
:
"https://github.com/dcloudio/uni-app/issues"
},
"dependencies"
:
{
"@webcomponents/custom-elements"
:
"^1.4.3"
,
"vue"
:
"^3.1.4"
,
"vue3-webcomponent-wrapper"
:
"^0.1.4"
"vue"
:
"^3.1.4"
},
"gitHead"
:
"56deaeb47d42e924d10282d7af418ccee6b139bf"
}
packages/uni-app-plus/src/view/components/index.ts
已删除
100644 → 0
浏览文件 @
2e759719
export
*
from
'
./view
'
packages/uni-app-plus/src/view/components/view.ts
已删除
100644 → 0
浏览文件 @
2e759719
import
'
@dcloudio/uni-components/style/view.css
'
export
function
View
()
{
return
document
.
createElement
(
'
uni-view
'
)
}
packages/uni-app-plus/src/view/framework/dom/elements/UniElement.ts
浏览文件 @
a8a51d3d
...
...
@@ -2,16 +2,16 @@ import { hasOwn } from '@vue/shared'
import
{
decodeAttr
,
UniNodeJSON
}
from
'
@dcloudio/uni-shared
'
import
{
UniNode
}
from
'
./UniNode
'
import
{
UniCustomElement
}
from
'
./utils
'
import
{
patchClass
}
from
'
./modules/class
'
import
{
patchStyle
}
from
'
./modules/style
'
import
{
patchEvent
}
from
'
./modules/events
'
import
{
UniCustomElement
}
from
'
./components
'
export
class
UniElement
extends
UniNode
{
$
:
UniCustomElement
constructor
(
id
:
number
,
tag
:
string
)
{
super
(
id
,
tag
)
this
.
$
=
document
.
createElement
(
tag
)
as
unknown
as
UniCustomElement
constructor
(
id
:
number
,
element
:
Element
)
{
super
(
id
,
element
.
tagName
)
this
.
$
=
element
as
UniCustomElement
this
.
$
.
__id
=
id
this
.
$
.
__listeners
=
Object
.
create
(
null
)
}
...
...
packages/uni-app-plus/src/view/framework/dom/elements/UniNode.ts
浏览文件 @
a8a51d3d
import
{
hasOwn
}
from
'
@vue/shared
'
import
{
UniNodeJSON
}
from
'
@dcloudio/uni-shared
'
import
{
$
}
from
'
.
/utils
'
import
{
$
}
from
'
.
'
export
class
UniNode
{
id
:
number
...
...
packages/uni-app-plus/src/view/framework/dom/elements/UniViewElement.ts
浏览文件 @
a8a51d3d
import
'
@dcloudio/uni-components/style/view.css
'
import
{
UniHoverElement
}
from
'
./UniHoverElement
'
export
class
UniViewElement
extends
UniHoverElement
{
constructor
(
id
:
number
)
{
super
(
id
,
'
uni-view
'
)
super
(
id
,
document
.
createElement
(
'
uni-view
'
)
)
}
}
packages/uni-app-plus/src/view/framework/dom/elements/components/UniButtonElement.ts
0 → 100644
浏览文件 @
a8a51d3d
import
'
@dcloudio/uni-components/style/button.css
'
import
{
hasOwn
}
from
'
@vue/shared
'
import
{
Button
}
from
'
@dcloudio/uni-components
'
import
{
createApp
,
reactive
,
watch
}
from
'
vue
'
import
{
createWrapper
}
from
'
.
'
import
{
decodeAttr
,
formatLog
,
parseEventName
,
UniNodeJSON
,
}
from
'
@dcloudio/uni-shared
'
import
{
UniNode
}
from
'
../UniNode
'
import
{
createInvoker
}
from
'
../modules/events
'
const
UniButton
=
createWrapper
(
Button
)
export
class
UniButtonElement
extends
UniNode
{
private
$props
!
:
Record
<
string
,
any
>
constructor
(
id
:
number
)
{
super
(
id
,
'
uni-button
'
)
}
init
(
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
const
container
=
document
.
createElement
(
'
div
'
)
this
.
$props
=
reactive
({})
const
{
a
}
=
nodeJson
if
(
a
)
{
Object
.
keys
(
a
).
forEach
((
n
)
=>
{
this
.
setAttr
(
n
,
a
[
n
])
})
}
const
vm
=
createApp
(
UniButton
,
{
attrs
:
this
.
$props
}).
mount
(
container
)
this
.
$
=
container
.
firstElementChild
!
if
(
hasOwn
(
nodeJson
,
'
t
'
))
{
this
.
$
.
textContent
=
nodeJson
.
t
||
''
}
watch
(
this
.
$props
,
()
=>
{
if
(
__DEV__
)
{
console
.
log
(
formatLog
(
this
.
tag
,
'
props
'
,
'
forceUpdate
'
))
}
vm
.
$forceUpdate
()
})
}
setAttr
(
name
:
string
,
value
:
unknown
)
{
const
decoded
=
decodeAttr
(
name
)
if
(
name
.
indexOf
(
'
.e
'
)
===
0
)
{
this
.
$props
[
decoded
]
=
createInvoker
(
this
.
id
,
value
as
number
,
parseEventName
(
decoded
)[
1
]
)
}
else
{
this
.
$props
[
decoded
]
=
value
}
}
removeAttr
(
name
:
string
)
{
this
.
$props
[
decodeAttr
(
name
)]
=
null
}
}
packages/uni-app-plus/src/view/framework/dom/elements/components/index.ts
0 → 100644
浏览文件 @
a8a51d3d
import
{
defineComponent
,
h
,
reactive
}
from
'
vue
'
import
{
UniComment
}
from
'
../UniComment
'
import
{
UniText
}
from
'
../UniText
'
import
{
UniViewElement
}
from
'
../UniViewElement
'
import
{
UniButtonElement
}
from
'
./UniButtonElement
'
export
interface
UniCustomElement
extends
Element
{
__id
:
number
__listeners
:
Record
<
string
,
(
evt
:
Event
)
=>
void
>
}
const
BuiltInComponents
=
[
,
UniViewElement
,
,
,
UniText
,
UniComment
,
,
,
UniButtonElement
,
]
export
function
createBuiltInComponent
(
type
:
number
,
id
:
number
)
{
return
new
BuiltInComponents
[
type
]
!
(
id
)
}
export
function
createWrapper
(
component
:
ReturnType
<
typeof
defineComponent
>
)
{
return
defineComponent
({
props
:
[
'
attrs
'
],
data
()
{
return
{
props
:
this
.
attrs
,
}
},
render
()
{
return
h
(
component
,
this
.
props
)
},
})
}
packages/uni-app-plus/src/view/framework/dom/elements/index.ts
浏览文件 @
a8a51d3d
export
*
from
'
./utils
'
import
{
isString
}
from
'
@vue/shared
'
import
{
createBuiltInComponent
}
from
'
./components
'
import
{
UniElement
}
from
'
./UniElement
'
import
{
UniText
}
from
'
./UniText
'
const
elements
=
new
Map
<
number
,
UniElement
|
UniText
>
()
export
function
$
(
id
:
number
)
{
return
elements
.
get
(
id
)
as
UniElement
}
export
function
createElement
(
id
:
number
,
tag
:
string
|
number
)
{
let
element
:
UniElement
|
UniText
if
(
isString
(
tag
))
{
element
=
new
UniElement
(
id
,
document
.
createElement
(
tag
))
}
else
{
element
=
createBuiltInComponent
(
tag
,
id
)
}
elements
.
set
(
id
,
element
)
return
element
}
packages/uni-app-plus/src/view/framework/dom/elements/modules/events.ts
浏览文件 @
a8a51d3d
...
...
@@ -9,7 +9,7 @@ import {
}
from
'
@dcloudio/uni-shared
'
import
{
VD_SYNC
}
from
'
../../../../../constants
'
import
{
ACTION_TYPE_EVENT
}
from
'
../../../../../PageAction
'
import
{
UniCustomElement
}
from
'
../
util
s
'
import
{
UniCustomElement
}
from
'
../
component
s
'
export
function
patchEvent
(
el
:
UniCustomElement
,
name
:
string
,
flag
:
number
)
{
const
[
type
,
options
]
=
parseEventName
(
decodeAttr
(
name
))
...
...
@@ -43,7 +43,7 @@ export function patchEvent(el: UniCustomElement, name: string, flag: number) {
}
}
function
createInvoker
(
export
function
createInvoker
(
id
:
number
,
flag
:
number
,
options
?:
AddEventListenerOptions
...
...
packages/uni-app-plus/src/view/framework/dom/elements/utils.ts
已删除
100644 → 0
浏览文件 @
2e759719
import
{
isString
}
from
'
@vue/shared
'
import
{
UniComment
}
from
'
./UniComment
'
import
{
UniElement
}
from
'
./UniElement
'
import
{
UniText
}
from
'
./UniText
'
import
{
UniViewElement
}
from
'
./UniViewElement
'
export
interface
UniCustomElement
extends
Element
{
__id
:
number
__listeners
:
Record
<
string
,
(
evt
:
Event
)
=>
void
>
}
const
elements
=
new
Map
<
number
,
UniElement
|
UniText
>
()
const
UniBuiltInComponents
=
[,
UniViewElement
,
,
,
UniText
,
UniComment
]
function
createUniComponent
(
type
:
number
,
id
:
number
)
{
return
new
UniBuiltInComponents
[
type
]
!
(
id
)
}
export
function
$
(
id
:
number
)
{
return
elements
.
get
(
id
)
as
UniElement
}
export
function
createElement
(
id
:
number
,
tag
:
string
|
number
)
{
let
element
:
UniElement
|
UniText
if
(
isString
(
tag
))
{
element
=
new
UniElement
(
id
,
tag
)
}
else
{
element
=
createUniComponent
(
tag
,
id
)
}
elements
.
set
(
id
,
element
)
return
element
}
packages/uni-app-plus/src/view/index.ts
浏览文件 @
a8a51d3d
import
'
@webcomponents/custom-elements
'
import
'
./components
'
import
'
./ready
'
import
'
../../style/framework/base.css
'
import
'
@dcloudio/uni-h5/style/framework/nvue.css
'
import
{
ON_WEBVIEW_READY
}
from
'
../constants
'
import
{
UniViewJSBridge
}
from
'
./bridge
'
import
{
initView
}
from
'
./framework
'
;(
window
as
any
).
UniViewJSBridge
=
UniViewJSBridge
function
onWebviewReady
()
{
initView
()
UniViewJSBridge
.
publishHandler
(
ON_WEBVIEW_READY
)
}
if
(
typeof
plus
!==
'
undefined
'
)
{
onWebviewReady
()
}
else
{
document
.
addEventListener
(
'
plusready
'
,
onWebviewReady
)
}
packages/uni-app-plus/src/view/ready.ts
已删除
100644 → 0
浏览文件 @
2e759719
import
{
ON_WEBVIEW_READY
}
from
'
../constants
'
import
{
UniViewJSBridge
}
from
'
./bridge
'
import
{
initView
}
from
'
./framework
'
;(
window
as
any
).
UniViewJSBridge
=
UniViewJSBridge
function
onWebviewReady
()
{
initView
()
UniViewJSBridge
.
publishHandler
(
ON_WEBVIEW_READY
)
}
if
(
typeof
plus
!==
'
undefined
'
)
{
onWebviewReady
()
}
else
{
document
.
addEventListener
(
'
plusready
'
,
onWebviewReady
)
}
packages/uni-app-plus/style/framework/base.css
0 → 100644
浏览文件 @
a8a51d3d
*
{
margin
:
0
;
-webkit-tap-highlight-color
:
rgba
(
0
,
0
,
0
,
0
);
-webkit-tap-highlight-color
:
transparent
;
}
html
,
body
{
-webkit-user-select
:
none
;
user-select
:
none
;
width
:
100%
;
}
html
{
height
:
100%
;
height
:
100vh
;
width
:
100%
;
width
:
100vw
;
}
body
{
overflow-x
:
hidden
;
background-color
:
white
;
}
input
[
type
=
'search'
]
::-webkit-search-cancel-button
{
display
:
none
;
}
.uni-loading
,
uni-button
[
loading
]
:before
{
background
:
transparent
url('data:image/svg+xml;base64, PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=')
no-repeat
;
}
.uni-loading
{
width
:
20px
;
height
:
20px
;
display
:
inline-block
;
vertical-align
:
middle
;
animation
:
uni-loading
1s
steps
(
12
,
end
)
infinite
;
background-size
:
100%
;
}
@keyframes
uni-loading
{
0
%
{
transform
:
rotate3d
(
0
,
0
,
1
,
0deg
);
}
100
%
{
transform
:
rotate3d
(
0
,
0
,
1
,
360deg
);
}
}
packages/uni-app-plus/vite.config.ts
浏览文件 @
a8a51d3d
...
...
@@ -42,8 +42,13 @@ export default defineConfig({
global
:
'
window
'
,
__DEV__
:
true
,
__TEST__
:
false
,
__PLATFORM__
:
JSON
.
stringify
(
'
h5
'
),
__PLATFORM__
:
JSON
.
stringify
(
'
app
'
),
__NODE_JS__
:
false
,
__UNI_FEATURE_I18N_EN__
:
true
,
__UNI_FEATURE_I18N_ES__
:
true
,
__UNI_FEATURE_I18N_FR__
:
true
,
__UNI_FEATURE_I18N_ZH_HANS__
:
true
,
__UNI_FEATURE_I18N_ZH_HANT__
:
true
,
},
resolve
:
{
alias
:
[
...
...
@@ -77,6 +82,15 @@ export default defineConfig({
},
],
},
css
:
{
postcss
:
{
plugins
:
[
require
(
'
autoprefixer
'
)({
overrideBrowserslist
:
[
'
Android > 4.4
'
,
'
iOS >= 10
'
],
}),
],
},
},
plugins
:
[
vue
({
template
:
{
...
...
packages/uni-app-vue/dist/service.runtime.esm.js
浏览文件 @
a8a51d3d
...
...
@@ -416,15 +416,18 @@ export default function vueFactory(exports) {
'
hover-stop-propagation
'
:
'
.h1
'
,
'
hover-start-time
'
:
'
.h2
'
,
'
hover-stay-time
'
:
'
.h3
'
};
var
ATTR_MAP
=
/*#__PURE__*/
extend$1
(
BASE_ATTR_MAP
,
Object
.
keys
(
EVENT_MAP
).
reduce
(
function
(
res
,
name
)
{
var
value
=
EVENT_MAP
[
name
];
res
[
name
]
=
value
;
OPTIONS
.
forEach
(
function
(
v
,
i
)
{
res
[
name
+
v
]
=
value
+
i
;
});
return
res
;
},
Object
.
create
(
null
)));
};
// 该代码会单独编译成一个decode js,用于开发时测试,故尽可能独立,不使用 @vue/shared 的 extend
var
ATTR_MAP
=
/*#__PURE__*/
function
()
{
return
Object
.
assign
(
BASE_ATTR_MAP
,
Object
.
keys
(
EVENT_MAP
).
reduce
(
function
(
res
,
name
)
{
var
value
=
EVENT_MAP
[
name
];
res
[
name
]
=
value
;
OPTIONS
.
forEach
(
function
(
v
,
i
)
{
res
[
name
+
v
]
=
value
+
i
;
});
return
res
;
},
Object
.
create
(
null
)));
}();
function
encodeAttr
(
name
)
{
return
ATTR_MAP
[
name
]
||
name
;
...
...
packages/uni-app/dist/uni-app.cjs.js
浏览文件 @
a8a51d3d
...
...
@@ -5,48 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
var
vue
=
require
(
'
vue
'
);
var
shared
=
require
(
'
@vue/shared
'
);
const
EVENT_MAP
=
{
onClick
:
'
.e0
'
,
onChange
:
'
.e1
'
,
onInput
:
'
.e2
'
,
onLoad
:
'
.e3
'
,
onError
:
'
.e4
'
,
onTouchstart
:
'
.e5
'
,
onTouchmove
:
'
.e6
'
,
onTouchcancel
:
'
.e7
'
,
onTouchend
:
'
.e8
'
,
onLongpress
:
'
.e9
'
,
onTransitionend
:
'
.ea
'
,
onAnimationstart
:
'
.eb
'
,
onAnimationiteration
:
'
.ec
'
,
onAnimationend
:
'
.ed
'
,
onTouchforcechange
:
'
.ee
'
,
};
const
OPTIONS
=
[
'
Capture
'
,
'
CaptureOnce
'
,
'
CapturePassive
'
,
'
CaptureOncePassive
'
,
'
Once
'
,
'
OncePassive
'
,
'
Passive
'
,
];
const
BASE_ATTR_MAP
=
{
class
:
'
.c
'
,
style
:
'
.s
'
,
'
hover-class
'
:
'
.h0
'
,
'
hover-stop-propagation
'
:
'
.h1
'
,
'
hover-start-time
'
:
'
.h2
'
,
'
hover-stay-time
'
:
'
.h3
'
,
};
/*#__PURE__*/
shared
.
extend
(
BASE_ATTR_MAP
,
Object
.
keys
(
EVENT_MAP
).
reduce
((
res
,
name
)
=>
{
const
value
=
EVENT_MAP
[
name
];
res
[
name
]
=
value
;
OPTIONS
.
forEach
((
v
,
i
)
=>
{
res
[
name
+
v
]
=
value
+
i
;
});
return
res
;
},
Object
.
create
(
null
)));
const
sanitise
=
(
val
)
=>
(
val
&&
JSON
.
parse
(
JSON
.
stringify
(
val
)))
||
val
;
const
UNI_SSR
=
'
__uniSSR
'
;
const
UNI_SSR_DATA
=
'
data
'
;
...
...
packages/uni-app/dist/uni-app.es.js
浏览文件 @
a8a51d3d
import
{
shallowRef
,
ref
,
getCurrentInstance
,
isInSSRComponentSetup
,
injectHook
}
from
'
vue
'
;
import
{
extend
,
hasOwn
,
isString
}
from
'
@vue/shared
'
;
import
{
hasOwn
,
isString
}
from
'
@vue/shared
'
;
const
EVENT_MAP
=
{
onClick
:
'
.e0
'
,
onChange
:
'
.e1
'
,
onInput
:
'
.e2
'
,
onLoad
:
'
.e3
'
,
onError
:
'
.e4
'
,
onTouchstart
:
'
.e5
'
,
onTouchmove
:
'
.e6
'
,
onTouchcancel
:
'
.e7
'
,
onTouchend
:
'
.e8
'
,
onLongpress
:
'
.e9
'
,
onTransitionend
:
'
.ea
'
,
onAnimationstart
:
'
.eb
'
,
onAnimationiteration
:
'
.ec
'
,
onAnimationend
:
'
.ed
'
,
onTouchforcechange
:
'
.ee
'
,
};
const
OPTIONS
=
[
'
Capture
'
,
'
CaptureOnce
'
,
'
CapturePassive
'
,
'
CaptureOncePassive
'
,
'
Once
'
,
'
OncePassive
'
,
'
Passive
'
,
];
const
BASE_ATTR_MAP
=
{
class
:
'
.c
'
,
style
:
'
.s
'
,
'
hover-class
'
:
'
.h0
'
,
'
hover-stop-propagation
'
:
'
.h1
'
,
'
hover-start-time
'
:
'
.h2
'
,
'
hover-stay-time
'
:
'
.h3
'
,
};
/*#__PURE__*/
extend
(
BASE_ATTR_MAP
,
Object
.
keys
(
EVENT_MAP
).
reduce
((
res
,
name
)
=>
{
const
value
=
EVENT_MAP
[
name
];
res
[
name
]
=
value
;
OPTIONS
.
forEach
((
v
,
i
)
=>
{
res
[
name
+
v
]
=
value
+
i
;
});
return
res
;
},
Object
.
create
(
null
)));
const
sanitise
=
(
val
)
=>
(
val
&&
JSON
.
parse
(
JSON
.
stringify
(
val
)))
||
val
;
const
UNI_SSR
=
'
__uniSSR
'
;
const
UNI_SSR_DATA
=
'
data
'
;
...
...
packages/uni-core/src/helpers/page.ts
浏览文件 @
a8a51d3d
...
...
@@ -3,6 +3,10 @@ import { ComponentPublicInstance, getCurrentInstance } from 'vue'
import
{
rpx2px
}
from
'
./util
'
export
function
useCurrentPageId
()
{
if
(
__PLATFORM__
===
'
app
'
)
{
// view 层
return
parseInt
((
window
as
any
).
__id__
)
}
return
getCurrentInstance
()
!
.
root
.
proxy
!
.
$page
.
id
}
...
...
packages/uni-mp-alipay/dist/uni.mp.esm.js
浏览文件 @
a8a51d3d
...
...
@@ -234,49 +234,7 @@ function stringifyQuery(obj, encodeStr = encode) {
.
join
(
'
&
'
)
:
null
;
return
res
?
`?
${
res
}
`
:
''
;
}
const
EVENT_MAP
=
{
onClick
:
'
.e0
'
,
onChange
:
'
.e1
'
,
onInput
:
'
.e2
'
,
onLoad
:
'
.e3
'
,
onError
:
'
.e4
'
,
onTouchstart
:
'
.e5
'
,
onTouchmove
:
'
.e6
'
,
onTouchcancel
:
'
.e7
'
,
onTouchend
:
'
.e8
'
,
onLongpress
:
'
.e9
'
,
onTransitionend
:
'
.ea
'
,
onAnimationstart
:
'
.eb
'
,
onAnimationiteration
:
'
.ec
'
,
onAnimationend
:
'
.ed
'
,
onTouchforcechange
:
'
.ee
'
,
};
const
OPTIONS
=
[
'
Capture
'
,
'
CaptureOnce
'
,
'
CapturePassive
'
,
'
CaptureOncePassive
'
,
'
Once
'
,
'
OncePassive
'
,
'
Passive
'
,
];
const
BASE_ATTR_MAP
=
{
class
:
'
.c
'
,
style
:
'
.s
'
,
'
hover-class
'
:
'
.h0
'
,
'
hover-stop-propagation
'
:
'
.h1
'
,
'
hover-start-time
'
:
'
.h2
'
,
'
hover-stay-time
'
:
'
.h3
'
,
};
/*#__PURE__*/
extend
(
BASE_ATTR_MAP
,
Object
.
keys
(
EVENT_MAP
).
reduce
((
res
,
name
)
=>
{
const
value
=
EVENT_MAP
[
name
];
res
[
name
]
=
value
;
OPTIONS
.
forEach
((
v
,
i
)
=>
{
res
[
name
+
v
]
=
value
+
i
;
});
return
res
;
},
Object
.
create
(
null
)));
}
function
initVueIds
(
vueIds
,
mpInstance
)
{
if
(
!
vueIds
)
{
...
...
packages/uni-mp-baidu/dist/uni.mp.esm.js
浏览文件 @
a8a51d3d
...
...
@@ -225,49 +225,7 @@ function stringifyQuery(obj, encodeStr = encode) {
.
join
(
'
&
'
)
:
null
;
return
res
?
`?
${
res
}
`
:
''
;
}
const
EVENT_MAP
=
{
onClick
:
'
.e0
'
,
onChange
:
'
.e1
'
,
onInput
:
'
.e2
'
,
onLoad
:
'
.e3
'
,
onError
:
'
.e4
'
,
onTouchstart
:
'
.e5
'
,
onTouchmove
:
'
.e6
'
,
onTouchcancel
:
'
.e7
'
,
onTouchend
:
'
.e8
'
,
onLongpress
:
'
.e9
'
,
onTransitionend
:
'
.ea
'
,
onAnimationstart
:
'
.eb
'
,
onAnimationiteration
:
'
.ec
'
,
onAnimationend
:
'
.ed
'
,
onTouchforcechange
:
'
.ee
'
,
};
const
OPTIONS
=
[
'
Capture
'
,
'
CaptureOnce
'
,
'
CapturePassive
'
,
'
CaptureOncePassive
'
,
'
Once
'
,
'
OncePassive
'
,
'
Passive
'
,
];
const
BASE_ATTR_MAP
=
{
class
:
'
.c
'
,
style
:
'
.s
'
,
'
hover-class
'
:
'
.h0
'
,
'
hover-stop-propagation
'
:
'
.h1
'
,
'
hover-start-time
'
:
'
.h2
'
,
'
hover-stay-time
'
:
'
.h3
'
,
};
/*#__PURE__*/
extend
(
BASE_ATTR_MAP
,
Object
.
keys
(
EVENT_MAP
).
reduce
((
res
,
name
)
=>
{
const
value
=
EVENT_MAP
[
name
];
res
[
name
]
=
value
;
OPTIONS
.
forEach
((
v
,
i
)
=>
{
res
[
name
+
v
]
=
value
+
i
;
});
return
res
;
},
Object
.
create
(
null
)));
}
function
initBehavior
(
options
)
{
return
Behavior
(
options
);
...
...
packages/uni-mp-qq/dist/uni.mp.esm.js
浏览文件 @
a8a51d3d
...
...
@@ -225,49 +225,7 @@ function stringifyQuery(obj, encodeStr = encode) {
.
join
(
'
&
'
)
:
null
;
return
res
?
`?
${
res
}
`
:
''
;
}
const
EVENT_MAP
=
{
onClick
:
'
.e0
'
,
onChange
:
'
.e1
'
,
onInput
:
'
.e2
'
,
onLoad
:
'
.e3
'
,
onError
:
'
.e4
'
,
onTouchstart
:
'
.e5
'
,
onTouchmove
:
'
.e6
'
,
onTouchcancel
:
'
.e7
'
,
onTouchend
:
'
.e8
'
,
onLongpress
:
'
.e9
'
,
onTransitionend
:
'
.ea
'
,
onAnimationstart
:
'
.eb
'
,
onAnimationiteration
:
'
.ec
'
,
onAnimationend
:
'
.ed
'
,
onTouchforcechange
:
'
.ee
'
,
};
const
OPTIONS
=
[
'
Capture
'
,
'
CaptureOnce
'
,
'
CapturePassive
'
,
'
CaptureOncePassive
'
,
'
Once
'
,
'
OncePassive
'
,
'
Passive
'
,
];
const
BASE_ATTR_MAP
=
{
class
:
'
.c
'
,
style
:
'
.s
'
,
'
hover-class
'
:
'
.h0
'
,
'
hover-stop-propagation
'
:
'
.h1
'
,
'
hover-start-time
'
:
'
.h2
'
,
'
hover-stay-time
'
:
'
.h3
'
,
};
/*#__PURE__*/
extend
(
BASE_ATTR_MAP
,
Object
.
keys
(
EVENT_MAP
).
reduce
((
res
,
name
)
=>
{
const
value
=
EVENT_MAP
[
name
];
res
[
name
]
=
value
;
OPTIONS
.
forEach
((
v
,
i
)
=>
{
res
[
name
+
v
]
=
value
+
i
;
});
return
res
;
},
Object
.
create
(
null
)));
}
function
initBehavior
(
options
)
{
return
Behavior
(
options
);
...
...
packages/uni-mp-toutiao/dist/uni.mp.esm.js
浏览文件 @
a8a51d3d
...
...
@@ -228,49 +228,7 @@ function stringifyQuery(obj, encodeStr = encode) {
.
join
(
'
&
'
)
:
null
;
return
res
?
`?
${
res
}
`
:
''
;
}
const
EVENT_MAP
=
{
onClick
:
'
.e0
'
,
onChange
:
'
.e1
'
,
onInput
:
'
.e2
'
,
onLoad
:
'
.e3
'
,
onError
:
'
.e4
'
,
onTouchstart
:
'
.e5
'
,
onTouchmove
:
'
.e6
'
,
onTouchcancel
:
'
.e7
'
,
onTouchend
:
'
.e8
'
,
onLongpress
:
'
.e9
'
,
onTransitionend
:
'
.ea
'
,
onAnimationstart
:
'
.eb
'
,
onAnimationiteration
:
'
.ec
'
,
onAnimationend
:
'
.ed
'
,
onTouchforcechange
:
'
.ee
'
,
};
const
OPTIONS
=
[
'
Capture
'
,
'
CaptureOnce
'
,
'
CapturePassive
'
,
'
CaptureOncePassive
'
,
'
Once
'
,
'
OncePassive
'
,
'
Passive
'
,
];
const
BASE_ATTR_MAP
=
{
class
:
'
.c
'
,
style
:
'
.s
'
,
'
hover-class
'
:
'
.h0
'
,
'
hover-stop-propagation
'
:
'
.h1
'
,
'
hover-start-time
'
:
'
.h2
'
,
'
hover-stay-time
'
:
'
.h3
'
,
};
/*#__PURE__*/
extend
(
BASE_ATTR_MAP
,
Object
.
keys
(
EVENT_MAP
).
reduce
((
res
,
name
)
=>
{
const
value
=
EVENT_MAP
[
name
];
res
[
name
]
=
value
;
OPTIONS
.
forEach
((
v
,
i
)
=>
{
res
[
name
+
v
]
=
value
+
i
;
});
return
res
;
},
Object
.
create
(
null
)));
}
function
initBehavior
(
options
)
{
return
Behavior
(
options
);
...
...
packages/uni-mp-vue/dist/vue.runtime.esm.js
浏览文件 @
a8a51d3d
import
{
isFunction
,
extend
,
isSymbol
,
isMap
,
isObject
,
toRawType
,
def
,
isArray
,
isString
,
isPromise
,
toHandlerKey
,
remove
,
EMPTY_OBJ
,
camelize
,
capitalize
,
normalizeClass
,
normalizeStyle
,
isOn
,
NOOP
,
isGloballyWhitelisted
,
isIntegerKey
,
hasOwn
,
hasChanged
,
invokeArrayFns
as
invokeArrayFns$1
,
makeMap
,
isSet
,
NO
,
toNumber
,
hyphenate
,
isReservedProp
,
EMPTY_ARR
,
toTypeString
}
from
'
@vue/shared
'
;
import
{
isFunction
,
isSymbol
,
extend
,
isMap
,
isObject
,
toRawType
,
def
,
isArray
,
isString
,
isPromise
,
toHandlerKey
,
remove
,
EMPTY_OBJ
,
camelize
,
capitalize
,
normalizeClass
,
normalizeStyle
,
isOn
,
NOOP
,
isGloballyWhitelisted
,
isIntegerKey
,
hasOwn
,
hasChanged
,
invokeArrayFns
as
invokeArrayFns$1
,
makeMap
,
isSet
,
NO
,
toNumber
,
hyphenate
,
isReservedProp
,
EMPTY_ARR
,
toTypeString
}
from
'
@vue/shared
'
;
export
{
camelize
}
from
'
@vue/shared
'
;
import
{
injectHook
as
injectHook$1
}
from
'
vue
'
;
...
...
@@ -13,48 +13,6 @@ function applyOptions$1(options, instance, publicThis) {
});
}
const
EVENT_MAP
=
{
onClick
:
'
.e0
'
,
onChange
:
'
.e1
'
,
onInput
:
'
.e2
'
,
onLoad
:
'
.e3
'
,
onError
:
'
.e4
'
,
onTouchstart
:
'
.e5
'
,
onTouchmove
:
'
.e6
'
,
onTouchcancel
:
'
.e7
'
,
onTouchend
:
'
.e8
'
,
onLongpress
:
'
.e9
'
,
onTransitionend
:
'
.ea
'
,
onAnimationstart
:
'
.eb
'
,
onAnimationiteration
:
'
.ec
'
,
onAnimationend
:
'
.ed
'
,
onTouchforcechange
:
'
.ee
'
,
};
const
OPTIONS
=
[
'
Capture
'
,
'
CaptureOnce
'
,
'
CapturePassive
'
,
'
CaptureOncePassive
'
,
'
Once
'
,
'
OncePassive
'
,
'
Passive
'
,
];
const
BASE_ATTR_MAP
=
{
class
:
'
.c
'
,
style
:
'
.s
'
,
'
hover-class
'
:
'
.h0
'
,
'
hover-stop-propagation
'
:
'
.h1
'
,
'
hover-start-time
'
:
'
.h2
'
,
'
hover-stay-time
'
:
'
.h3
'
,
};
/*#__PURE__*/
extend
(
BASE_ATTR_MAP
,
Object
.
keys
(
EVENT_MAP
).
reduce
((
res
,
name
)
=>
{
const
value
=
EVENT_MAP
[
name
];
res
[
name
]
=
value
;
OPTIONS
.
forEach
((
v
,
i
)
=>
{
res
[
name
+
v
]
=
value
+
i
;
});
return
res
;
},
Object
.
create
(
null
)));
const
invokeArrayFns
=
(
fns
,
arg
)
=>
{
let
ret
;
for
(
let
i
=
0
;
i
<
fns
.
length
;
i
++
)
{
...
...
packages/uni-mp-weixin/dist/uni.mp.esm.js
浏览文件 @
a8a51d3d
...
...
@@ -225,49 +225,7 @@ function stringifyQuery(obj, encodeStr = encode) {
.
join
(
'
&
'
)
:
null
;
return
res
?
`?
${
res
}
`
:
''
;
}
const
EVENT_MAP
=
{
onClick
:
'
.e0
'
,
onChange
:
'
.e1
'
,
onInput
:
'
.e2
'
,
onLoad
:
'
.e3
'
,
onError
:
'
.e4
'
,
onTouchstart
:
'
.e5
'
,
onTouchmove
:
'
.e6
'
,
onTouchcancel
:
'
.e7
'
,
onTouchend
:
'
.e8
'
,
onLongpress
:
'
.e9
'
,
onTransitionend
:
'
.ea
'
,
onAnimationstart
:
'
.eb
'
,
onAnimationiteration
:
'
.ec
'
,
onAnimationend
:
'
.ed
'
,
onTouchforcechange
:
'
.ee
'
,
};
const
OPTIONS
=
[
'
Capture
'
,
'
CaptureOnce
'
,
'
CapturePassive
'
,
'
CaptureOncePassive
'
,
'
Once
'
,
'
OncePassive
'
,
'
Passive
'
,
];
const
BASE_ATTR_MAP
=
{
class
:
'
.c
'
,
style
:
'
.s
'
,
'
hover-class
'
:
'
.h0
'
,
'
hover-stop-propagation
'
:
'
.h1
'
,
'
hover-start-time
'
:
'
.h2
'
,
'
hover-stay-time
'
:
'
.h3
'
,
};
/*#__PURE__*/
extend
(
BASE_ATTR_MAP
,
Object
.
keys
(
EVENT_MAP
).
reduce
((
res
,
name
)
=>
{
const
value
=
EVENT_MAP
[
name
];
res
[
name
]
=
value
;
OPTIONS
.
forEach
((
v
,
i
)
=>
{
res
[
name
+
v
]
=
value
+
i
;
});
return
res
;
},
Object
.
create
(
null
)));
}
function
initBehavior
(
options
)
{
return
Behavior
(
options
);
...
...
packages/uni-quickapp-webview/dist/uni.mp.esm.js
浏览文件 @
a8a51d3d
...
...
@@ -225,49 +225,7 @@ function stringifyQuery(obj, encodeStr = encode) {
.
join
(
'
&
'
)
:
null
;
return
res
?
`?
${
res
}
`
:
''
;
}
const
EVENT_MAP
=
{
onClick
:
'
.e0
'
,
onChange
:
'
.e1
'
,
onInput
:
'
.e2
'
,
onLoad
:
'
.e3
'
,
onError
:
'
.e4
'
,
onTouchstart
:
'
.e5
'
,
onTouchmove
:
'
.e6
'
,
onTouchcancel
:
'
.e7
'
,
onTouchend
:
'
.e8
'
,
onLongpress
:
'
.e9
'
,
onTransitionend
:
'
.ea
'
,
onAnimationstart
:
'
.eb
'
,
onAnimationiteration
:
'
.ec
'
,
onAnimationend
:
'
.ed
'
,
onTouchforcechange
:
'
.ee
'
,
};
const
OPTIONS
=
[
'
Capture
'
,
'
CaptureOnce
'
,
'
CapturePassive
'
,
'
CaptureOncePassive
'
,
'
Once
'
,
'
OncePassive
'
,
'
Passive
'
,
];
const
BASE_ATTR_MAP
=
{
class
:
'
.c
'
,
style
:
'
.s
'
,
'
hover-class
'
:
'
.h0
'
,
'
hover-stop-propagation
'
:
'
.h1
'
,
'
hover-start-time
'
:
'
.h2
'
,
'
hover-stay-time
'
:
'
.h3
'
,
};
/*#__PURE__*/
extend
(
BASE_ATTR_MAP
,
Object
.
keys
(
EVENT_MAP
).
reduce
((
res
,
name
)
=>
{
const
value
=
EVENT_MAP
[
name
];
res
[
name
]
=
value
;
OPTIONS
.
forEach
((
v
,
i
)
=>
{
res
[
name
+
v
]
=
value
+
i
;
});
return
res
;
},
Object
.
create
(
null
)));
}
function
initBehavior
(
options
)
{
return
Behavior
(
options
);
...
...
packages/uni-shared/dist/uni-shared.cjs.js
浏览文件 @
a8a51d3d
...
...
@@ -554,14 +554,17 @@ const BASE_ATTR_MAP = {
'
hover-start-time
'
:
'
.h2
'
,
'
hover-stay-time
'
:
'
.h3
'
,
};
const
ATTR_MAP
=
/*#__PURE__*/
shared
.
extend
(
BASE_ATTR_MAP
,
Object
.
keys
(
EVENT_MAP
).
reduce
((
res
,
name
)
=>
{
const
value
=
EVENT_MAP
[
name
];
res
[
name
]
=
value
;
OPTIONS
.
forEach
((
v
,
i
)
=>
{
res
[
name
+
v
]
=
value
+
i
;
});
return
res
;
},
Object
.
create
(
null
)));
// 该代码会单独编译成一个decode js,用于开发时测试,故尽可能独立,不使用 @vue/shared 的 extend
const
ATTR_MAP
=
/*#__PURE__*/
(()
=>
{
return
Object
.
assign
(
BASE_ATTR_MAP
,
Object
.
keys
(
EVENT_MAP
).
reduce
((
res
,
name
)
=>
{
const
value
=
EVENT_MAP
[
name
];
res
[
name
]
=
value
;
OPTIONS
.
forEach
((
v
,
i
)
=>
{
res
[
name
+
v
]
=
value
+
i
;
});
return
res
;
},
Object
.
create
(
null
)));
})();
function
encodeAttr
(
name
)
{
return
ATTR_MAP
[
name
]
||
name
;
}
...
...
packages/uni-shared/dist/uni-shared.es.js
浏览文件 @
a8a51d3d
...
...
@@ -550,14 +550,17 @@ const BASE_ATTR_MAP = {
'
hover-start-time
'
:
'
.h2
'
,
'
hover-stay-time
'
:
'
.h3
'
,
};
const
ATTR_MAP
=
/*#__PURE__*/
extend
(
BASE_ATTR_MAP
,
Object
.
keys
(
EVENT_MAP
).
reduce
((
res
,
name
)
=>
{
const
value
=
EVENT_MAP
[
name
];
res
[
name
]
=
value
;
OPTIONS
.
forEach
((
v
,
i
)
=>
{
res
[
name
+
v
]
=
value
+
i
;
});
return
res
;
},
Object
.
create
(
null
)));
// 该代码会单独编译成一个decode js,用于开发时测试,故尽可能独立,不使用 @vue/shared 的 extend
const
ATTR_MAP
=
/*#__PURE__*/
(()
=>
{
return
Object
.
assign
(
BASE_ATTR_MAP
,
Object
.
keys
(
EVENT_MAP
).
reduce
((
res
,
name
)
=>
{
const
value
=
EVENT_MAP
[
name
];
res
[
name
]
=
value
;
OPTIONS
.
forEach
((
v
,
i
)
=>
{
res
[
name
+
v
]
=
value
+
i
;
});
return
res
;
},
Object
.
create
(
null
)));
})();
function
encodeAttr
(
name
)
{
return
ATTR_MAP
[
name
]
||
name
;
}
...
...
packages/uni-shared/src/vdom/encode.ts
浏览文件 @
a8a51d3d
import
{
extend
}
from
'
@vue/shared
'
export
const
EventOptionFlags
=
{
capture
:
1
,
once
:
1
<<
1
,
...
...
@@ -79,17 +77,20 @@ const BASE_ATTR_MAP = {
'
hover-stay-time
'
:
'
.h3
'
,
}
export
const
ATTR_MAP
=
/*#__PURE__*/
extend
(
BASE_ATTR_MAP
,
Object
.
keys
(
EVENT_MAP
).
reduce
((
res
,
name
)
=>
{
const
value
=
EVENT_MAP
[
name
as
keyof
typeof
EVENT_MAP
]
res
[
name
]
=
value
OPTIONS
.
forEach
((
v
,
i
)
=>
{
res
[
name
+
v
]
=
value
+
i
})
return
res
},
Object
.
create
(
null
))
)
// 该代码会单独编译成一个decode js,用于开发时测试,故尽可能独立,不使用 @vue/shared 的 extend
export
const
ATTR_MAP
=
/*#__PURE__*/
(()
=>
{
return
Object
.
assign
(
BASE_ATTR_MAP
,
Object
.
keys
(
EVENT_MAP
).
reduce
((
res
,
name
)
=>
{
const
value
=
EVENT_MAP
[
name
as
keyof
typeof
EVENT_MAP
]
res
[
name
]
=
value
OPTIONS
.
forEach
((
v
,
i
)
=>
{
res
[
name
+
v
]
=
value
+
i
})
return
res
},
Object
.
create
(
null
))
)
})()
export
function
encodeAttr
(
name
:
string
)
{
return
ATTR_MAP
[
name
as
keyof
typeof
ATTR_MAP
]
||
name
...
...
packages/vite-plugin-uni/src/vue/options.ts
浏览文件 @
a8a51d3d
...
...
@@ -110,6 +110,8 @@ export function initPluginVueOptions(
directiveTransforms
)
}
// App,MP 平台不支持使用静态节点
compilerOptions
.
hoistStatic
=
false
return
vueOptions
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录