Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MuGuiLin
uni-app
提交
0538e72b
U
uni-app
项目概览
MuGuiLin
/
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,发现更多精彩内容 >>
提交
0538e72b
编写于
2月 23, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(app): add uni.getCurrentSubNVue
上级
6494c8a7
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
43 addition
and
2 deletion
+43
-2
packages/uni-app/dist/uni-app.cjs.js
packages/uni-app/dist/uni-app.cjs.js
+6
-0
packages/uni-app/dist/uni-app.d.ts
packages/uni-app/dist/uni-app.d.ts
+2
-0
packages/uni-app/dist/uni-app.es.js
packages/uni-app/dist/uni-app.es.js
+6
-1
packages/uni-app/src/api.ts
packages/uni-app/src/api.ts
+4
-0
packages/uni-app/src/index.ts
packages/uni-app/src/index.ts
+1
-0
packages/uni-components/dist/components.js
packages/uni-components/dist/components.js
+24
-1
未找到文件。
packages/uni-app/dist/uni-app.cjs.js
浏览文件 @
0538e72b
...
@@ -73,6 +73,11 @@ function getSsrGlobalData() {
...
@@ -73,6 +73,11 @@ function getSsrGlobalData() {
return
uniShared
.
sanitise
(
globalData
);
return
uniShared
.
sanitise
(
globalData
);
}
}
function
getCurrentSubNVue
()
{
// @ts-ignore
return
uni
.
getSubNVueById
(
plus
.
webview
.
currentWebview
().
id
);
}
function
resolveEasycom
(
component
,
easycom
)
{
function
resolveEasycom
(
component
,
easycom
)
{
return
shared
.
isString
(
component
)
?
easycom
:
component
;
return
shared
.
isString
(
component
)
?
easycom
:
component
;
}
}
...
@@ -120,6 +125,7 @@ const onNavigationBarSearchInputConfirmed =
...
@@ -120,6 +125,7 @@ const onNavigationBarSearchInputConfirmed =
const
onNavigationBarSearchInputFocusChanged
=
const
onNavigationBarSearchInputFocusChanged
=
/*#__PURE__*/
createHook
(
uniShared
.
ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
);
/*#__PURE__*/
createHook
(
uniShared
.
ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
);
exports
.
getCurrentSubNVue
=
getCurrentSubNVue
;
exports
.
getSsrGlobalData
=
getSsrGlobalData
;
exports
.
getSsrGlobalData
=
getSsrGlobalData
;
exports
.
onAddToFavorites
=
onAddToFavorites
;
exports
.
onAddToFavorites
=
onAddToFavorites
;
exports
.
onBackPress
=
onBackPress
;
exports
.
onBackPress
=
onBackPress
;
...
...
packages/uni-app/dist/uni-app.d.ts
浏览文件 @
0538e72b
...
@@ -28,6 +28,8 @@ declare interface CustomShareTimeline {
...
@@ -28,6 +28,8 @@ declare interface CustomShareTimeline {
imageUrl
?:
string
;
imageUrl
?:
string
;
}
}
export
declare
function
getCurrentSubNVue
():
any
;
export
declare
function
getSsrGlobalData
():
any
;
export
declare
function
getSsrGlobalData
():
any
;
declare
type
LaunchOption
=
LaunchShowOption
;
declare
type
LaunchOption
=
LaunchShowOption
;
...
...
packages/uni-app/dist/uni-app.es.js
浏览文件 @
0538e72b
...
@@ -41,6 +41,11 @@ function getSsrGlobalData() {
...
@@ -41,6 +41,11 @@ function getSsrGlobalData() {
return
sanitise
(
globalData
);
return
sanitise
(
globalData
);
}
}
function
getCurrentSubNVue
()
{
// @ts-ignore
return
uni
.
getSubNVueById
(
plus
.
webview
.
currentWebview
().
id
);
}
function
resolveEasycom
(
component
,
easycom
)
{
function
resolveEasycom
(
component
,
easycom
)
{
return
isString
(
component
)
?
easycom
:
component
;
return
isString
(
component
)
?
easycom
:
component
;
}
}
...
@@ -88,4 +93,4 @@ const onNavigationBarSearchInputConfirmed =
...
@@ -88,4 +93,4 @@ const onNavigationBarSearchInputConfirmed =
const
onNavigationBarSearchInputFocusChanged
=
const
onNavigationBarSearchInputFocusChanged
=
/*#__PURE__*/
createHook
(
ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
);
/*#__PURE__*/
createHook
(
ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
);
export
{
getSsrGlobalData
,
onAddToFavorites
,
onBackPress
,
onError
,
onHide
,
onLaunch
,
onLoad
,
onNavigationBarButtonTap
,
onNavigationBarSearchInputChanged
,
onNavigationBarSearchInputClicked
,
onNavigationBarSearchInputConfirmed
,
onNavigationBarSearchInputFocusChanged
,
onPageNotFound
,
onPageScroll
,
onPullDownRefresh
,
onReachBottom
,
onReady
,
onResize
,
onShareAppMessage
,
onShareTimeline
,
onShow
,
onTabItemTap
,
onThemeChange
,
onUnhandledRejection
,
onUnload
,
resolveEasycom
,
shallowSsrRef
,
ssrRef
};
export
{
get
CurrentSubNVue
,
get
SsrGlobalData
,
onAddToFavorites
,
onBackPress
,
onError
,
onHide
,
onLaunch
,
onLoad
,
onNavigationBarButtonTap
,
onNavigationBarSearchInputChanged
,
onNavigationBarSearchInputClicked
,
onNavigationBarSearchInputConfirmed
,
onNavigationBarSearchInputFocusChanged
,
onPageNotFound
,
onPageScroll
,
onPullDownRefresh
,
onReachBottom
,
onReady
,
onResize
,
onShareAppMessage
,
onShareTimeline
,
onShow
,
onTabItemTap
,
onThemeChange
,
onUnhandledRejection
,
onUnload
,
resolveEasycom
,
shallowSsrRef
,
ssrRef
};
packages/uni-app/src/api.ts
0 → 100644
浏览文件 @
0538e72b
export
function
getCurrentSubNVue
()
{
// @ts-ignore
return
uni
.
getSubNVueById
(
plus
.
webview
.
currentWebview
().
id
)
}
packages/uni-app/src/index.ts
浏览文件 @
0538e72b
export
*
from
'
./ssr
'
export
*
from
'
./ssr
'
export
*
from
'
./api
'
export
*
from
'
./utils
'
export
*
from
'
./utils
'
export
*
from
'
./apiLifecycle
'
export
*
from
'
./apiLifecycle
'
packages/uni-components/dist/components.js
浏览文件 @
0538e72b
...
@@ -2947,6 +2947,7 @@ var USlider = defineComponent({
...
@@ -2947,6 +2947,7 @@ var USlider = defineComponent({
const
trigger
=
useCustomEvent
(
sliderRef
,
emit
);
const
trigger
=
useCustomEvent
(
sliderRef
,
emit
);
const
state
=
useSliderState
(
props2
);
const
state
=
useSliderState
(
props2
);
const
listeners
=
useSliderListeners
(
props2
,
state
,
trigger
);
const
listeners
=
useSliderListeners
(
props2
,
state
,
trigger
);
useSliderInject
(
props2
,
state
);
watch
(()
=>
props2
.
value
,
(
val
)
=>
{
watch
(()
=>
props2
.
value
,
(
val
)
=>
{
state
.
sliderValue
=
Number
(
val
);
state
.
sliderValue
=
Number
(
val
);
});
});
...
@@ -3005,7 +3006,7 @@ function useSliderState(props2) {
...
@@ -3005,7 +3006,7 @@ function useSliderState(props2) {
const
_getValueWidth
=
()
=>
{
const
_getValueWidth
=
()
=>
{
const
max
=
Number
(
props2
.
max
);
const
max
=
Number
(
props2
.
max
);
const
min
=
Number
(
props2
.
min
);
const
min
=
Number
(
props2
.
min
);
return
(
(
sliderValue
.
value
-
min
)
/
max
-
min
)
*
sliderWidth
.
value
;
return
(
sliderValue
.
value
-
min
)
/
(
max
-
min
)
*
sliderWidth
.
value
;
};
};
const
state
=
reactive
({
const
state
=
reactive
({
sliderWidth
,
sliderWidth
,
...
@@ -3081,6 +3082,28 @@ function useSliderListeners(props2, state, trigger) {
...
@@ -3081,6 +3082,28 @@ function useSliderListeners(props2, state, trigger) {
};
};
return
listeners
;
return
listeners
;
}
}
function
useSliderInject
(
props2
,
state
)
{
const
uniForm
=
inject
(
uniFormKey
,
false
);
const
formField
=
{
submit
:
()
=>
{
const
data
=
[
""
,
null
];
if
(
props2
.
name
)
{
data
[
0
]
=
props2
.
name
;
data
[
1
]
=
state
.
sliderValue
;
}
return
data
;
},
reset
:
()
=>
{
state
.
sliderValue
=
Number
(
props2
.
value
);
}
};
if
(
!!
uniForm
)
{
uniForm
.
addField
(
formField
);
onUnmounted
(()
=>
{
uniForm
.
removeField
(
formField
);
});
}
}
const
switchProps
=
{
const
switchProps
=
{
name
:
{
name
:
{
type
:
String
,
type
:
String
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录