Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Velpro187
uni-app
提交
66527fa0
U
uni-app
项目概览
Velpro187
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
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,发现更多精彩内容 >>
提交
66527fa0
编写于
12月 01, 2020
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(mp): init parent with scoped slots
上级
6380bda2
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
7237 addition
and
334 deletion
+7237
-334
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+7208
-327
packages/uni-template-compiler/__tests__/compiler-mp-weixin.spec.js
...ni-template-compiler/__tests__/compiler-mp-weixin.spec.js
+17
-3
packages/uni-template-compiler/__tests__/demo.js
packages/uni-template-compiler/__tests__/demo.js
+1
-1
packages/uni-template-compiler/lib/template/traverse.js
packages/uni-template-compiler/lib/template/traverse.js
+8
-3
src/platforms/app-plus/service/framework/config.js
src/platforms/app-plus/service/framework/config.js
+3
-0
未找到文件。
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
66527fa0
此差异已折叠。
点击以展开。
packages/uni-template-compiler/__tests__/compiler-mp-weixin.spec.js
浏览文件 @
66527fa0
...
...
@@ -35,6 +35,17 @@ describe('mp:compiler-mp-weixin', () => {
expect
(
res
.
generic
[
0
]).
toBe
(
'
test-foo-default
'
)
}
)
assertCodegen
(
'
<uni-clientdb v-slot:default="{data}"><uni-table><uni-tr><uni-th align="center">日期</uni-th></uni-tr></uni-table></uni-clientdb>
'
,
'
<uni-clientdb generic:scoped-slots-default="test-uni-clientdb-default" data-vue-generic="scoped" vue-id="551070e6-1" bind:__l="__l" vue-slots="{{[
\'
default
\'
]}}"></uni-clientdb>
'
,
function
(
res
)
{
expect
(
res
.
generic
[
0
]).
toBe
(
'
test-uni-clientdb-default
'
)
const
wxmlKey
=
Object
.
keys
(
res
.
files
)[
0
]
expect
(
res
.
files
[
wxmlKey
]).
toBe
(
'
<uni-table vue-id="551070e6-2" bind:__l="__l" vue-slots="{{[
\'
default
\'
]}}"><uni-tr vue-id="{{(
\'
551070e6-3
\'
)+
\'
,
\'
+(
\'
551070e6-2
\'
)}}" bind:__l="__l" vue-slots="{{[
\'
default
\'
]}}"><uni-th vue-id="{{(
\'
551070e6-4
\'
)+
\'
,
\'
+(
\'
551070e6-3
\'
)}}" align="center" bind:__l="__l" vue-slots="{{[
\'
default
\'
]}}">日期</uni-th></uni-tr></uni-table>
'
)
}
)
})
it
(
'
generate named scoped slot
'
,
()
=>
{
...
...
@@ -130,8 +141,11 @@ describe('mp:compiler-mp-weixin', () => {
'
<template v-for="(item, key) in { list1, list2 }"></template>
'
,
'
<block wx:for="{{({list1,list2})}}" wx:for-item="item" wx:for-index="key"></block>
'
)
assertCodegen
(
'
<test :obj="{x:0}"></test>
'
,
'
<test vue-id="551070e6-1" obj="{{({x:0})}}" bind:__l="__l"></test>
'
)
assertCodegen
(
'
<test :obj="{
\'
x
\'
:0}"></test>
'
,
'
<test vue-id="551070e6-1" obj="{{$root.a0}}" bind:__l="__l"></test>
'
,
'
with(this){var a0={"x":0};$mp.data=Object.assign({},{$root:{a0:a0}})}
'
)
assertCodegen
(
'
<test :obj="{x:0}"></test>
'
,
'
<test vue-id="551070e6-1" obj="{{({x:0})}}" bind:__l="__l"></test>
'
)
assertCodegen
(
'
<test :obj="{
\'
x
\'
:0}"></test>
'
,
'
<test vue-id="551070e6-1" obj="{{$root.a0}}" bind:__l="__l"></test>
'
,
'
with(this){var a0={"x":0};$mp.data=Object.assign({},{$root:{a0:a0}})}
'
)
assertCodegen
(
'
<test :obj="{x:{x:0}}"></test>
'
,
'
<test vue-id="551070e6-1" obj="{{$root.a0}}" bind:__l="__l"></test>
'
,
'
with(this){var a0={x:{x:0}};$mp.data=Object.assign({},{$root:{a0:a0}})}
'
...
...
@@ -144,4 +158,4 @@ describe('mp:compiler-mp-weixin', () => {
'
<test data-custom-hidden="{{!(shown)}}" vue-id="551070e6-1" bind:__l="__l" vue-slots="{{[
\'
default
\'
]}}">hello world</test>
'
)
})
})
})
packages/uni-template-compiler/__tests__/demo.js
浏览文件 @
66527fa0
...
...
@@ -22,7 +22,7 @@ const res = compiler.compile(
<custom data-a="1" :data-b="b"></custom>
`
,
{
miniprogram
:
true
,
resourcePath
:
'
/User/fxy/Documents/
test.wxml
'
,
resourcePath
:
'
test.wxml
'
,
isReservedTag
:
function
(
tag
)
{
return
true
},
...
...
packages/uni-template-compiler/lib/template/traverse.js
浏览文件 @
66527fa0
...
...
@@ -369,7 +369,11 @@ function traverseResolveScopedSlots (callExprNode, state) {
resourcePath
,
paramExprNode
,
returnExprNodes
,
traverseExpr
,
traverseExpr
:
function
(
exprNode
,
state
)
{
const
ast
=
traverseExpr
(
exprNode
,
state
)
initParent
(
ast
)
return
ast
},
normalizeChildren
},
state
...
...
@@ -416,7 +420,8 @@ function traverseRenderList (callExprNode, state) {
const
children
=
traverseExpr
(
forReturnStatementArgument
,
state
)
// 支付宝小程序在 block 标签上使用 key 时顺序不能保障
if
(
state
.
options
.
platform
.
name
===
'
mp-alipay
'
&&
t
.
isCallExpression
(
forReturnStatementArgument
)
&&
children
&&
children
.
type
)
{
if
(
state
.
options
.
platform
.
name
===
'
mp-alipay
'
&&
t
.
isCallExpression
(
forReturnStatementArgument
)
&&
children
&&
children
.
type
)
{
children
.
attr
=
children
.
attr
||
{}
Object
.
assign
(
children
.
attr
,
attr
)
return
children
...
...
@@ -483,4 +488,4 @@ function traverseCreateTextVNode (callExprNode, state) {
function
traverseCreateEmptyVNode
(
callExprNode
,
state
)
{
return
''
}
}
src/platforms/app-plus/service/framework/config.js
浏览文件 @
66527fa0
...
...
@@ -67,6 +67,9 @@ export function initEntryPage () {
}
if
(
!
entryPagePath
||
entryPagePath
===
__uniConfig
.
entryPagePath
)
{
if
(
entryPageQuery
)
{
__uniConfig
.
entryPageQuery
=
entryPageQuery
}
return
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录