Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
陈庄旺
uni-app
提交
cdb600cf
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,发现更多精彩内容 >>
提交
cdb600cf
编写于
12月 15, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore(h5): update pageHead
上级
ea759fb2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
32 addition
and
19 deletion
+32
-19
packages/uni-h5/dist/uni-h5.cjs.js
packages/uni-h5/dist/uni-h5.cjs.js
+6
-6
packages/uni-h5/dist/uni-h5.es.js
packages/uni-h5/dist/uni-h5.es.js
+7
-7
packages/uni-h5/src/framework/components/page/pageHead.tsx
packages/uni-h5/src/framework/components/page/pageHead.tsx
+19
-6
未找到文件。
packages/uni-h5/dist/uni-h5.cjs.js
浏览文件 @
cdb600cf
...
...
@@ -10721,7 +10721,7 @@ function usePageHeadButton(pageId, index2, btn, isTransparent) {
badgeText
:
btn
.
badgeText
,
iconStyle
,
onClick
()
{
invokeHook
(
pageId
,
"
onNavigationBarButtonTap
"
,
shared
.
extend
({
invokeHook
(
pageId
,
uniShared
.
ON_NAVIGATION_BAR_BUTTON_TAP
,
shared
.
extend
({
index
:
index2
},
btn
));
}
...
...
@@ -10741,7 +10741,7 @@ function usePageHeadSearchInput({
}
=
searchInput
;
if
(
disabled
)
{
const
onClick
=
()
=>
{
invokeHook
(
id
,
"
onNavigationBarSearchInputClicked
"
);
invokeHook
(
id
,
uniShared
.
ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED
);
};
return
{
focus
,
...
...
@@ -10752,25 +10752,25 @@ function usePageHeadSearchInput({
}
const
onFocus
=
()
=>
{
focus
.
value
=
true
;
invokeHook
(
id
,
"
onNavigationBarSearchInputFocusChanged
"
,
{
invokeHook
(
id
,
uniShared
.
ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
,
{
focus
:
true
});
};
const
onBlur
=
()
=>
{
focus
.
value
=
false
;
invokeHook
(
id
,
"
onNavigationBarSearchInputFocusChanged
"
,
{
invokeHook
(
id
,
uniShared
.
ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
,
{
focus
:
false
});
};
const
onInput
=
(
evt
)
=>
{
text
.
value
=
evt
.
detail
.
value
;
invokeHook
(
id
,
"
onNavigationBarSearchInputChanged
"
,
{
invokeHook
(
id
,
uniShared
.
ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED
,
{
text
:
text
.
value
});
};
const
onKeyup
=
(
evt
)
=>
{
if
(
evt
.
key
===
"
Enter
"
||
evt
.
keyCode
===
13
)
{
invokeHook
(
id
,
"
onNavigationBarSearchInputConfirmed
"
,
{
invokeHook
(
id
,
uniShared
.
ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED
,
{
text
:
text
.
value
});
}
...
...
packages/uni-h5/dist/uni-h5.es.js
浏览文件 @
cdb600cf
import { withModifiers, createVNode, getCurrentInstance, ref, defineComponent, openBlock, createElementBlock, provide, computed, watch, onUnmounted, inject, onBeforeUnmount, mergeProps, injectHook, reactive, onActivated, onMounted, nextTick, onBeforeMount, withDirectives, vShow, shallowRef, watchEffect, isVNode, Fragment, markRaw, createTextVNode, onBeforeActivate, onBeforeDeactivate, createBlock, renderList, onDeactivated, createApp, Transition, effectScope, withCtx, KeepAlive, resolveDynamicComponent, createElementVNode, normalizeStyle, renderSlot } from "vue";
import { isString, extend, stringifyStyle, parseStringStyle, isPlainObject, isFunction, capitalize, camelize, isArray, hasOwn, isObject, toRawType, makeMap as makeMap$1, isPromise, hyphenate, invokeArrayFns as invokeArrayFns$1 } from "@vue/shared";
import { once, UNI_STORAGE_LOCALE, I18N_JSON_DELIMITERS, passive, initCustomDataset, addLeadingSlash, invokeArrayFns, resolveOwnerVm, resolveOwnerEl, ON_WXS_INVOKE_CALL_METHOD, normalizeTarget, ON_RESIZE, ON_APP_ENTER_FOREGROUND, ON_APP_ENTER_BACKGROUND, ON_SHOW, ON_HIDE, ON_PAGE_SCROLL, ON_REACH_BOTTOM, EventChannel, SCHEME_RE, DATA_RE, getCustomDataset, LINEFEED, ON_ERROR, callOptions, ON_LAUNCH, PRIMARY_COLOR, removeLeadingSlash, getLen, debounce, ON_LOAD, UniLifecycleHooks, NAVBAR_HEIGHT, parseQuery, ON_UNLOAD, ON_REACH_BOTTOM_DISTANCE, decodedQuery, WEB_INVOKE_APPSERVICE, ON_WEB_INVOKE_APP_SERVICE, updateElementStyle, ON_BACK_PRESS, parseUrl, addFont, scrollTo, RESPONSIVE_MIN_WIDTH, formatDateTime, ON_PULL_DOWN_REFRESH } from "@dcloudio/uni-shared";
import { once, UNI_STORAGE_LOCALE, I18N_JSON_DELIMITERS, passive, initCustomDataset, addLeadingSlash, invokeArrayFns, resolveOwnerVm, resolveOwnerEl, ON_WXS_INVOKE_CALL_METHOD, normalizeTarget, ON_RESIZE, ON_APP_ENTER_FOREGROUND, ON_APP_ENTER_BACKGROUND, ON_SHOW, ON_HIDE, ON_PAGE_SCROLL, ON_REACH_BOTTOM, EventChannel, SCHEME_RE, DATA_RE, getCustomDataset, LINEFEED, ON_ERROR, callOptions, ON_LAUNCH, PRIMARY_COLOR, removeLeadingSlash, getLen, debounce, ON_LOAD, UniLifecycleHooks, NAVBAR_HEIGHT, parseQuery, ON_UNLOAD, ON_REACH_BOTTOM_DISTANCE, decodedQuery, WEB_INVOKE_APPSERVICE, ON_WEB_INVOKE_APP_SERVICE, updateElementStyle, ON_BACK_PRESS, parseUrl, addFont, scrollTo, RESPONSIVE_MIN_WIDTH, formatDateTime, ON_
NAVIGATION_BAR_BUTTON_TAP, ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED, ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED, ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED, ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED, ON_
PULL_DOWN_REFRESH } from "@dcloudio/uni-shared";
import { initVueI18n, isI18nStr, LOCALE_EN, LOCALE_ES, LOCALE_FR, LOCALE_ZH_HANS, LOCALE_ZH_HANT } from "@dcloudio/uni-i18n";
import { useRoute, createRouter, createWebHistory, createWebHashHistory, useRouter, isNavigationFailure, RouterView } from "vue-router";
const isEnableLocale = once(() => typeof __uniConfig !== "undefined" && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length);
...
...
@@ -21527,7 +21527,7 @@ function usePageHeadButton(pageId, index2, btn, isTransparent) {
badgeText: btn.badgeText,
iconStyle,
onClick() {
invokeHook(pageId,
"onNavigationBarButtonTap"
, extend({
invokeHook(pageId,
ON_NAVIGATION_BAR_BUTTON_TAP
, extend({
index: index2
}, btn));
}
...
...
@@ -21547,7 +21547,7 @@ function usePageHeadSearchInput({
} = searchInput;
if (disabled) {
const onClick = () => {
invokeHook(id2,
"onNavigationBarSearchInputClicked"
);
invokeHook(id2,
ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED
);
};
return {
focus,
...
...
@@ -21558,25 +21558,25 @@ function usePageHeadSearchInput({
}
const onFocus = () => {
focus.value = true;
invokeHook(id2,
"onNavigationBarSearchInputFocusChanged"
, {
invokeHook(id2,
ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
, {
focus: true
});
};
const onBlur = () => {
focus.value = false;
invokeHook(id2,
"onNavigationBarSearchInputFocusChanged"
, {
invokeHook(id2,
ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
, {
focus: false
});
};
const onInput = (evt) => {
text2.value = evt.detail.value;
invokeHook(id2,
"onNavigationBarSearchInputChanged"
, {
invokeHook(id2,
ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED
, {
text: text2.value
});
};
const onKeyup = (evt) => {
if (evt.key === "Enter" || evt.keyCode === 13) {
invokeHook(id2,
"onNavigationBarSearchInputConfirmed"
, {
invokeHook(id2,
ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED
, {
text: text2.value
});
}
...
...
packages/uni-h5/src/framework/components/page/pageHead.tsx
浏览文件 @
cdb600cf
...
...
@@ -10,6 +10,13 @@ import {
ICON_PATH_BACK
,
ICON_PATH_CLOSE
,
}
from
'
@dcloudio/uni-core
'
import
{
ON_NAVIGATION_BAR_BUTTON_TAP
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
,
}
from
'
@dcloudio/uni-shared
'
import
{
usePageMeta
}
from
'
../../setup/provide
'
import
{
usePageHeadTransparent
,
...
...
@@ -357,7 +364,7 @@ function usePageHeadButton(
badgeText
:
btn
.
badgeText
,
iconStyle
,
onClick
()
{
invokeHook
(
pageId
,
'
onNavigationBarButtonTap
'
,
extend
({
index
},
btn
))
invokeHook
(
pageId
,
ON_NAVIGATION_BAR_BUTTON_TAP
,
extend
({
index
},
btn
))
},
}
}
...
...
@@ -374,7 +381,7 @@ function usePageHeadSearchInput({
const
{
disabled
}
=
searchInput
!
if
(
disabled
)
{
const
onClick
=
()
=>
{
invokeHook
(
id
!
,
'
onNavigationBarSearchInputClicked
'
)
invokeHook
(
id
!
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED
)
}
return
{
focus
,
...
...
@@ -385,19 +392,25 @@ function usePageHeadSearchInput({
}
const
onFocus
=
()
=>
{
focus
.
value
=
true
invokeHook
(
id
!
,
'
onNavigationBarSearchInputFocusChanged
'
,
{
focus
:
true
})
invokeHook
(
id
!
,
ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
,
{
focus
:
true
,
})
}
const
onBlur
=
()
=>
{
focus
.
value
=
false
invokeHook
(
id
!
,
'
onNavigationBarSearchInputFocusChanged
'
,
{
focus
:
false
})
invokeHook
(
id
!
,
ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
,
{
focus
:
false
,
})
}
const
onInput
=
(
evt
:
{
detail
:
{
value
:
string
}
})
=>
{
text
.
value
=
evt
.
detail
.
value
invokeHook
(
id
!
,
'
onNavigationBarSearchInputChanged
'
,
{
text
:
text
.
value
})
invokeHook
(
id
!
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED
,
{
text
:
text
.
value
,
})
}
const
onKeyup
=
(
evt
:
KeyboardEvent
)
=>
{
if
(
evt
.
key
===
'
Enter
'
||
evt
.
keyCode
===
13
)
{
invokeHook
(
id
!
,
'
onNavigationBarSearchInputConfirmed
'
,
{
invokeHook
(
id
!
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED
,
{
text
:
text
.
value
,
})
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录