Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
我本凡人 一念云泥
uni-app
提交
1b973289
uni-app
项目概览
我本凡人 一念云泥
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1b973289
编写于
6月 22, 2020
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(mp): v-for with NumericLiteral,StringLiteral
上级
9cc4f772
变更
14
展开全部
隐藏空白更改
内联
并排
Showing
14 changed file
with
390 addition
and
42 deletion
+390
-42
packages/uni-app-plus/dist/index.js
packages/uni-app-plus/dist/index.js
+18
-1
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+10
-3
packages/uni-migration/yarn.lock
packages/uni-migration/yarn.lock
+174
-0
packages/uni-mp-alipay/dist/index.js
packages/uni-mp-alipay/dist/index.js
+35
-3
packages/uni-mp-baidu/dist/index.js
packages/uni-mp-baidu/dist/index.js
+20
-2
packages/uni-mp-qq/dist/index.js
packages/uni-mp-qq/dist/index.js
+33
-15
packages/uni-mp-toutiao/dist/index.js
packages/uni-mp-toutiao/dist/index.js
+23
-5
packages/uni-mp-weixin/dist/index.js
packages/uni-mp-weixin/dist/index.js
+21
-3
packages/uni-quickapp-native/dist/vue.dev.js
packages/uni-quickapp-native/dist/vue.dev.js
+1
-1
packages/uni-quickapp-native/dist/vue.prod.js
packages/uni-quickapp-native/dist/vue.prod.js
+1
-1
packages/uni-quickapp-webview/dist/index.js
packages/uni-quickapp-webview/dist/index.js
+19
-1
packages/uni-template-compiler/__tests__/compiler-extra.spec.js
...es/uni-template-compiler/__tests__/compiler-extra.spec.js
+8
-0
packages/uni-template-compiler/lib/script/traverse/render-list.js
.../uni-template-compiler/lib/script/traverse/render-list.js
+15
-6
src/core/runtime/wrapper/util.js
src/core/runtime/wrapper/util.js
+12
-1
未找到文件。
packages/uni-app-plus/dist/index.js
浏览文件 @
1b973289
...
...
@@ -922,7 +922,18 @@ function getExtraValue (vm, dataPathsArray) {
const
propPath
=
dataPathArray
[
1
];
const
valuePath
=
dataPathArray
[
3
];
const
vFor
=
dataPath
?
vm
.
__get_value
(
dataPath
,
context
)
:
context
;
let
vFor
;
if
(
Number
.
isInteger
(
dataPath
))
{
vFor
=
dataPath
;
}
else
if
(
!
dataPath
)
{
vFor
=
context
;
}
else
if
(
typeof
dataPath
===
'
string
'
&&
dataPath
)
{
if
(
dataPath
.
indexOf
(
'
#s#
'
)
===
0
)
{
vFor
=
dataPath
.
substr
(
3
);
}
else
{
vFor
=
vm
.
__get_value
(
dataPath
,
context
);
}
}
if
(
Number
.
isInteger
(
vFor
))
{
context
=
value
;
...
...
@@ -972,6 +983,12 @@ function processEventExtra (vm, extra, event) {
}
else
{
if
(
dataPath
===
'
$event
'
)
{
// $event
extraObj
[
'
$
'
+
index
]
=
event
;
}
else
if
(
dataPath
===
'
arguments
'
)
{
if
(
event
.
detail
&&
event
.
detail
.
__args__
)
{
extraObj
[
'
$
'
+
index
]
=
event
.
detail
.
__args__
;
}
else
{
extraObj
[
'
$
'
+
index
]
=
[
event
];
}
}
else
if
(
dataPath
.
indexOf
(
'
$event.
'
)
===
0
)
{
// $event.target.value
extraObj
[
'
$
'
+
index
]
=
vm
.
__get_value
(
dataPath
.
replace
(
'
$event.
'
,
''
),
event
);
}
else
{
...
...
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
1b973289
...
...
@@ -13132,10 +13132,17 @@ var serviceContext = (function () {
const
globalEvent
=
requireNativePlugin
(
'
globalEvent
'
);
const
emit
=
UniServiceJSBridge
.
emit
;
// splashclosed 时开始监听 backbutton
plus
.
globalEvent
.
addEventListener
(
'
splashclosed
'
,
()
=>
{
if
(
weex
.
config
.
preload
)
{
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
'
[uni-app] preload.addEventListener.backbutton
'
);
}
plus
.
key
.
addEventListener
(
'
backbutton
'
,
backbuttonListener
);
});
}
else
{
// splashclosed 时开始监听 backbutton
plus
.
globalEvent
.
addEventListener
(
'
splashclosed
'
,
()
=>
{
plus
.
key
.
addEventListener
(
'
backbutton
'
,
backbuttonListener
);
});
}
plus
.
globalEvent
.
addEventListener
(
'
pause
'
,
()
=>
{
emit
(
'
onAppEnterBackground
'
);
...
...
packages/uni-migration/yarn.lock
0 → 100644
浏览文件 @
1b973289
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
ast-types@0.13.3:
version "0.13.3"
resolved "https://registry.npmjs.org/ast-types/-/ast-types-0.13.3.tgz#50da3f28d17bdbc7969a3a2d83a0e4a72ae755a7"
integrity sha512-XTZ7xGML849LkQP86sWdQzfhwbt3YwIO6MqbX9mUNYY98VKaaVZP7YNNm70IpwecbkkxmfC5IYAzOQ/2p29zRA==
commander@^4.0.1:
version "4.1.1"
resolved "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068"
integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==
core-util-is@~1.0.0:
version "1.0.2"
resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=
dom-serializer@0:
version "0.2.2"
resolved "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz#1afb81f533717175d478655debc5e332d9f9bb51"
integrity sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==
dependencies:
domelementtype "^2.0.1"
entities "^2.0.0"
domelementtype@1, domelementtype@^1.3.0:
version "1.3.1"
resolved "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f"
integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==
domelementtype@^2.0.1:
version "2.0.1"
resolved "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.1.tgz#1f8bdfe91f5a78063274e803b4bdcedf6e94f94d"
integrity sha512-5HOHUDsYZWV8FGWN0Njbr/Rn7f/eWSQi1v7+HsUVwXgn8nWWlL64zKDkS0n8ZmQ3mlWOMuXOnR+7Nx/5tMO5AQ==
domutils@^1.5.1:
version "1.7.0"
resolved "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a"
integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==
dependencies:
dom-serializer "0"
domelementtype "1"
entities@^1.1.1:
version "1.1.2"
resolved "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56"
integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==
entities@^2.0.0:
version "2.0.3"
resolved "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz#5c487e5742ab93c15abb5da22759b8590ec03b7f"
integrity sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ==
esprima@~4.0.0:
version "4.0.1"
resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==
fs-extra@^8.1.0:
version "8.1.0"
resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0"
integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==
dependencies:
graceful-fs "^4.2.0"
jsonfile "^4.0.0"
universalify "^0.1.0"
graceful-fs@^4.1.6, graceful-fs@^4.2.0:
version "4.2.4"
resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb"
integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==
inherits@^2.0.1, inherits@~2.0.3:
version "2.0.4"
resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
isarray@~1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=
jsonfile@^4.0.0:
version "4.0.0"
resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"
integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=
optionalDependencies:
graceful-fs "^4.1.6"
mustache@^3.1.0:
version "3.2.1"
resolved "https://registry.npmjs.org/mustache/-/mustache-3.2.1.tgz#89e78a9d207d78f2799b1e95764a25bf71a28322"
integrity sha512-RERvMFdLpaFfSRIEe632yDm5nsd0SDKn8hGmcUwswnyiE5mtdZLDybtHAz6hjJhawokF0hXvGLtx9mrQfm6FkA==
private@^0.1.8:
version "0.1.8"
resolved "https://registry.npmjs.org/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff"
integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==
process-nextick-args@~2.0.0:
version "2.0.1"
resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==
readable-stream@^2.0.2:
version "2.3.7"
resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57"
integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==
dependencies:
core-util-is "~1.0.0"
inherits "~2.0.3"
isarray "~1.0.0"
process-nextick-args "~2.0.0"
safe-buffer "~5.1.1"
string_decoder "~1.1.1"
util-deprecate "~1.0.1"
recast@*:
version "0.19.1"
resolved "https://registry.npmjs.org/recast/-/recast-0.19.1.tgz#555f3612a5a10c9f44b9a923875c51ff775de6c8"
integrity sha512-8FCjrBxjeEU2O6I+2hyHyBFH1siJbMBLwIRvVr1T3FD2cL754sOaJDsJ/8h3xYltasbJ8jqWRIhMuDGBSiSbjw==
dependencies:
ast-types "0.13.3"
esprima "~4.0.0"
private "^0.1.8"
source-map "~0.6.1"
safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.2"
resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
source-map@~0.6.1:
version "0.6.1"
resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
stricter-htmlparser2@^3.9.6:
version "3.9.6"
resolved "https://registry.npmjs.org/stricter-htmlparser2/-/stricter-htmlparser2-3.9.6.tgz#fd195f5e4bc0989c6b15fc79eca85c6401bb5045"
integrity sha512-w/PqXYnjfpi49nb3xnsizORItMM53M/jHdCL8Cer0OqO3vRLsNDtRKoHY/IkIuGnH7/TEn23yvlZoQQLt7pdrw==
dependencies:
domelementtype "^1.3.0"
domutils "^1.5.1"
entities "^1.1.1"
inherits "^2.0.1"
readable-stream "^2.0.2"
x-domhandler "^2.4.2"
string_decoder@~1.1.1:
version "1.1.1"
resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==
dependencies:
safe-buffer "~5.1.0"
universalify@^0.1.0:
version "0.1.2"
resolved "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"
integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==
util-deprecate@~1.0.1:
version "1.0.2"
resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
x-domhandler@^2.4.2:
version "2.4.2"
resolved "https://registry.npmjs.org/x-domhandler/-/x-domhandler-2.4.2.tgz#21afb2d71977118688e49e05c30894497ce3d5e9"
integrity sha512-c+T0p5hsahezbHpahjNpSDKjMMwGwOnG6Iaz8zzSjEBlJM47hakZmNBLNpktZJjuRdopoUMPf7HzcPcTE1G0GQ==
dependencies:
domelementtype "1"
packages/uni-mp-alipay/dist/index.js
浏览文件 @
1b973289
...
...
@@ -357,8 +357,9 @@ var baseApi = /*#__PURE__*/Object.freeze({
});
// 不支持的 API 列表
const
todos
=
[
'
preloadPage
'
,
const
todos
=
[
'
preloadPage
'
,
'
unPreloadPage
'
,
'
loadSubPackage
'
// 'getRecorderManager',
// 'getBackgroundAudioManager',
...
...
@@ -578,6 +579,20 @@ const protocols = { // 需要做转换的 API 列表
filePath
:
'
apFilePath
'
}
},
compressImage
:
{
args
(
fromArgs
)
{
fromArgs
.
compressLevel
=
4
;
if
(
fromArgs
&&
fromArgs
.
quality
)
{
fromArgs
.
compressLevel
=
Math
.
floor
(
fromArgs
.
quality
/
26
);
}
fromArgs
.
apFilePaths
=
[
fromArgs
.
src
];
},
returnValue
(
result
)
{
if
(
result
.
apFilePaths
&&
result
.
apFilePaths
.
length
)
{
result
.
tempFilePath
=
result
.
apFilePaths
[
0
];
}
}
},
chooseVideo
:
{
// 支付宝小程序文档中未找到(仅在getSetting处提及),但实际可用
returnValue
:
{
...
...
@@ -1384,7 +1399,18 @@ function getExtraValue (vm, dataPathsArray) {
const
propPath
=
dataPathArray
[
1
];
const
valuePath
=
dataPathArray
[
3
];
const
vFor
=
dataPath
?
vm
.
__get_value
(
dataPath
,
context
)
:
context
;
let
vFor
;
if
(
Number
.
isInteger
(
dataPath
))
{
vFor
=
dataPath
;
}
else
if
(
!
dataPath
)
{
vFor
=
context
;
}
else
if
(
typeof
dataPath
===
'
string
'
&&
dataPath
)
{
if
(
dataPath
.
indexOf
(
'
#s#
'
)
===
0
)
{
vFor
=
dataPath
.
substr
(
3
);
}
else
{
vFor
=
vm
.
__get_value
(
dataPath
,
context
);
}
}
if
(
Number
.
isInteger
(
vFor
))
{
context
=
value
;
...
...
@@ -1434,6 +1460,12 @@ function processEventExtra (vm, extra, event) {
}
else
{
if
(
dataPath
===
'
$event
'
)
{
// $event
extraObj
[
'
$
'
+
index
]
=
event
;
}
else
if
(
dataPath
===
'
arguments
'
)
{
if
(
event
.
detail
&&
event
.
detail
.
__args__
)
{
extraObj
[
'
$
'
+
index
]
=
event
.
detail
.
__args__
;
}
else
{
extraObj
[
'
$
'
+
index
]
=
[
event
];
}
}
else
if
(
dataPath
.
indexOf
(
'
$event.
'
)
===
0
)
{
// $event.target.value
extraObj
[
'
$
'
+
index
]
=
vm
.
__get_value
(
dataPath
.
replace
(
'
$event.
'
,
''
),
event
);
}
else
{
...
...
packages/uni-mp-baidu/dist/index.js
浏览文件 @
1b973289
...
...
@@ -392,7 +392,8 @@ var previewImage = {
// 不支持的 API 列表
const
todos
=
[
'
preloadPage
'
'
preloadPage
'
,
'
unPreloadPage
'
// 'hideKeyboard',
// 'onGyroscopeChange',
// 'startGyroscope',
...
...
@@ -1063,7 +1064,18 @@ function getExtraValue (vm, dataPathsArray) {
const
propPath
=
dataPathArray
[
1
];
const
valuePath
=
dataPathArray
[
3
];
const
vFor
=
dataPath
?
vm
.
__get_value
(
dataPath
,
context
)
:
context
;
let
vFor
;
if
(
Number
.
isInteger
(
dataPath
))
{
vFor
=
dataPath
;
}
else
if
(
!
dataPath
)
{
vFor
=
context
;
}
else
if
(
typeof
dataPath
===
'
string
'
&&
dataPath
)
{
if
(
dataPath
.
indexOf
(
'
#s#
'
)
===
0
)
{
vFor
=
dataPath
.
substr
(
3
);
}
else
{
vFor
=
vm
.
__get_value
(
dataPath
,
context
);
}
}
if
(
Number
.
isInteger
(
vFor
))
{
context
=
value
;
...
...
@@ -1113,6 +1125,12 @@ function processEventExtra (vm, extra, event) {
}
else
{
if
(
dataPath
===
'
$event
'
)
{
// $event
extraObj
[
'
$
'
+
index
]
=
event
;
}
else
if
(
dataPath
===
'
arguments
'
)
{
if
(
event
.
detail
&&
event
.
detail
.
__args__
)
{
extraObj
[
'
$
'
+
index
]
=
event
.
detail
.
__args__
;
}
else
{
extraObj
[
'
$
'
+
index
]
=
[
event
];
}
}
else
if
(
dataPath
.
indexOf
(
'
$event.
'
)
===
0
)
{
// $event.target.value
extraObj
[
'
$
'
+
index
]
=
vm
.
__get_value
(
dataPath
.
replace
(
'
$event.
'
,
''
),
event
);
}
else
{
...
...
packages/uni-mp-qq/dist/index.js
浏览文件 @
1b973289
...
...
@@ -393,8 +393,9 @@ var previewImage = {
const
protocols
=
{
previewImage
};
const
todos
=
[
'
preloadPage
'
,
const
todos
=
[
'
preloadPage
'
,
'
unPreloadPage
'
,
'
loadSubPackage
'
// 'startBeaconDiscovery',
// 'stopBeaconDiscovery',
...
...
@@ -425,10 +426,10 @@ const todos = [
// 'chooseInvoiceTitle',
// 'checkIsSupportSoterAuthentication',
// 'startSoterAuthentication',
// 'checkIsSoterEnrolledInDevice',
// 'vibrate',
// 'loadFontFace',
// 'getExtConfig',
// 'checkIsSoterEnrolledInDevice',
// 'vibrate',
// 'loadFontFace',
// 'getExtConfig',
// 'getExtConfigSync'
];
const
canIUses
=
[
...
...
@@ -444,14 +445,14 @@ const canIUses = [
'
onUserCaptureScreen
'
,
'
vibrateLong
'
,
'
vibrateShort
'
,
'
createWorker
'
,
'
connectSocket
'
,
'
onSocketOpen
'
,
'
onSocketError
'
,
'
sendSocketMessage
'
,
'
onSocketMessage
'
,
'
closeSocket
'
,
'
onSocketClose
'
,
'
createWorker
'
,
'
connectSocket
'
,
'
onSocketOpen
'
,
'
onSocketError
'
,
'
sendSocketMessage
'
,
'
onSocketMessage
'
,
'
closeSocket
'
,
'
onSocketClose
'
,
'
openDocument
'
,
'
updateShareMenu
'
,
'
getShareInfo
'
,
...
...
@@ -979,7 +980,18 @@ function getExtraValue (vm, dataPathsArray) {
const
propPath
=
dataPathArray
[
1
];
const
valuePath
=
dataPathArray
[
3
];
const
vFor
=
dataPath
?
vm
.
__get_value
(
dataPath
,
context
)
:
context
;
let
vFor
;
if
(
Number
.
isInteger
(
dataPath
))
{
vFor
=
dataPath
;
}
else
if
(
!
dataPath
)
{
vFor
=
context
;
}
else
if
(
typeof
dataPath
===
'
string
'
&&
dataPath
)
{
if
(
dataPath
.
indexOf
(
'
#s#
'
)
===
0
)
{
vFor
=
dataPath
.
substr
(
3
);
}
else
{
vFor
=
vm
.
__get_value
(
dataPath
,
context
);
}
}
if
(
Number
.
isInteger
(
vFor
))
{
context
=
value
;
...
...
@@ -1029,6 +1041,12 @@ function processEventExtra (vm, extra, event) {
}
else
{
if
(
dataPath
===
'
$event
'
)
{
// $event
extraObj
[
'
$
'
+
index
]
=
event
;
}
else
if
(
dataPath
===
'
arguments
'
)
{
if
(
event
.
detail
&&
event
.
detail
.
__args__
)
{
extraObj
[
'
$
'
+
index
]
=
event
.
detail
.
__args__
;
}
else
{
extraObj
[
'
$
'
+
index
]
=
[
event
];
}
}
else
if
(
dataPath
.
indexOf
(
'
$event.
'
)
===
0
)
{
// $event.target.value
extraObj
[
'
$
'
+
index
]
=
vm
.
__get_value
(
dataPath
.
replace
(
'
$event.
'
,
''
),
event
);
}
else
{
...
...
packages/uni-mp-toutiao/dist/index.js
浏览文件 @
1b973289
...
...
@@ -391,8 +391,9 @@ var previewImage = {
};
// 不支持的 API 列表
const
todos
=
[
'
preloadPage
'
,
const
todos
=
[
'
preloadPage
'
,
'
unPreloadPage
'
,
'
loadSubPackage
'
// 'createCameraContext',
// 'createLivePlayerContext',
...
...
@@ -450,7 +451,7 @@ const todos = [
// 'setEnableDebug',
// 'onWindowResize',
// 'offWindowResize',
// 'createOffscreenCanvas',
// 'createOffscreenCanvas',
// 'vibrate'
];
...
...
@@ -544,7 +545,7 @@ const protocols = {
timeout
:
false
}
},
requestPayment
:
{
requestPayment
:
{
name
:
tt
.
pay
?
'
pay
'
:
'
requestPayment
'
,
args
:
{
orderInfo
:
tt
.
pay
?
'
orderInfo
'
:
'
data
'
...
...
@@ -1071,7 +1072,18 @@ function getExtraValue (vm, dataPathsArray) {
const
propPath
=
dataPathArray
[
1
];
const
valuePath
=
dataPathArray
[
3
];
const
vFor
=
dataPath
?
vm
.
__get_value
(
dataPath
,
context
)
:
context
;
let
vFor
;
if
(
Number
.
isInteger
(
dataPath
))
{
vFor
=
dataPath
;
}
else
if
(
!
dataPath
)
{
vFor
=
context
;
}
else
if
(
typeof
dataPath
===
'
string
'
&&
dataPath
)
{
if
(
dataPath
.
indexOf
(
'
#s#
'
)
===
0
)
{
vFor
=
dataPath
.
substr
(
3
);
}
else
{
vFor
=
vm
.
__get_value
(
dataPath
,
context
);
}
}
if
(
Number
.
isInteger
(
vFor
))
{
context
=
value
;
...
...
@@ -1121,6 +1133,12 @@ function processEventExtra (vm, extra, event) {
}
else
{
if
(
dataPath
===
'
$event
'
)
{
// $event
extraObj
[
'
$
'
+
index
]
=
event
;
}
else
if
(
dataPath
===
'
arguments
'
)
{
if
(
event
.
detail
&&
event
.
detail
.
__args__
)
{
extraObj
[
'
$
'
+
index
]
=
event
.
detail
.
__args__
;
}
else
{
extraObj
[
'
$
'
+
index
]
=
[
event
];
}
}
else
if
(
dataPath
.
indexOf
(
'
$event.
'
)
===
0
)
{
// $event.target.value
extraObj
[
'
$
'
+
index
]
=
vm
.
__get_value
(
dataPath
.
replace
(
'
$event.
'
,
''
),
event
);
}
else
{
...
...
packages/uni-mp-weixin/dist/index.js
浏览文件 @
1b973289
...
...
@@ -411,8 +411,9 @@ const protocols = {
}
};
const
todos
=
[
'
vibrate
'
,
'
preloadPage
'
,
'
vibrate
'
,
'
preloadPage
'
,
'
unPreloadPage
'
,
'
loadSubPackage
'
];
const
canIUses
=
[];
...
...
@@ -936,7 +937,18 @@ function getExtraValue (vm, dataPathsArray) {
const
propPath
=
dataPathArray
[
1
];
const
valuePath
=
dataPathArray
[
3
];
const
vFor
=
dataPath
?
vm
.
__get_value
(
dataPath
,
context
)
:
context
;
let
vFor
;
if
(
Number
.
isInteger
(
dataPath
))
{
vFor
=
dataPath
;
}
else
if
(
!
dataPath
)
{
vFor
=
context
;
}
else
if
(
typeof
dataPath
===
'
string
'
&&
dataPath
)
{
if
(
dataPath
.
indexOf
(
'
#s#
'
)
===
0
)
{
vFor
=
dataPath
.
substr
(
3
);
}
else
{
vFor
=
vm
.
__get_value
(
dataPath
,
context
);
}
}
if
(
Number
.
isInteger
(
vFor
))
{
context
=
value
;
...
...
@@ -986,6 +998,12 @@ function processEventExtra (vm, extra, event) {
}
else
{
if
(
dataPath
===
'
$event
'
)
{
// $event
extraObj
[
'
$
'
+
index
]
=
event
;
}
else
if
(
dataPath
===
'
arguments
'
)
{
if
(
event
.
detail
&&
event
.
detail
.
__args__
)
{
extraObj
[
'
$
'
+
index
]
=
event
.
detail
.
__args__
;
}
else
{
extraObj
[
'
$
'
+
index
]
=
[
event
];
}
}
else
if
(
dataPath
.
indexOf
(
'
$event.
'
)
===
0
)
{
// $event.target.value
extraObj
[
'
$
'
+
index
]
=
vm
.
__get_value
(
dataPath
.
replace
(
'
$event.
'
,
''
),
event
);
}
else
{
...
...
packages/uni-quickapp-native/dist/vue.dev.js
浏览文件 @
1b973289
此差异已折叠。
点击以展开。
packages/uni-quickapp-native/dist/vue.prod.js
浏览文件 @
1b973289
此差异已折叠。
点击以展开。
packages/uni-quickapp-webview/dist/index.js
浏览文件 @
1b973289
...
...
@@ -395,6 +395,7 @@ const protocols = {
};
const
todos
=
[
'
preloadPage
'
,
'
unPreloadPage
'
,
'
loadSubPackage
'
];
const
canIUses
=
[];
...
...
@@ -921,7 +922,18 @@ function getExtraValue (vm, dataPathsArray) {
const
propPath
=
dataPathArray
[
1
];
const
valuePath
=
dataPathArray
[
3
];
const
vFor
=
dataPath
?
vm
.
__get_value
(
dataPath
,
context
)
:
context
;
let
vFor
;
if
(
Number
.
isInteger
(
dataPath
))
{
vFor
=
dataPath
;
}
else
if
(
!
dataPath
)
{
vFor
=
context
;
}
else
if
(
typeof
dataPath
===
'
string
'
&&
dataPath
)
{
if
(
dataPath
.
indexOf
(
'
#s#
'
)
===
0
)
{
vFor
=
dataPath
.
substr
(
3
);
}
else
{
vFor
=
vm
.
__get_value
(
dataPath
,
context
);
}
}
if
(
Number
.
isInteger
(
vFor
))
{
context
=
value
;
...
...
@@ -971,6 +983,12 @@ function processEventExtra (vm, extra, event) {
}
else
{
if
(
dataPath
===
'
$event
'
)
{
// $event
extraObj
[
'
$
'
+
index
]
=
event
;
}
else
if
(
dataPath
===
'
arguments
'
)
{
if
(
event
.
detail
&&
event
.
detail
.
__args__
)
{
extraObj
[
'
$
'
+
index
]
=
event
.
detail
.
__args__
;
}
else
{
extraObj
[
'
$
'
+
index
]
=
[
event
];
}
}
else
if
(
dataPath
.
indexOf
(
'
$event.
'
)
===
0
)
{
// $event.target.value
extraObj
[
'
$
'
+
index
]
=
vm
.
__get_value
(
dataPath
.
replace
(
'
$event.
'
,
''
),
event
);
}
else
{
...
...
packages/uni-template-compiler/__tests__/compiler-extra.spec.js
浏览文件 @
1b973289
...
...
@@ -319,6 +319,14 @@ describe('mp:compiler-extra', () => {
</view>`
,
'
<view><block wx:for="{{list[idx]}}" wx:for-item="item" wx:for-index="__i0__" wx:key="id"><view data-event-opts="{{[[
\'
tap
\'
,[[
\'
m1
\'
,[
\'
$0
\'
],[[[
\'
list.
\'
+idx+
\'\'
,
\'
id
\'
,item.id]]]]]]]}}" class="mid-item-title" bindtap="__e"><view data-event-opts="{{[[
\'
tap
\'
,[[
\'
m2
\'
,[
\'
$0
\'
],[[[
\'
list.
\'
+idx+
\'\'
,
\'
id
\'
,item.id]]]]]]]}}" class="mid-item-icon" catchtap="__e"></view></view></block></view>
'
)
assertCodegen
(
'
<view><view class="item" v-for="i in
\'
abc
\'
" :key="i" @click="func(i)"></view></view>
'
,
'
<view><block wx:for="abc" wx:for-item="i" wx:for-index="__i0__" wx:key="*this"><view data-event-opts="{{[[
\'
tap
\'
,[[
\'
func
\'
,[
\'
$0
\'
],[[[
\'
#s#abc
\'
,
\'\'
,__i0__]]]]]]]}}" class="item" bindtap="__e"></view></block></view>
'
)
assertCodegen
(
'
<view><view class="item" v-for="i in 5" :key="i" @click="func(i)"></view></view>
'
,
'
<view><block wx:for="{{5}}" wx:for-item="i" wx:for-index="__i0__" wx:key="*this"><view data-event-opts="{{[[
\'
tap
\'
,[[
\'
func
\'
,[
\'
$0
\'
],[[[5,
\'\'
,__i0__]]]]]]]}}" class="item" bindtap="__e"></view></block></view>
'
)
})
it
(
'
generate class binding
'
,
()
=>
{
...
...
packages/uni-template-compiler/lib/script/traverse/render-list.js
浏览文件 @
1b973289
...
...
@@ -10,7 +10,7 @@ const {
getMapCallExpression
}
=
require
(
'
./statements
'
)
const
{
const
{
hasOwn
,
genCode
,
traverseKey
,
...
...
@@ -25,8 +25,8 @@ const origVisitor = {
Identifier
(
path
)
{
if
(
!
path
.
node
.
$mpProcessed
&&
path
.
node
.
name
===
this
.
forItem
&&
path
.
isReferencedIdentifier
()
path
.
node
.
name
===
this
.
forItem
&&
path
.
isReferencedIdentifier
()
)
{
const
forItemIdentifier
=
t
.
identifier
(
this
.
forItem
)
forItemIdentifier
.
$mpProcessed
=
true
...
...
@@ -61,7 +61,10 @@ function replaceRefrence (forItem, code) {
}
function
getForExtra
(
forItem
,
forIndex
,
path
,
state
)
{
let
forCode
=
genCode
(
processMemberExpression
(
path
.
node
.
arguments
[
0
],
state
),
true
)
const
arg0
=
path
.
node
.
arguments
[
0
]
const
isNumeric
=
t
.
isNumericLiteral
(
arg0
)
const
isString
=
t
.
isStringLiteral
(
arg0
)
let
forCode
=
genCode
(
processMemberExpression
(
arg0
,
state
),
true
)
const
forKey
=
traverseKey
(
path
.
node
)
const
origForKeyCode
=
t
.
isIdentifier
(
forKey
)
&&
forKey
.
name
...
...
@@ -80,11 +83,17 @@ function getForExtra (forItem, forIndex, path, state) {
forExtraElements
.
push
(...
scoped
.
forExtra
)
}
}
let
forCodeElem
=
t
.
stringLiteral
(
forCode
)
if
(
isNumeric
)
{
forCodeElem
=
t
.
numericLiteral
(
arg0
.
value
)
}
else
if
(
isString
)
{
forCodeElem
=
t
.
stringLiteral
(
'
#s#
'
+
forCode
)
}
if
(
forItem
===
origForKeyCode
)
{
// 以自身为 key,则依据 forIndex 查找 ['list','',__i0__],['list','',index]
forExtraElements
.
push
(
t
.
arrayExpression
(
[
t
.
stringLiteral
(
forCode
)
,
forCodeElem
,
t
.
stringLiteral
(
''
),
t
.
identifier
(
forIndex
)
]
...
...
@@ -94,7 +103,7 @@ function getForExtra (forItem, forIndex, path, state) {
forExtraElements
.
push
(
t
.
arrayExpression
(
[
t
.
stringLiteral
(
forCode
)
,
forCodeElem
,
t
.
stringLiteral
(
forIndex
===
forKeyCode
?
''
:
forKeyCode
),
forKey
||
t
.
identifier
(
forIndex
)
]
...
...
src/core/runtime/wrapper/util.js
浏览文件 @
1b973289
...
...
@@ -322,7 +322,18 @@ function getExtraValue (vm, dataPathsArray) {
const
propPath
=
dataPathArray
[
1
]
const
valuePath
=
dataPathArray
[
3
]
const
vFor
=
dataPath
?
vm
.
__get_value
(
dataPath
,
context
)
:
context
let
vFor
if
(
Number
.
isInteger
(
dataPath
))
{
vFor
=
dataPath
}
else
if
(
!
dataPath
)
{
vFor
=
context
}
else
if
(
typeof
dataPath
===
'
string
'
&&
dataPath
)
{
if
(
dataPath
.
indexOf
(
'
#s#
'
)
===
0
)
{
vFor
=
dataPath
.
substr
(
3
)
}
else
{
vFor
=
vm
.
__get_value
(
dataPath
,
context
)
}
}
if
(
Number
.
isInteger
(
vFor
))
{
context
=
value
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录