Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
陈庄旺
uni-app
提交
b8591c12
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,发现更多精彩内容 >>
提交
b8591c12
编写于
5月 22, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(compat): RENDER_FUNCTION
上级
0779f670
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
25 addition
and
15 deletion
+25
-15
packages/uni-h5/dist/uni-h5.cjs.js
packages/uni-h5/dist/uni-h5.cjs.js
+6
-4
packages/uni-h5/dist/uni-h5.es.js
packages/uni-h5/dist/uni-h5.es.js
+6
-4
packages/uni-h5/src/framework/setup/index.ts
packages/uni-h5/src/framework/setup/index.ts
+7
-5
packages/vite-plugin-uni/src/configResolved/plugins/easycom.ts
...ges/vite-plugin-uni/src/configResolved/plugins/easycom.ts
+5
-1
packages/vite-plugin-uni/src/configResolved/plugins/pagesJson.ts
...s/vite-plugin-uni/src/configResolved/plugins/pagesJson.ts
+1
-1
未找到文件。
packages/uni-h5/dist/uni-h5.cjs.js
浏览文件 @
b8591c12
...
...
@@ -7670,7 +7670,8 @@ function initApp(vm) {
appVm
.
$vm
=
vm
;
appVm
.
globalData
=
appVm
.
$options
.
globalData
||
{};
}
function
wrapperComponentSetup
(
comp
,
{
init
,
setup
,
after
})
{
function
wrapperComponentSetup
(
comp
,
{
init
,
setup
,
before
})
{
before
&&
before
(
comp
);
const
oldSetup
=
comp
.
setup
;
comp
.
setup
=
(
props2
,
ctx
)
=>
{
const
instance
=
vue
.
getCurrentInstance
();
...
...
@@ -7680,7 +7681,6 @@ function wrapperComponentSetup(comp, {init, setup, after}) {
return
oldSetup
(
query
,
ctx
);
}
};
after
&&
after
(
comp
);
}
function
setupComponent
(
comp
,
options
)
{
if
(
comp
&&
(
comp
.
__esModule
||
comp
[
Symbol
.
toStringTag
]
===
"
Module
"
))
{
...
...
@@ -7715,9 +7715,11 @@ function setupApp(comp) {
return
route
.
query
;
}
},
after
(
comp2
)
{
before
(
comp2
)
{
comp2
.
mpType
=
"
app
"
;
comp2
.
render
=
()
=>
(
vue
.
openBlock
(),
vue
.
createBlock
(
LayoutComponent
));
comp2
.
setup
=
()
=>
()
=>
{
return
vue
.
openBlock
(),
vue
.
createBlock
(
LayoutComponent
);
};
}
});
}
...
...
packages/uni-h5/dist/uni-h5.es.js
浏览文件 @
b8591c12
...
...
@@ -13185,7 +13185,8 @@ function initApp(vm) {
appVm.$vm = vm;
appVm.globalData = appVm.$options.globalData || {};
}
function wrapperComponentSetup(comp, {init: init2, setup, after}) {
function wrapperComponentSetup(comp, {init: init2, setup, before}) {
before && before(comp);
const oldSetup = comp.setup;
comp.setup = (props2, ctx) => {
const instance2 = getCurrentInstance();
...
...
@@ -13195,7 +13196,6 @@ function wrapperComponentSetup(comp, {init: init2, setup, after}) {
return oldSetup(query, ctx);
}
};
after && after(comp);
}
function setupComponent(comp, options) {
if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
...
...
@@ -13279,9 +13279,11 @@ function setupApp(comp) {
});
return route.query;
},
after
(comp2) {
before
(comp2) {
comp2.mpType = "app";
comp2.render = () => (openBlock(), createBlock(LayoutComponent));
comp2.setup = () => () => {
return openBlock(), createBlock(LayoutComponent);
};
}
});
}
...
...
packages/uni-h5/src/framework/setup/index.ts
浏览文件 @
b8591c12
...
...
@@ -21,13 +21,14 @@ import { usePageMeta, usePageRoute } from './provide'
interface
SetupComponentOptions
{
init
:
(
vm
:
ComponentPublicInstance
)
=>
void
setup
:
(
instance
:
ComponentInternalInstance
)
=>
Record
<
string
,
any
>
after
?:
(
comp
:
DefineComponent
)
=>
void
before
?:
(
comp
:
DefineComponent
)
=>
void
}
function
wrapperComponentSetup
(
comp
:
DefineComponent
,
{
init
,
setup
,
after
}:
SetupComponentOptions
{
init
,
setup
,
before
}:
SetupComponentOptions
)
{
before
&&
before
(
comp
)
const
oldSetup
=
comp
.
setup
comp
.
setup
=
(
props
,
ctx
)
=>
{
const
instance
=
getCurrentInstance
()
!
...
...
@@ -37,7 +38,6 @@ function wrapperComponentSetup(
return
oldSetup
(
query
,
ctx
)
}
}
after
&&
after
(
comp
)
}
function
setupComponent
(
comp
:
any
,
options
:
SetupComponentOptions
)
{
...
...
@@ -137,9 +137,11 @@ export function setupApp(comp: any) {
})
return
route
.
query
},
after
(
comp
)
{
before
(
comp
)
{
comp
.
mpType
=
'
app
'
comp
.
render
=
()
=>
(
openBlock
(),
createBlock
(
LayoutComponent
))
comp
.
setup
=
()
=>
()
=>
{
return
openBlock
(),
createBlock
(
LayoutComponent
)
}
},
})
}
packages/vite-plugin-uni/src/configResolved/plugins/easycom.ts
浏览文件 @
b8591c12
...
...
@@ -49,6 +49,8 @@ const baseComponents = [
'
view
'
,
]
const
identifierRE
=
/^
([
a-zA-Z_$
][
a-zA-Z
\\
d_$
]
*
)
$/
export
function
uniEasycomPlugin
(
options
:
UniPluginFilterOptions
):
Plugin
{
const
filter
=
createFilter
(
options
.
include
,
options
.
exclude
)
return
{
...
...
@@ -82,7 +84,9 @@ export function uniEasycomPlugin(options: UniPluginFilterOptions): Plugin {
if
(
source
)
{
return
(
// 解决局部引入组件优先级(理论上让开发者使用script setup就可以解决局部引入)
`typeof
${
name
}
!== 'undefined' ?
${
name
}
: `
+
(
identifierRE
.
test
(
name
)
?
`typeof
${
name
}
!== 'undefined' ?
${
name
}
: `
:
''
)
+
addImportDeclaration
(
importDeclarations
,
`__easycom_
${
i
++
}
`
,
...
...
packages/vite-plugin-uni/src/configResolved/plugins/pagesJson.ts
浏览文件 @
b8591c12
...
...
@@ -238,7 +238,7 @@ function generatePageRoute(
const
alias
=
isEntry
?
`\n alias:'/
${
path
}
',`
:
''
return
`{
path:'/
${
isEntry
?
''
:
path
}
',
${
alias
}
component:{
render(){return
renderPage(
${
name
}
)}},
component:{
setup(){return ()=>
renderPage(
${
name
}
)}},
loader:
${
normalizePageIdentifier
(
path
)}
Loader,
meta:
${
JSON
.
stringify
(
meta
)}
}`
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录