Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
2be26cda
U
uni-app
项目概览
DCloud
/
uni-app
6 个月 前同步成功
通知
805
Star
38709
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
8
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
8
Issue
8
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
2be26cda
编写于
11月 04, 2023
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip(uts): add $callMethod
上级
66224184
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
70 addition
and
1 deletion
+70
-1
packages/uni-app-plus/dist/uni.vue.js
packages/uni-app-plus/dist/uni.vue.js
+9
-0
packages/uni-h5/dist-x/uni-h5.cjs.js
packages/uni-h5/dist-x/uni-h5.cjs.js
+9
-0
packages/uni-h5/dist-x/uni-h5.es.js
packages/uni-h5/dist-x/uni-h5.es.js
+9
-0
packages/uni-h5/dist/uni-h5.cjs.js
packages/uni-h5/dist/uni-h5.cjs.js
+9
-0
packages/uni-h5/dist/uni-h5.es.js
packages/uni-h5/dist/uni-h5.es.js
+9
-0
packages/uni-mp-vue/dist/vue.runtime.esm.js
packages/uni-mp-vue/dist/vue.runtime.esm.js
+9
-0
packages/uni-vue/src/componentInstance.ts
packages/uni-vue/src/componentInstance.ts
+14
-0
packages/uni-vue/src/index.ts
packages/uni-vue/src/index.ts
+2
-1
未找到文件。
packages/uni-app-plus/dist/uni.vue.js
浏览文件 @
2be26cda
...
...
@@ -150,6 +150,14 @@ function applyOptions(options, instance, publicThis) {
function
set
(
target
,
key
,
val
)
{
return
(
target
[
key
]
=
val
);
}
function
$callMethod
(
method
,
...
args
)
{
const
fn
=
this
[
method
];
if
(
fn
)
{
return
fn
(...
args
);
}
console
.
error
(
`method
${
method
}
not found`
);
return
null
;
}
function
createErrorHandler
(
app
)
{
return
function
errorHandler
(
err
,
instance
,
_info
)
{
...
...
@@ -267,6 +275,7 @@ function initApp(app) {
{
globalProperties
.
$set
=
set
;
globalProperties
.
$applyOptions
=
applyOptions
;
globalProperties
.
$callMethod
=
$callMethod
;
}
{
invokeCreateVueAppHook
(
app
);
...
...
packages/uni-h5/dist-x/uni-h5.cjs.js
浏览文件 @
2be26cda
...
...
@@ -7300,6 +7300,14 @@ function applyOptions(options, instance, publicThis) {
function
set
(
target
,
key
,
val
)
{
return
target
[
key
]
=
val
;
}
function
$callMethod
(
method
,
...
args
)
{
const
fn
=
this
[
method
];
if
(
fn
)
{
return
fn
(...
args
);
}
console
.
error
(
`method
${
method
}
not found`
);
return
null
;
}
function
createErrorHandler
(
app
)
{
return
function
errorHandler
(
err
,
instance
,
_info
)
{
if
(
!
instance
)
{
...
...
@@ -7408,6 +7416,7 @@ function initApp$1(app) {
{
globalProperties
.
$set
=
set
;
globalProperties
.
$applyOptions
=
applyOptions
;
globalProperties
.
$callMethod
=
$callMethod
;
}
{
uniShared
.
invokeCreateVueAppHook
(
app
);
...
...
packages/uni-h5/dist-x/uni-h5.es.js
浏览文件 @
2be26cda
...
...
@@ -14933,6 +14933,14 @@ function applyOptions(options, instance2, publicThis) {
function set(target, key, val) {
return target[key] = val;
}
function $callMethod(method, ...args) {
const fn = this[method];
if (fn) {
return fn(...args);
}
console.error(`method ${method} not found`);
return null;
}
function createErrorHandler(app) {
return function errorHandler(err, instance2, _info) {
if (!instance2) {
...
...
@@ -15041,6 +15049,7 @@ function initApp$1(app) {
{
globalProperties.$set = set;
globalProperties.$applyOptions = applyOptions;
globalProperties.$callMethod = $callMethod;
}
{
invokeCreateVueAppHook(app);
...
...
packages/uni-h5/dist/uni-h5.cjs.js
浏览文件 @
2be26cda
...
...
@@ -7300,6 +7300,14 @@ function applyOptions(options, instance, publicThis) {
function
set
(
target
,
key
,
val
)
{
return
target
[
key
]
=
val
;
}
function
$callMethod
(
method
,
...
args
)
{
const
fn
=
this
[
method
];
if
(
fn
)
{
return
fn
(...
args
);
}
console
.
error
(
`method
${
method
}
not found`
);
return
null
;
}
function
createErrorHandler
(
app
)
{
return
function
errorHandler
(
err
,
instance
,
_info
)
{
if
(
!
instance
)
{
...
...
@@ -7408,6 +7416,7 @@ function initApp$1(app) {
{
globalProperties
.
$set
=
set
;
globalProperties
.
$applyOptions
=
applyOptions
;
globalProperties
.
$callMethod
=
$callMethod
;
}
{
uniShared
.
invokeCreateVueAppHook
(
app
);
...
...
packages/uni-h5/dist/uni-h5.es.js
浏览文件 @
2be26cda
...
...
@@ -14933,6 +14933,14 @@ function applyOptions(options, instance2, publicThis) {
function set(target, key, val) {
return target[key] = val;
}
function $callMethod(method, ...args) {
const fn = this[method];
if (fn) {
return fn(...args);
}
console.error(`method ${method} not found`);
return null;
}
function createErrorHandler(app) {
return function errorHandler(err, instance2, _info) {
if (!instance2) {
...
...
@@ -15041,6 +15049,7 @@ function initApp$1(app) {
{
globalProperties.$set = set;
globalProperties.$applyOptions = applyOptions;
globalProperties.$callMethod = $callMethod;
}
{
invokeCreateVueAppHook(app);
...
...
packages/uni-mp-vue/dist/vue.runtime.esm.js
浏览文件 @
2be26cda
...
...
@@ -5485,6 +5485,14 @@ function applyOptions(options, instance, publicThis) {
function
set
(
target
,
key
,
val
)
{
return
(
target
[
key
]
=
val
);
}
function
$callMethod
(
method
,
...
args
)
{
const
fn
=
this
[
method
];
if
(
fn
)
{
return
fn
(...
args
);
}
console
.
error
(
`method
${
method
}
not found`
);
return
null
;
}
function
createErrorHandler
(
app
)
{
return
function
errorHandler
(
err
,
instance
,
_info
)
{
...
...
@@ -5602,6 +5610,7 @@ function initApp(app) {
if
(
__VUE_OPTIONS_API__
)
{
globalProperties
.
$set
=
set
;
globalProperties
.
$applyOptions
=
applyOptions
;
globalProperties
.
$callMethod
=
$callMethod
;
}
{
uni
.
invokeCreateVueAppHook
(
app
);
...
...
packages/uni-vue/src/componentInstance.ts
浏览文件 @
2be26cda
import
{
ComponentPublicInstance
}
from
'
vue
'
export
function
set
(
target
:
any
,
key
:
string
|
number
,
val
:
unknown
)
{
return
(
target
[
key
]
=
val
)
}
export
function
$callMethod
(
this
:
ComponentPublicInstance
,
method
:
string
,
...
args
:
Array
<
any
>
):
any
{
const
fn
=
(
this
as
any
)[
method
]
if
(
fn
)
{
return
fn
(...
args
)
}
console
.
error
(
`method
${
method
}
not found`
)
return
null
}
packages/uni-vue/src/index.ts
浏览文件 @
2be26cda
...
...
@@ -6,7 +6,7 @@ import {
}
from
'
@dcloudio/uni-shared
'
import
{
applyOptions
}
from
'
./componentOptions
'
import
{
set
}
from
'
./componentInstance
'
import
{
$callMethod
,
set
}
from
'
./componentInstance
'
import
{
createErrorHandler
,
initOptionMergeStrategies
}
from
'
./appConfig
'
import
{
uniIdMixin
}
from
'
./uni-id-mixin
'
...
...
@@ -27,6 +27,7 @@ export function initApp(app: App) {
if
(
__VUE_OPTIONS_API__
)
{
globalProperties
.
$set
=
set
globalProperties
.
$applyOptions
=
applyOptions
globalProperties
.
$callMethod
=
$callMethod
}
if
(
__PLATFORM__
===
'
app
'
||
__PLATFORM__
===
'
h5
'
)
{
invokeCreateVueAppHook
(
app
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录