Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小浣熊撸代码
uni-app
提交
029032a7
U
uni-app
项目概览
小浣熊撸代码
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
029032a7
编写于
6月 12, 2020
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
差异文件
Merge commit '
c9f05f11
' into alpha
上级
fc6b5976
c9f05f11
变更
8
展开全部
显示空白变更内容
内联
并排
Showing
8 changed file
with
17 addition
and
7 deletion
+17
-7
packages/uni-app-plus/lib/uni.automator.js
packages/uni-app-plus/lib/uni.automator.js
+1
-1
packages/uni-template-compiler/__tests__/compiler-app-plus-extra.service.spec.js
...ompiler/__tests__/compiler-app-plus-extra.service.spec.js
+5
-1
packages/uni-template-compiler/lib/app/util.js
packages/uni-template-compiler/lib/app/util.js
+6
-0
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
+1
-1
packages/webpack-uni-mp-loader/lib/plugin/generate-component.js
...es/webpack-uni-mp-loader/lib/plugin/generate-component.js
+1
-1
packages/webpack-uni-mp-loader/lib/plugin/index-new.js
packages/webpack-uni-mp-loader/lib/plugin/index-new.js
+1
-1
packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.js
.../webpack-uni-pages-loader/lib/platforms/app-plus/index.js
+1
-1
types/UniViewJSBridge.d.ts
types/UniViewJSBridge.d.ts
+1
-1
未找到文件。
packages/uni-app-plus/lib/uni.automator.js
浏览文件 @
029032a7
"
use strict
"
;
function
t
(
t
){
return
t
&&
"
object
"
==
typeof
t
&&
"
default
"
in
t
?
t
.
default
:
t
}
var
e
=
t
(
require
(
"
fs
"
)),
s
=
t
(
require
(
"
debug
"
)),
i
=
t
(
require
(
"
postcss-selector-parser
"
)),
a
=
t
(
require
(
"
fs-extra
"
)),
r
=
t
(
require
(
"
licia/dateFormat
"
)),
n
=
require
(
"
path
"
),
o
=
require
(
"
util
"
);
function
c
(
t
){
t
.
walk
(
t
=>
{
if
(
"
tag
"
===
t
.
type
){
const
e
=
t
.
value
;
t
.
value
=
"
page
"
===
e
?
"
body
"
:
"
uni-
"
+
e
}})}
const
l
=
[
"
Page.getElement
"
,
"
Page.getElements
"
,
"
Element.getElement
"
,
"
Element.getElements
"
];
const
h
=
s
(
"
automator:launcher
"
),
u
=
o
.
promisify
(
e
.
readdir
),
p
=
o
.
promisify
(
e
.
stat
);
class
d
{
constructor
(
t
){
this
.
id
=
t
.
id
,
this
.
app
=
t
.
executablePath
,
this
.
appid
=
t
.
appid
||
"
HBuilder
"
,
this
.
package
=
t
.
package
||
"
io.dcloud.HBuilder
"
}
shouldPush
(){
return
this
.
exists
(
this
.
FILE_APP_SERVICE
).
then
(()
=>
(
h
(
`
${
r
(
"
yyyy-mm-dd HH:MM:ss:l
"
)}
${
this
.
FILE_APP_SERVICE
}
exists`
),
!
1
)).
catch
(()
=>
(
h
(
`
${
r
(
"
yyyy-mm-dd HH:MM:ss:l
"
)}
${
this
.
FILE_APP_SERVICE
}
not exists`
),
!
0
))}
push
(
t
){
return
async
function
t
(
e
){
const
s
=
await
u
(
e
);
return
(
await
Promise
.
all
(
s
.
map
(
async
s
=>
{
const
i
=
n
.
resolve
(
e
,
s
);
return
(
await
p
(
i
)).
isDirectory
()?
t
(
i
):
i
}))).
reduce
((
t
,
e
)
=>
t
.
concat
(
e
),[])}(
t
).
then
(
e
=>
{
const
s
=
e
.
map
(
e
=>
{
const
s
=
n
.
join
(
this
.
DIR_WWW
,
n
.
relative
(
t
,
e
));
return
h
(
`
${
r
(
"
yyyy-mm-dd HH:MM:ss:l
"
)}
push
${
e
}
${
s
}
`
),
this
.
pushFile
(
e
,
s
)});
return
Promise
.
all
(
s
)}).
then
(
t
=>!
0
)}
get
FILE_APP_SERVICE
(){
return
this
.
DIR_WWW
+
"
/app-service.js
"
}}
const
m
=
s
(
"
automator:simctl
"
);
class
y
extends
d
{
async
init
(){
const
t
=
require
(
"
node-simctl
"
).
Simctl
;
this
.
tool
=
new
t
({
udid
:
this
.
id
});
try
{
await
this
.
tool
.
bootDevice
()}
catch
(
t
){}
await
this
.
initSDCard
(),
m
(
`
${
r
(
"
yyyy-mm-dd HH:MM:ss:l
"
)}
init
${
this
.
id
}
`
)}
async
initSDCard
(){
const
t
=
(
await
this
.
tool
.
appInfo
(
this
.
package
)).
match
(
/DataContainer
\s
+=
\s
+"
(
.*
)
"/
);
if
(
!
t
)
return
Promise
.
resolve
(
""
);
this
.
sdcard
=
t
[
1
].
replace
(
"
file:
"
,
""
),
m
(
`
${
r
(
"
yyyy-mm-dd HH:MM:ss:l
"
)}
install
${
this
.
sdcard
}
`
)}
async
version
(){
return
Promise
.
resolve
(
this
.
sdcard
?
"
9.6.96
"
:
""
)}
async
install
(){
return
m
(
`
${
r
(
"
yyyy-mm-dd HH:MM:ss:l
"
)}
install
${
this
.
app
}
`
),
await
this
.
tool
.
installApp
(
this
.
app
),
await
this
.
initSDCard
(),
Promise
.
resolve
(
!
0
)}
async
start
(){
try
{
await
this
.
tool
.
terminateApp
(
this
.
package
),
await
this
.
tool
.
launchApp
(
this
.
package
)}
catch
(
t
){}
return
Promise
.
resolve
(
!
0
)}
async
exit
(){
return
await
this
.
tool
.
terminateApp
(
this
.
package
),
await
this
.
tool
.
shutdownDevice
(),
Promise
.
resolve
(
!
0
)}
async
captureScreenshot
(){
return
Promise
.
resolve
(
await
this
.
tool
.
getScreenshot
())}
exists
(
t
){
return
a
.
existsSync
(
t
)?
Promise
.
resolve
(
!
0
):
Promise
.
reject
(
Error
(
t
+
"
not exists
"
))}
pushFile
(
t
,
e
){
return
Promise
.
resolve
(
a
.
copySync
(
t
,
e
))}
get
DIR_WWW
(){
return
`
${
this
.
sdcard
}
/Documents/Pandora/apps/
${
this
.
appid
}
/www/`
}}
const
f
=
require
(
"
adbkit
"
),
w
=
s
(
"
automator:adb
"
);
class
M
extends
d
{
async
init
(){
if
(
this
.
tool
=
f
.
createClient
(),
!
this
.
id
){
const
t
=
await
this
.
tool
.
listDevices
();
if
(
!
t
.
length
)
throw
Error
(
"
Device not found
"
);
this
.
id
=
t
[
0
].
id
}
this
.
sdcard
=
(
await
this
.
shell
(
this
.
COMMAND_EXTERNAL
)).
trim
(),
w
(
`
${
r
(
"
yyyy-mm-dd HH:MM:ss:l
"
)}
init
${
this
.
id
}
${
this
.
sdcard
}
`
)}
version
(){
return
this
.
shell
(
this
.
COMMAND_VERSION
).
then
(
t
=>
{
const
e
=
t
.
match
(
/versionName=
(
.*
)
/
);
return
e
&&
e
.
length
>
1
?
e
[
1
]:
""
})}
install
(){
return
w
(
`
${
r
(
"
yyyy-mm-dd HH:MM:ss:l
"
)}
install
${
this
.
app
}
`
),
this
.
tool
.
install
(
this
.
id
,
this
.
app
).
then
(()
=>
this
.
init
())}
start
(){
return
this
.
exit
().
then
(()
=>
this
.
shell
(
this
.
COMMAND_START
))}
exit
(){
return
this
.
shell
(
this
.
COMMAND_STOP
)}
captureScreenshot
(){
return
this
.
tool
.
screencap
(
this
.
id
).
then
(
t
=>
new
Promise
(
e
=>
{
const
s
=
[];
t
.
on
(
"
data
"
,(
function
(
t
){
s
.
push
(
t
)})),
t
.
on
(
"
end
"
,(
function
(){
e
(
Buffer
.
concat
(
s
).
toString
(
"
base64
"
))}))}))}
exists
(
t
){
return
this
.
tool
.
stat
(
this
.
id
,
t
).
then
(()
=>!
1
).
catch
(()
=>!
0
)}
pushFile
(
t
,
e
){
return
this
.
tool
.
push
(
this
.
id
,
t
,
e
)}
shell
(
t
){
return
w
(
`
${
r
(
"
yyyy-mm-dd HH:MM:ss:l
"
)}
SEND ►
${
t
}
`
),
this
.
tool
.
shell
(
this
.
id
,
t
).
then
(
f
.
util
.
readAll
).
then
(
t
=>
{
const
e
=
t
.
toString
();
return
w
(
`
${
r
(
"
yyyy-mm-dd HH:MM:ss:l
"
)}
◀ RECV
${
e
}
`
),
e
})}
get
DIR_WWW
(){
return
`
${
this
.
sdcard
}
/Android/data/
${
this
.
package
}
/apps/
${
this
.
appid
}
/www`
}
get
COMMAND_EXTERNAL
(){
return
"
echo $EXTERNAL_STORAGE
"
}
get
COMMAND_VERSION
(){
return
"
dumpsys package
"
+
this
.
package
}
get
COMMAND_STOP
(){
return
"
am force-stop
"
+
this
.
package
}
get
COMMAND_START
(){
return
`am start -n
${
this
.
package
}
/io.dcloud.PandoraEntry --es
${
this
.
appid
}
--ez needUpdateApp false --ez reload true`
}}
const
E
=
s
(
"
automator:devtool
"
);
let
g
,
P
=!
1
;
const
A
=
{
"
Tool.close
"
:{
reflect
:
async
()
=>
{}},
"
App.exit
"
:{
reflect
:
async
()
=>
g
.
exit
()},
"
App.enableLog
"
:{
reflect
:()
=>
Promise
.
resolve
()},
"
App.captureScreenshot
"
:{
reflect
:
async
(
t
,
e
)
=>
{
const
s
=
await
g
.
captureScreenshot
(
e
);
return
E
(
"
App.captureScreenshot
"
+
s
.
length
),{
data
:
s
}}}};
!
function
(
t
){
l
.
forEach
(
e
=>
{
t
[
e
]
=
function
(
t
){
return
{
reflect
:
async
(
e
,
s
)
=>
e
(
t
,
s
,
!
1
),
params
:
t
=>
(
t
.
selector
&&
(
t
.
selector
=
i
(
c
).
processSync
(
t
.
selector
)),
t
)}}(
e
)})}(
A
);
const
$
=
{
devtools
:{
name
:
"
App
"
,
paths
:[],
required
:[
"
manifest.json
"
,
"
app-service.js
"
],
validate
:
async
function
(
t
,
s
){
if
(
t
.
platform
=
(
t
.
platform
||
process
.
env
.
UNI_OS_NAME
).
toLocaleLowerCase
(),
Object
.
assign
(
t
,
t
[
t
.
platform
]),
g
=
function
(
t
,
e
){
return
"
ios
"
===
t
?
new
y
(
e
):
new
M
(
e
)}(
t
.
platform
,
t
),
await
g
.
init
(),
!
await
g
.
version
()){
if
(
!
t
.
executablePath
)
throw
Error
(
`app-plus->
${
t
.
platform
}
->executablePath is not provided`
);
if
(
!
e
.
existsSync
(
t
.
executablePath
))
throw
Error
(
t
.
executablePath
+
"
not exists
"
);
P
=!
0
}
return
t
},
create
:
async
function
(
t
,
e
,
s
){
P
&&
await
g
.
install
(),(
s
.
compiled
||
await
g
.
shouldPush
())
&&
await
g
.
push
(
t
),
await
g
.
start
()}},
adapter
:
A
};
module
.
exports
=
$
;
"
use strict
"
;
function
t
(
t
){
return
t
&&
"
object
"
==
typeof
t
&&
"
default
"
in
t
?
t
.
default
:
t
}
var
e
=
t
(
require
(
"
fs
"
)),
s
=
t
(
require
(
"
debug
"
)),
i
=
t
(
require
(
"
postcss-selector-parser
"
)),
r
=
t
(
require
(
"
fs-extra
"
)),
a
=
t
(
require
(
"
licia/dateFormat
"
)),
n
=
require
(
"
path
"
),
o
=
require
(
"
util
"
);
function
c
(
t
){
t
.
walk
(
t
=>
{
if
(
"
tag
"
===
t
.
type
){
const
e
=
t
.
value
;
t
.
value
=
"
page
"
===
e
?
"
body
"
:
"
uni-
"
+
e
}})}
const
l
=
[
"
Page.getElement
"
,
"
Page.getElements
"
,
"
Element.getElement
"
,
"
Element.getElements
"
];
const
h
=
s
(
"
automator:launcher
"
),
u
=
o
.
promisify
(
e
.
readdir
),
p
=
o
.
promisify
(
e
.
stat
);
class
d
{
constructor
(
t
){
this
.
id
=
t
.
id
,
this
.
app
=
t
.
executablePath
,
this
.
appid
=
t
.
appid
||
"
HBuilder
"
,
this
.
package
=
t
.
package
||
"
io.dcloud.HBuilder
"
}
shouldPush
(){
return
this
.
exists
(
this
.
FILE_APP_SERVICE
).
then
(()
=>
(
h
(
`
${
a
(
"
yyyy-mm-dd HH:MM:ss:l
"
)}
${
this
.
FILE_APP_SERVICE
}
exists`
),
!
1
)).
catch
(()
=>
(
h
(
`
${
a
(
"
yyyy-mm-dd HH:MM:ss:l
"
)}
${
this
.
FILE_APP_SERVICE
}
not exists`
),
!
0
))}
push
(
t
){
return
async
function
t
(
e
){
const
s
=
await
u
(
e
);
return
(
await
Promise
.
all
(
s
.
map
(
async
s
=>
{
const
i
=
n
.
resolve
(
e
,
s
);
return
(
await
p
(
i
)).
isDirectory
()?
t
(
i
):
i
}))).
reduce
((
t
,
e
)
=>
t
.
concat
(
e
),[])}(
t
).
then
(
e
=>
{
const
s
=
e
.
map
(
e
=>
{
const
s
=
n
.
join
(
this
.
DIR_WWW
,
n
.
relative
(
t
,
e
));
return
h
(
`
${
a
(
"
yyyy-mm-dd HH:MM:ss:l
"
)}
push
${
e
}
${
s
}
`
),
this
.
pushFile
(
e
,
s
)});
return
Promise
.
all
(
s
)}).
then
(
t
=>!
0
)}
get
FILE_APP_SERVICE
(){
return
this
.
DIR_WWW
+
"
/app-service.js
"
}}
const
m
=
s
(
"
automator:simctl
"
);
class
y
extends
d
{
async
init
(){
const
t
=
require
(
"
node-simctl
"
).
Simctl
;
this
.
tool
=
new
t
({
udid
:
this
.
id
});
try
{
await
this
.
tool
.
bootDevice
()}
catch
(
t
){}
await
this
.
initSDCard
(),
m
(
`
${
a
(
"
yyyy-mm-dd HH:MM:ss:l
"
)}
init
${
this
.
id
}
`
)}
async
initSDCard
(){
const
t
=
(
await
this
.
tool
.
appInfo
(
this
.
package
)).
match
(
/DataContainer
\s
+=
\s
+"
(
.*
)
"/
);
if
(
!
t
)
return
Promise
.
resolve
(
""
);
this
.
sdcard
=
t
[
1
].
replace
(
"
file:
"
,
""
),
m
(
`
${
a
(
"
yyyy-mm-dd HH:MM:ss:l
"
)}
install
${
this
.
sdcard
}
`
)}
async
version
(){
return
Promise
.
resolve
(
this
.
sdcard
?
"
9.6.96
"
:
""
)}
async
install
(){
return
m
(
`
${
a
(
"
yyyy-mm-dd HH:MM:ss:l
"
)}
install
${
this
.
app
}
`
),
await
this
.
tool
.
installApp
(
this
.
app
),
await
this
.
initSDCard
(),
Promise
.
resolve
(
!
0
)}
async
start
(){
try
{
await
this
.
tool
.
terminateApp
(
this
.
package
),
await
this
.
tool
.
launchApp
(
this
.
package
)}
catch
(
t
){}
return
Promise
.
resolve
(
!
0
)}
async
exit
(){
return
await
this
.
tool
.
terminateApp
(
this
.
package
),
await
this
.
tool
.
shutdownDevice
(),
Promise
.
resolve
(
!
0
)}
async
captureScreenshot
(){
return
Promise
.
resolve
(
await
this
.
tool
.
getScreenshot
())}
exists
(
t
){
return
r
.
existsSync
(
t
)?
Promise
.
resolve
(
!
0
):
Promise
.
reject
(
Error
(
t
+
"
not exists
"
))}
pushFile
(
t
,
e
){
return
Promise
.
resolve
(
r
.
copySync
(
t
,
e
))}
get
DIR_WWW
(){
return
`
${
this
.
sdcard
}
/Documents/Pandora/apps/
${
this
.
appid
}
/www/`
}}
const
f
=
require
(
"
adbkit
"
),
w
=
s
(
"
automator:adb
"
);
class
M
extends
d
{
async
init
(){
if
(
this
.
tool
=
f
.
createClient
(),
!
this
.
id
){
const
t
=
await
this
.
tool
.
listDevices
();
if
(
!
t
.
length
)
throw
Error
(
"
Device not found
"
);
this
.
id
=
t
[
0
].
id
}
this
.
sdcard
=
(
await
this
.
shell
(
this
.
COMMAND_EXTERNAL
)).
trim
(),
w
(
`
${
a
(
"
yyyy-mm-dd HH:MM:ss:l
"
)}
init
${
this
.
id
}
${
this
.
sdcard
}
`
)}
version
(){
return
this
.
shell
(
this
.
COMMAND_VERSION
).
then
(
t
=>
{
const
e
=
t
.
match
(
/versionName=
(
.*
)
/
);
return
e
&&
e
.
length
>
1
?
e
[
1
]:
""
})}
install
(){
return
w
(
`
${
a
(
"
yyyy-mm-dd HH:MM:ss:l
"
)}
install
${
this
.
app
}
`
),
this
.
tool
.
install
(
this
.
id
,
this
.
app
).
then
(()
=>
this
.
init
())}
start
(){
return
this
.
exit
().
then
(()
=>
this
.
shell
(
this
.
COMMAND_START
))}
exit
(){
return
this
.
shell
(
this
.
COMMAND_STOP
)}
captureScreenshot
(){
return
this
.
tool
.
screencap
(
this
.
id
).
then
(
t
=>
new
Promise
(
e
=>
{
const
s
=
[];
t
.
on
(
"
data
"
,(
function
(
t
){
s
.
push
(
t
)})),
t
.
on
(
"
end
"
,(
function
(){
e
(
Buffer
.
concat
(
s
).
toString
(
"
base64
"
))}))}))}
exists
(
t
){
return
this
.
tool
.
stat
(
this
.
id
,
t
)}
pushFile
(
t
,
e
){
return
this
.
tool
.
push
(
this
.
id
,
t
,
e
)}
shell
(
t
){
return
w
(
`
${
a
(
"
yyyy-mm-dd HH:MM:ss:l
"
)}
SEND ►
${
t
}
`
),
this
.
tool
.
shell
(
this
.
id
,
t
).
then
(
f
.
util
.
readAll
).
then
(
t
=>
{
const
e
=
t
.
toString
();
return
w
(
`
${
a
(
"
yyyy-mm-dd HH:MM:ss:l
"
)}
◀ RECV
${
e
}
`
),
e
})}
get
DIR_WWW
(){
return
`
${
this
.
sdcard
}
/Android/data/
${
this
.
package
}
/apps/
${
this
.
appid
}
/www`
}
get
COMMAND_EXTERNAL
(){
return
"
echo $EXTERNAL_STORAGE
"
}
get
COMMAND_VERSION
(){
return
"
dumpsys package
"
+
this
.
package
}
get
COMMAND_STOP
(){
return
"
am force-stop
"
+
this
.
package
}
get
COMMAND_START
(){
return
`am start -n
${
this
.
package
}
/io.dcloud.PandoraEntry --es
${
this
.
appid
}
--ez needUpdateApp false --ez reload true`
}}
const
E
=
s
(
"
automator:devtool
"
);
let
g
,
P
=!
1
;
const
A
=
{
"
Tool.close
"
:{
reflect
:
async
()
=>
{}},
"
App.exit
"
:{
reflect
:
async
()
=>
g
.
exit
()},
"
App.enableLog
"
:{
reflect
:()
=>
Promise
.
resolve
()},
"
App.captureScreenshot
"
:{
reflect
:
async
(
t
,
e
)
=>
{
const
s
=
await
g
.
captureScreenshot
(
e
);
return
E
(
"
App.captureScreenshot
"
+
s
.
length
),{
data
:
s
}}}};
!
function
(
t
){
l
.
forEach
(
e
=>
{
t
[
e
]
=
function
(
t
){
return
{
reflect
:
async
(
e
,
s
)
=>
e
(
t
,
s
,
!
1
),
params
:
t
=>
(
t
.
selector
&&
(
t
.
selector
=
i
(
c
).
processSync
(
t
.
selector
)),
t
)}}(
e
)})}(
A
);
const
$
=
{
devtools
:{
name
:
"
App
"
,
paths
:[],
required
:[
"
manifest.json
"
,
"
app-service.js
"
],
validate
:
async
function
(
t
,
s
){
if
(
t
.
platform
=
(
t
.
platform
||
process
.
env
.
UNI_OS_NAME
).
toLocaleLowerCase
(),
Object
.
assign
(
t
,
t
[
t
.
platform
]),
g
=
function
(
t
,
e
){
return
"
ios
"
===
t
?
new
y
(
e
):
new
M
(
e
)}(
t
.
platform
,
t
),
await
g
.
init
(),
!
await
g
.
version
()){
if
(
!
t
.
executablePath
)
throw
Error
(
`app-plus->
${
t
.
platform
}
->executablePath is not provided`
);
if
(
!
e
.
existsSync
(
t
.
executablePath
))
throw
Error
(
t
.
executablePath
+
"
not exists
"
);
P
=!
0
}
return
t
},
create
:
async
function
(
t
,
e
,
s
){
P
&&
await
g
.
install
(),(
s
.
compiled
||
await
g
.
shouldPush
())
&&
await
g
.
push
(
t
),
await
g
.
start
()}},
adapter
:
A
};
module
.
exports
=
$
;
packages/uni-template-compiler/__tests__/compiler-app-plus-extra.service.spec.js
浏览文件 @
029032a7
...
...
@@ -87,6 +87,10 @@ describe('codegen', () => {
})
it
(
'
generate v-slot
'
,
()
=>
{
assertCodegen
(
'
<view><view v-for="(el, ind) in list" :key="ind"><test-component :list="el"><template #test="{ sendList }"><view v-for="(item, index) in sendList" :key="index"></view></template></test-component></view></view>
'
,
`with(this){return _c('view',_l((_$s(1,'f',{forItems:list})),function(el,ind,$20,$30){return _c('view',{key:_$s(1,'f',{forIndex:$20,key:ind})},[_c('test-component',{attrs:{"list":el,"_i":("2-"+$30)},scopedSlots:_u([{key:"test",fn:function({ sendList }, _svm, _si){return _l((_svm._$s((4+'-'+$30+"-"+_si),'f',{forItems:sendList})),function(item,index,$21,$31){return _c('view',{key:_svm._$s((4+'-'+$30+"-"+_si),'f',{forIndex:$21,key:index}),attrs:{"_i":(("4-"+_si)+$30+'-'+$31)}})})}}],null,true)})],1)}),0)}`
)
assertCodegen
(
'
<current-user v-slot="{ user }">{{ user.firstName }}</current-user>
'
,
`with(this){return _c('current-user',{attrs:{"_i":0},scopedSlots:_u([{key:"default",fn:function({ user }, _svm, _si){return [_v((_svm._$s(("0-"+_si),'t0-0',_s(user.firstName))))]}}])})}`
...
...
packages/uni-template-compiler/lib/app/util.js
浏览文件 @
029032a7
...
...
@@ -65,6 +65,9 @@ function updateEleId (el, it, state) {
el
.
ifConditions
&&
el
.
ifConditions
.
forEach
((
con
,
index
)
=>
{
index
!==
0
&&
updateEleId
(
con
.
block
,
it
,
state
)
})
el
.
scopedSlots
&&
Object
.
values
(
el
.
scopedSlots
).
forEach
((
slot
,
index
)
=>
{
updateEleId
(
slot
,
it
,
state
)
})
}
function
getBindingAttr
(
el
,
name
)
{
...
...
@@ -119,6 +122,9 @@ function getNewId (id, it) {
function
updateScopedSlotEleId
(
el
,
state
)
{
// TODO 暂不考虑 scopedSlot 嵌套情况
if
(
el
.
slotScope
)
{
const
getNewId
=
function
(
id
,
it
)
{
return
Number
.
isInteger
(
id
)
?
`("
${
id
}
-"+
${
it
}
)`
:
`(
${
id
}
+"-"+
${
it
}
)`
}
const
updateEleId
=
function
(
el
)
{
if
(
el
.
type
!==
1
)
{
return
...
...
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
浏览文件 @
029032a7
此差异已折叠。
点击以展开。
packages/webpack-uni-mp-loader/lib/plugin/generate-component.js
浏览文件 @
029032a7
...
...
@@ -111,7 +111,7 @@ module.exports = function generateComponent (compilation) {
}
})
}
if
(
process
.
env
.
UNI_FEATURE_OBSOLETE
!==
false
)
{
if
(
process
.
env
.
UNI_FEATURE_OBSOLETE
!==
'
false
'
)
{
if
(
lastComponents
.
length
)
{
for
(
const
name
of
lastComponents
)
{
if
(
!
curComponents
.
includes
(
name
))
{
...
...
packages/webpack-uni-mp-loader/lib/plugin/index-new.js
浏览文件 @
029032a7
...
...
@@ -44,7 +44,7 @@ function addSubPackagesRequire (compilation) {
assetsKeys
.
forEach
(
name
=>
{
if
(
path
.
extname
(
name
)
===
'
.js
'
&&
name
.
indexOf
(
root
)
===
0
&&
name
.
indexOf
(
root
+
'
/
'
)
===
0
&&
name
!==
subPackageVendorPath
)
{
const
source
=
...
...
packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.js
浏览文件 @
029032a7
...
...
@@ -503,7 +503,7 @@ module.exports = function (pagesJson, userManifestJson) {
}
if
(
process
.
env
.
UNI_USING_V3
||
process
.
env
.
UNI_USING_V3_NATIVE
)
{
if
(
process
.
env
.
UNI_USING_V3
)
{
if
(
process
.
env
.
UNI_USING_V3
&&
process
.
env
.
UNI_OPT_SUBPACKAGES
)
{
appJson
.
subPackages
=
subPackages
}
return
require
(
'
./index.v3
'
)(
appJson
,
manifestJson
,
{
...
...
types/UniViewJSBridge.d.ts
浏览文件 @
029032a7
...
...
@@ -47,7 +47,7 @@ export interface UniViewJSBridge {
* @param args
* @param pageId
*/
subscribeHandler
(
event
:
string
,
args
:
any
)
subscribeHandler
(
event
:
string
,
args
:
any
,
pageId
:
number
);
/**
* 向 Service 层发送事件
* @param event
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录