Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
da1dab32
U
uni-app
项目概览
DCloud
/
uni-app
3 个月 前同步成功
通知
725
Star
38705
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
7
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
7
Issue
7
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
da1dab32
编写于
10月 29, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip(mp): mp-alipay
上级
302ed498
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
300 addition
and
1294 deletion
+300
-1294
packages/uni-mp-alipay/dist/uni.compiler.js
packages/uni-mp-alipay/dist/uni.compiler.js
+68
-1100
packages/uni-mp-alipay/dist/uni.mp.esm.js
packages/uni-mp-alipay/dist/uni.mp.esm.js
+98
-90
packages/uni-mp-alipay/package.json
packages/uni-mp-alipay/package.json
+3
-1
packages/uni-mp-alipay/src/runtime/createComponent.ts
packages/uni-mp-alipay/src/runtime/createComponent.ts
+51
-48
packages/uni-mp-alipay/src/runtime/createPage.ts
packages/uni-mp-alipay/src/runtime/createPage.ts
+44
-42
packages/uni-mp-alipay/src/runtime/index.ts
packages/uni-mp-alipay/src/runtime/index.ts
+5
-4
packages/uni-mp-alipay/src/runtime/util.ts
packages/uni-mp-alipay/src/runtime/util.ts
+4
-3
packages/uni-mp-vite/src/plugin/index.ts
packages/uni-mp-vite/src/plugin/index.ts
+2
-0
packages/uni-mp-vue/dist/vue.runtime.esm.js
packages/uni-mp-vue/dist/vue.runtime.esm.js
+13
-3
packages/uni-mp-vue/src/plugin.ts
packages/uni-mp-vue/src/plugin.ts
+12
-3
未找到文件。
packages/uni-mp-alipay/dist/uni.compiler.js
浏览文件 @
da1dab32
此差异已折叠。
点击以展开。
packages/uni-mp-alipay/dist/uni.mp.esm.js
浏览文件 @
da1dab32
...
@@ -683,7 +683,8 @@ function initBehavior({ properties }) {
...
@@ -683,7 +683,8 @@ function initBehavior({ properties }) {
};
};
}
}
function
initRelation
(
mpInstance
,
detail
)
{
function
initRelation
(
mpInstance
,
detail
)
{
mpInstance
.
props
.
onVueInit
(
detail
);
// onVueInit
mpInstance
.
props
.
onVI
(
detail
);
}
}
function
initSpecialMethods
(
mpInstance
)
{
function
initSpecialMethods
(
mpInstance
)
{
if
(
!
mpInstance
.
$vm
)
{
if
(
!
mpInstance
.
$vm
)
{
...
@@ -742,8 +743,8 @@ function handleRef(ref) {
...
@@ -742,8 +743,8 @@ function handleRef(ref) {
if
(
!
ref
)
{
if
(
!
ref
)
{
return
;
return
;
}
}
const
refName
=
ref
.
props
[
'
data-r
ef
'
];
const
refName
=
ref
.
props
[
'
data-r
'
];
// data-ref
const
refInForName
=
ref
.
props
[
'
data-r
ef-in-for
'
];
const
refInForName
=
ref
.
props
[
'
data-r
-i-f
'
];
// data-ref-in-for
if
(
!
refName
&&
!
refInForName
)
{
if
(
!
refName
&&
!
refInForName
)
{
return
;
return
;
}
}
...
@@ -828,46 +829,48 @@ function createVueComponent(mpType, mpInstance, vueOptions, parent) {
...
@@ -828,46 +829,48 @@ function createVueComponent(mpType, mpInstance, vueOptions, parent) {
});
});
}
}
function
createPage$1
(
vueOptions
)
{
function
initCreatePage
()
{
vueOptions
=
vueOptions
.
default
||
vueOptions
;
return
function
createPage
(
vueOptions
)
{
const
pageOptions
=
{
vueOptions
=
vueOptions
.
default
||
vueOptions
;
onLoad
(
query
)
{
const
pageOptions
=
{
this
.
options
=
query
;
onLoad
(
query
)
{
this
.
$page
=
{
this
.
options
=
query
;
fullPath
:
'
/
'
+
this
.
route
+
stringifyQuery
(
query
),
this
.
$page
=
{
};
fullPath
:
'
/
'
+
this
.
route
+
stringifyQuery
(
query
),
// 初始化 vue 实例
};
this
.
$vm
=
createVueComponent
(
'
page
'
,
this
,
vueOptions
);
// 初始化 vue 实例
initSpecialMethods
(
this
);
this
.
$vm
=
createVueComponent
(
'
page
'
,
this
,
vueOptions
);
this
.
$vm
.
$callHook
(
ON_LOAD
,
query
);
initSpecialMethods
(
this
);
},
this
.
$vm
.
$callHook
(
ON_LOAD
,
query
);
onReady
()
{
initChildVues
(
this
);
this
.
$vm
.
$callHook
(
'
mounted
'
);
this
.
$vm
.
$callHook
(
ON_READY
);
},
onUnload
()
{
if
(
this
.
$vm
)
{
this
.
$vm
.
$callHook
(
ON_UNLOAD
);
$destroyComponent
(
this
.
$vm
);
}
},
events
:
{
// 支付宝小程序有些页面事件只能放在events下
onBack
()
{
this
.
$vm
.
$callHook
(
ON_BACK_PRESS
);
},
},
},
onReady
()
{
__r
:
handleRef
,
initChildVues
(
this
);
__l
:
handleLink
,
this
.
$vm
.
$callHook
(
'
mounted
'
);
this
.
$vm
.
$callHook
(
ON_READY
);
},
onUnload
()
{
if
(
this
.
$vm
)
{
this
.
$vm
.
$callHook
(
ON_UNLOAD
);
$destroyComponent
(
this
.
$vm
);
}
},
events
:
{
// 支付宝小程序有些页面事件只能放在events下
onBack
()
{
this
.
$vm
.
$callHook
(
ON_BACK_PRESS
);
},
},
__r
:
handleRef
,
__l
:
handleLink
,
};
if
(
__VUE_OPTIONS_API__
)
{
pageOptions
.
data
=
initData
(
vueOptions
);
}
initHooks
(
pageOptions
,
PAGE_HOOKS
);
initUnknownHooks
(
pageOptions
,
vueOptions
);
initWxsCallMethods
(
pageOptions
,
vueOptions
.
wxsCallMethods
);
return
Page
(
pageOptions
);
};
};
if
(
__VUE_OPTIONS_API__
)
{
pageOptions
.
data
=
initData
(
vueOptions
);
}
initHooks
(
pageOptions
,
PAGE_HOOKS
);
initUnknownHooks
(
pageOptions
,
vueOptions
);
initWxsCallMethods
(
pageOptions
,
vueOptions
.
wxsCallMethods
);
return
Page
(
pageOptions
);
}
}
function
initComponentProps
(
rawProps
)
{
function
initComponentProps
(
rawProps
)
{
...
@@ -877,7 +880,8 @@ function initComponentProps(rawProps) {
...
@@ -877,7 +880,8 @@ function initComponentProps(rawProps) {
initProps
(
propertiesOptions
,
rawProps
,
false
);
initProps
(
propertiesOptions
,
rawProps
,
false
);
const
properties
=
propertiesOptions
.
properties
;
const
properties
=
propertiesOptions
.
properties
;
const
props
=
{
const
props
=
{
onVueInit
:
function
()
{
},
// onVueInit
onVI
:
function
()
{
},
};
};
Object
.
keys
(
properties
).
forEach
((
key
)
=>
{
Object
.
keys
(
properties
).
forEach
((
key
)
=>
{
// vueSlots
// vueSlots
...
@@ -917,60 +921,64 @@ function initVm(mpInstance, createComponent) {
...
@@ -917,60 +921,64 @@ function initVm(mpInstance, createComponent) {
}
}
}
}
}
}
function
createComponent$1
(
vueOptions
)
{
function
initCreateComponent
()
{
vueOptions
=
vueOptions
.
default
||
vueOptions
;
return
function
createComponent
(
vueOptions
)
{
const
mpComponentOptions
=
{
vueOptions
=
vueOptions
.
default
||
vueOptions
;
props
:
initComponentProps
(
vueOptions
.
props
),
const
mpComponentOptions
=
{
didMount
()
{
props
:
initComponentProps
(
vueOptions
.
props
),
const
createComponent
=
(
parent
)
=>
{
didMount
()
{
return
createVueComponent
(
'
component
'
,
this
,
vueOptions
,
parent
);
const
createComponent
=
(
parent
)
=>
{
};
return
createVueComponent
(
'
component
'
,
this
,
vueOptions
,
parent
);
if
(
my
.
dd
)
{
};
// 钉钉小程序底层基础库有 bug,组件嵌套使用时,在 didMount 中无法及时调用 props 中的方法
if
(
my
.
dd
)
{
setTimeout
(()
=>
{
// 钉钉小程序底层基础库有 bug,组件嵌套使用时,在 didMount 中无法及时调用 props 中的方法
setTimeout
(()
=>
{
initVm
(
this
,
createComponent
);
},
4
);
}
else
{
initVm
(
this
,
createComponent
);
initVm
(
this
,
createComponent
);
},
4
);
}
}
initSpecialMethods
(
this
);
else
{
if
(
isComponent2
)
{
initVm
(
this
,
createComponent
);
this
.
$vm
.
$callHook
(
'
mounted
'
);
}
}
initSpecialMethods
(
this
);
},
if
(
isComponent2
)
{
didUnmount
()
{
this
.
$vm
.
$callHook
(
'
mounted
'
);
$destroyComponent
(
this
.
$vm
);
}
},
},
methods
:
{
didUnmount
()
{
__r
:
handleRef
,
$destroyComponent
(
this
.
$vm
);
__l
:
handleLink
,
},
triggerEvent
,
methods
:
{
},
__r
:
handleRef
,
__l
:
handleLink
,
triggerEvent
,
},
};
if
(
__VUE_OPTIONS_API__
)
{
mpComponentOptions
.
data
=
initData
(
vueOptions
);
mpComponentOptions
.
mixins
=
initBehaviors
(
vueOptions
,
initBehavior
);
}
if
(
isComponent2
)
{
mpComponentOptions
.
onInit
=
function
onInit
()
{
initVm
(
this
,
(
parent
)
=>
{
return
createVueComponent
(
'
component
'
,
this
,
vueOptions
,
parent
);
});
};
};
mpComponentOptions
.
deriveDataFromProps
=
createObserver
();
if
(
__VUE_OPTIONS_API__
)
{
}
mpComponentOptions
.
data
=
initData
(
vueOptions
);
else
{
mpComponentOptions
.
mixins
=
initBehaviors
(
vueOptions
,
initBehavior
);
mpComponentOptions
.
didUpdate
=
createObserver
(
true
);
}
}
if
(
isComponent2
)
{
initWxsCallMethods
(
mpComponentOptions
.
methods
,
vueOptions
.
wxsCallMethods
);
mpComponentOptions
.
onInit
=
function
onInit
()
{
return
Component
(
mpComponentOptions
);
initVm
(
this
,
(
parent
)
=>
{
return
createVueComponent
(
'
component
'
,
this
,
vueOptions
,
parent
);
});
};
mpComponentOptions
.
deriveDataFromProps
=
createObserver
();
}
else
{
mpComponentOptions
.
didUpdate
=
createObserver
(
true
);
}
initWxsCallMethods
(
mpComponentOptions
.
methods
,
vueOptions
.
wxsCallMethods
);
return
Component
(
mpComponentOptions
);
};
}
}
const
createApp
=
initCreateApp
(
parseAppOptions
);
const
createApp
=
initCreateApp
(
parseAppOptions
);
const
createPage
=
initCreatePage
();
const
createComponent
=
initCreateComponent
();
my
.
EventChannel
=
EventChannel
;
my
.
EventChannel
=
EventChannel
;
my
.
createApp
=
global
.
createApp
=
createApp
;
my
.
createApp
=
createApp
;
my
.
createPage
=
createPage
;
my
.
createPage
=
createPage
;
my
.
createComponent
=
createComponent
;
my
.
createComponent
=
createComponent
;
export
{
createApp
,
createComponent
$1
as
createComponent
,
createPage$1
as
createPage
};
export
{
createApp
,
createComponent
,
createPage
};
packages/uni-mp-alipay/package.json
浏览文件 @
da1dab32
...
@@ -14,7 +14,9 @@
...
@@ -14,7 +14,9 @@
"license"
:
"Apache-2.0"
,
"license"
:
"Apache-2.0"
,
"uni-app"
:
{
"uni-app"
:
{
"name"
:
"mp-alipay"
,
"name"
:
"mp-alipay"
,
"title"
:
"支付宝小程序"
"title"
:
"支付宝小程序"
,
"apply"
:
"mp-alipay"
,
"main"
:
"dist/uni.compiler.js"
},
},
"gitHead"
:
"1efa8efd0a9eddeabdba75c020d015ebf31b8177"
"gitHead"
:
"1efa8efd0a9eddeabdba75c020d015ebf31b8177"
}
}
packages/uni-mp-alipay/src/runtime/createComponent.ts
浏览文件 @
da1dab32
...
@@ -33,7 +33,8 @@ function initComponentProps(rawProps: Record<string, any>) {
...
@@ -33,7 +33,8 @@ function initComponentProps(rawProps: Record<string, any>) {
initProps
(
propertiesOptions
,
rawProps
,
false
)
initProps
(
propertiesOptions
,
rawProps
,
false
)
const
properties
=
propertiesOptions
.
properties
as
Record
<
string
,
any
>
const
properties
=
propertiesOptions
.
properties
as
Record
<
string
,
any
>
const
props
:
Record
<
string
,
any
>
=
{
const
props
:
Record
<
string
,
any
>
=
{
onVueInit
:
function
()
{},
// onVueInit
onVI
:
function
()
{},
}
}
Object
.
keys
(
properties
).
forEach
((
key
)
=>
{
Object
.
keys
(
properties
).
forEach
((
key
)
=>
{
// vueSlots
// vueSlots
...
@@ -78,56 +79,58 @@ function initVm(
...
@@ -78,56 +79,58 @@ function initVm(
}
}
}
}
export
function
createComponent
(
vueOptions
:
ComponentOptions
)
{
export
function
initCreateComponent
()
{
vueOptions
=
vueOptions
.
default
||
vueOptions
return
function
createComponent
(
vueOptions
:
ComponentOptions
)
{
const
mpComponentOptions
:
tinyapp
.
ComponentOptions
=
{
vueOptions
=
vueOptions
.
default
||
vueOptions
props
:
initComponentProps
(
vueOptions
.
props
),
const
mpComponentOptions
:
tinyapp
.
ComponentOptions
=
{
didMount
()
{
props
:
initComponentProps
(
vueOptions
.
props
),
const
createComponent
=
(
parent
?:
ComponentPublicInstance
)
=>
{
didMount
()
{
return
createVueComponent
(
'
component
'
,
this
,
vueOptions
,
parent
)
const
createComponent
=
(
parent
?:
ComponentPublicInstance
)
=>
{
}
return
createVueComponent
(
'
component
'
,
this
,
vueOptions
,
parent
)
if
((
my
as
any
).
dd
)
{
}
// 钉钉小程序底层基础库有 bug,组件嵌套使用时,在 didMount 中无法及时调用 props 中的方法
if
((
my
as
any
).
dd
)
{
setTimeout
(()
=>
{
// 钉钉小程序底层基础库有 bug,组件嵌套使用时,在 didMount 中无法及时调用 props 中的方法
setTimeout
(()
=>
{
initVm
(
this
,
createComponent
)
},
4
)
}
else
{
initVm
(
this
,
createComponent
)
initVm
(
this
,
createComponent
)
},
4
)
}
}
else
{
initSpecialMethods
(
this
)
initVm
(
this
,
createComponent
)
if
(
isComponent2
)
{
}
this
.
$vm
.
$callHook
(
'
mounted
'
)
initSpecialMethods
(
this
)
}
if
(
isComponent2
)
{
},
this
.
$vm
.
$callHook
(
'
mounted
'
)
didUnmount
()
{
}
$destroyComponent
(
this
.
$vm
)
},
},
didUnmount
()
{
methods
:
{
$destroyComponent
(
this
.
$vm
)
__r
:
handleRef
,
},
__l
:
handleLink
,
methods
:
{
triggerEvent
,
__r
:
handleRef
,
},
__l
:
handleLink
,
}
triggerEvent
,
if
(
__VUE_OPTIONS_API__
)
{
},
mpComponentOptions
.
data
=
initData
(
vueOptions
)
}
mpComponentOptions
.
mixins
=
initBehaviors
(
vueOptions
,
initBehavior
)
if
(
__VUE_OPTIONS_API__
)
{
}
mpComponentOptions
.
data
=
initData
(
vueOptions
)
mpComponentOptions
.
mixins
=
initBehaviors
(
vueOptions
,
initBehavior
)
}
if
(
isComponent2
)
{
if
(
isComponent2
)
{
mpComponentOptions
.
onInit
=
function
onInit
(
this
:
MPComponentInstance
)
{
mpComponentOptions
.
onInit
=
function
onInit
(
this
:
MPComponentInstance
)
{
initVm
(
this
,
(
parent
?:
ComponentPublicInstance
)
=>
{
initVm
(
this
,
(
parent
?:
ComponentPublicInstance
)
=>
{
return
createVueComponent
(
'
component
'
,
this
,
vueOptions
,
parent
)
return
createVueComponent
(
'
component
'
,
this
,
vueOptions
,
parent
)
})
})
}
mpComponentOptions
.
deriveDataFromProps
=
createObserver
()
}
else
{
mpComponentOptions
.
didUpdate
=
createObserver
(
true
)
}
}
mpComponentOptions
.
deriveDataFromProps
=
createObserver
()
}
else
{
mpComponentOptions
.
didUpdate
=
createObserver
(
true
)
}
initWxsCallMethods
(
initWxsCallMethods
(
mpComponentOptions
.
methods
as
WechatMiniprogram
.
Component
.
MethodOption
,
mpComponentOptions
.
methods
as
WechatMiniprogram
.
Component
.
MethodOption
,
vueOptions
.
wxsCallMethods
vueOptions
.
wxsCallMethods
)
)
return
Component
(
mpComponentOptions
)
return
Component
(
mpComponentOptions
)
}
}
}
packages/uni-mp-alipay/src/runtime/createPage.ts
浏览文件 @
da1dab32
...
@@ -27,49 +27,51 @@ import {
...
@@ -27,49 +27,51 @@ import {
declare
function
Page
<
D
>
(
options
:
tinyapp
.
PageOptions
<
D
>
):
void
declare
function
Page
<
D
>
(
options
:
tinyapp
.
PageOptions
<
D
>
):
void
export
function
createPage
(
vueOptions
:
ComponentOptions
)
{
export
function
initCreatePage
()
{
vueOptions
=
vueOptions
.
default
||
vueOptions
return
function
createPage
(
vueOptions
:
ComponentOptions
)
{
const
pageOptions
:
tinyapp
.
PageOptions
=
{
vueOptions
=
vueOptions
.
default
||
vueOptions
onLoad
(
query
)
{
const
pageOptions
:
tinyapp
.
PageOptions
=
{
this
.
options
=
query
onLoad
(
query
)
{
this
.
$page
=
{
this
.
options
=
query
fullPath
:
'
/
'
+
this
.
route
+
stringifyQuery
(
query
),
this
.
$page
=
{
}
fullPath
:
'
/
'
+
this
.
route
+
stringifyQuery
(
query
),
// 初始化 vue 实例
}
this
.
$vm
=
createVueComponent
(
'
page
'
,
this
,
vueOptions
)
// 初始化 vue 实例
initSpecialMethods
(
this
)
this
.
$vm
=
createVueComponent
(
'
page
'
,
this
,
vueOptions
)
this
.
$vm
.
$callHook
(
ON_LOAD
,
query
)
initSpecialMethods
(
this
)
},
this
.
$vm
.
$callHook
(
ON_LOAD
,
query
)
onReady
()
{
initChildVues
(
this
)
this
.
$vm
.
$callHook
(
'
mounted
'
)
this
.
$vm
.
$callHook
(
ON_READY
)
},
onUnload
()
{
if
(
this
.
$vm
)
{
this
.
$vm
.
$callHook
(
ON_UNLOAD
)
$destroyComponent
(
this
.
$vm
)
}
},
events
:
{
// 支付宝小程序有些页面事件只能放在events下
onBack
()
{
this
.
$vm
.
$callHook
(
ON_BACK_PRESS
)
},
},
},
onReady
()
{
__r
:
handleRef
,
initChildVues
(
this
)
__l
:
handleLink
,
this
.
$vm
.
$callHook
(
'
mounted
'
)
}
this
.
$vm
.
$callHook
(
ON_READY
)
if
(
__VUE_OPTIONS_API__
)
{
},
pageOptions
.
data
=
initData
(
vueOptions
)
onUnload
()
{
}
if
(
this
.
$vm
)
{
initHooks
(
pageOptions
,
PAGE_HOOKS
)
this
.
$vm
.
$callHook
(
ON_UNLOAD
)
initUnknownHooks
(
pageOptions
,
vueOptions
)
$destroyComponent
(
this
.
$vm
)
}
},
events
:
{
// 支付宝小程序有些页面事件只能放在events下
onBack
()
{
this
.
$vm
.
$callHook
(
ON_BACK_PRESS
)
},
},
__r
:
handleRef
,
__l
:
handleLink
,
}
if
(
__VUE_OPTIONS_API__
)
{
pageOptions
.
data
=
initData
(
vueOptions
)
}
initHooks
(
pageOptions
,
PAGE_HOOKS
)
initUnknownHooks
(
pageOptions
,
vueOptions
)
initWxsCallMethods
(
initWxsCallMethods
(
pageOptions
as
WechatMiniprogram
.
Component
.
MethodOption
,
pageOptions
as
WechatMiniprogram
.
Component
.
MethodOption
,
vueOptions
.
wxsCallMethods
vueOptions
.
wxsCallMethods
)
)
return
Page
(
pageOptions
)
return
Page
(
pageOptions
)
}
}
}
packages/uni-mp-alipay/src/runtime/index.ts
浏览文件 @
da1dab32
...
@@ -4,11 +4,12 @@ import { initCreateApp } from '@dcloudio/uni-mp-core'
...
@@ -4,11 +4,12 @@ import { initCreateApp } from '@dcloudio/uni-mp-core'
import
*
as
parseAppOptions
from
'
./parseAppOptions
'
import
*
as
parseAppOptions
from
'
./parseAppOptions
'
export
{
createPage
}
from
'
./createPage
'
import
{
initCreatePage
}
from
'
./createPage
'
export
{
createComponent
}
from
'
./createComponent
'
import
{
initCreateComponent
}
from
'
./createComponent
'
export
const
createApp
=
initCreateApp
(
parseAppOptions
)
export
const
createApp
=
initCreateApp
(
parseAppOptions
)
export
const
createPage
=
initCreatePage
()
export
const
createComponent
=
initCreateComponent
()
;(
my
as
any
).
EventChannel
=
EventChannel
;(
my
as
any
).
EventChannel
=
EventChannel
;(
my
as
any
).
createApp
=
(
global
as
any
).
createApp
=
createApp
;(
my
as
any
).
createApp
=
createApp
;(
my
as
any
).
createPage
=
createPage
;(
my
as
any
).
createPage
=
createPage
;(
my
as
any
).
createComponent
=
createComponent
;(
my
as
any
).
createComponent
=
createComponent
packages/uni-mp-alipay/src/runtime/util.ts
浏览文件 @
da1dab32
...
@@ -48,7 +48,8 @@ export function initRelation(
...
@@ -48,7 +48,8 @@ export function initRelation(
mpInstance
:
MPComponentInstance
,
mpInstance
:
MPComponentInstance
,
detail
:
RelationOptions
detail
:
RelationOptions
)
{
)
{
mpInstance
.
props
.
onVueInit
(
detail
)
// onVueInit
mpInstance
.
props
.
onVI
(
detail
)
}
}
export
function
initSpecialMethods
(
export
function
initSpecialMethods
(
...
@@ -128,8 +129,8 @@ export function handleRef(this: MPComponentInstance, ref: MPComponentInstance) {
...
@@ -128,8 +129,8 @@ export function handleRef(this: MPComponentInstance, ref: MPComponentInstance) {
if
(
!
ref
)
{
if
(
!
ref
)
{
return
return
}
}
const
refName
=
ref
.
props
[
'
data-r
ef
'
]
const
refName
=
ref
.
props
[
'
data-r
'
]
// data-ref
const
refInForName
=
ref
.
props
[
'
data-r
ef-in-for
'
]
const
refInForName
=
ref
.
props
[
'
data-r
-i-f
'
]
// data-ref-in-for
if
(
!
refName
&&
!
refInForName
)
{
if
(
!
refName
&&
!
refInForName
)
{
return
return
}
}
...
...
packages/uni-mp-vite/src/plugin/index.ts
浏览文件 @
da1dab32
...
@@ -38,6 +38,7 @@ export interface UniMiniProgramPluginOptions {
...
@@ -38,6 +38,7 @@ export interface UniMiniProgramPluginOptions {
template
:
{
template
:
{
extname
:
string
extname
:
string
directive
:
string
directive
:
string
event
?:
MiniProgramCompilerOptions
[
'
event
'
]
class
:
MiniProgramCompilerOptions
[
'
class
'
]
class
:
MiniProgramCompilerOptions
[
'
class
'
]
slot
:
MiniProgramCompilerOptions
[
'
slot
'
]
slot
:
MiniProgramCompilerOptions
[
'
slot
'
]
filter
?:
{
filter
?:
{
...
@@ -69,6 +70,7 @@ export function uniMiniProgramPlugin(
...
@@ -69,6 +70,7 @@ export function uniMiniProgramPlugin(
uni
:
uniOptions
({
uni
:
uniOptions
({
copyOptions
,
copyOptions
,
miniProgram
:
{
miniProgram
:
{
event
:
template
.
event
,
class
:
template
.
class
,
class
:
template
.
class
,
filter
:
template
.
filter
?
{
lang
:
template
.
filter
.
lang
}
:
undefined
,
filter
:
template
.
filter
?
{
lang
:
template
.
filter
.
lang
}
:
undefined
,
directive
:
template
.
directive
,
directive
:
template
.
directive
,
...
...
packages/uni-mp-vue/dist/vue.runtime.esm.js
浏览文件 @
da1dab32
...
@@ -4882,8 +4882,9 @@ var plugin = {
...
@@ -4882,8 +4882,9 @@ var plugin = {
const
oldMount
=
app
.
mount
;
const
oldMount
=
app
.
mount
;
app
.
mount
=
function
mount
(
rootContainer
)
{
app
.
mount
=
function
mount
(
rootContainer
)
{
const
instance
=
oldMount
.
call
(
app
,
rootContainer
);
const
instance
=
oldMount
.
call
(
app
,
rootContainer
);
if
(
global
.
createApp
)
{
const
createApp
=
getCreateApp
();
global
.
createApp
(
instance
);
if
(
createApp
)
{
createApp
(
instance
);
}
}
else
{
else
{
// @ts-ignore 旧编译器
// @ts-ignore 旧编译器
...
@@ -4895,7 +4896,16 @@ var plugin = {
...
@@ -4895,7 +4896,16 @@ var plugin = {
return
instance
;
return
instance
;
};
};
},
},
};
};
function
getCreateApp
()
{
if
(
typeof
global
!==
'
undefined
'
)
{
return
global
.
createApp
;
}
else
if
(
typeof
my
!==
'
undefined
'
)
{
// 支付宝小程序没有global
return
my
.
createApp
;
}
}
function
vOn
(
value
)
{
function
vOn
(
value
)
{
const
instance
=
getCurrentInstance
();
const
instance
=
getCurrentInstance
();
...
...
packages/uni-mp-vue/src/plugin.ts
浏览文件 @
da1dab32
...
@@ -12,8 +12,9 @@ export default {
...
@@ -12,8 +12,9 @@ export default {
const
oldMount
=
app
.
mount
const
oldMount
=
app
.
mount
app
.
mount
=
function
mount
(
rootContainer
:
any
)
{
app
.
mount
=
function
mount
(
rootContainer
:
any
)
{
const
instance
=
oldMount
.
call
(
app
,
rootContainer
)
const
instance
=
oldMount
.
call
(
app
,
rootContainer
)
if
((
global
as
any
).
createApp
)
{
const
createApp
=
getCreateApp
()
;(
global
as
any
).
createApp
(
instance
)
if
(
createApp
)
{
createApp
(
instance
)
}
else
{
}
else
{
// @ts-ignore 旧编译器
// @ts-ignore 旧编译器
if
(
typeof
createMiniProgramApp
!==
'
undefined
'
)
{
if
(
typeof
createMiniProgramApp
!==
'
undefined
'
)
{
...
@@ -21,8 +22,16 @@ export default {
...
@@ -21,8 +22,16 @@ export default {
createMiniProgramApp
(
instance
)
createMiniProgramApp
(
instance
)
}
}
}
}
return
instance
return
instance
}
}
},
},
}
}
function
getCreateApp
()
{
if
(
typeof
global
!==
'
undefined
'
)
{
return
(
global
as
any
).
createApp
}
else
if
(
typeof
my
!==
'
undefined
'
)
{
// 支付宝小程序没有global
return
(
my
as
any
).
createApp
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录