Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
genary
uni-app
提交
50a55241
U
uni-app
项目概览
genary
/
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,发现更多精彩内容 >>
提交
50a55241
编写于
3月 31, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: build
上级
5cc22066
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
43 addition
and
13 deletion
+43
-13
packages/uni-h5/dist/uni-h5.cjs.js
packages/uni-h5/dist/uni-h5.cjs.js
+21
-4
packages/uni-h5/dist/uni-h5.es.js
packages/uni-h5/dist/uni-h5.es.js
+21
-4
packages/uni-mp-alipay/dist/uni.mp.esm.js
packages/uni-mp-alipay/dist/uni.mp.esm.js
+1
-5
未找到文件。
packages/uni-h5/dist/uni-h5.cjs.js
浏览文件 @
50a55241
...
...
@@ -2903,6 +2903,10 @@ const props$k = /* @__PURE__ */ shared.extend({}, {
confirmHold
:
{
type
:
Boolean
,
default
:
false
},
ignoreCompositionEvent
:
{
type
:
Boolean
,
default
:
true
}
},
props$n
);
const
emit
=
[
...
...
@@ -2912,6 +2916,9 @@ const emit = [
"
update:value
"
,
"
update:modelValue
"
,
"
update:focus
"
,
"
compositionstart
"
,
"
compositionupdate
"
,
"
compositionend
"
,
...
emit$1
];
function
useBase
(
props2
,
rootRef
,
emit2
)
{
...
...
@@ -3006,7 +3013,7 @@ function useAutoFocus(props2, fieldRef) {
}
});
}
function
useEvent
(
fieldRef
,
state
,
trigger
,
triggerInput
,
beforeInput
)
{
function
useEvent
(
fieldRef
,
state
,
props2
,
trigger
,
triggerInput
,
beforeInput
)
{
function
checkSelection
()
{
const
field
=
fieldRef
.
value
;
if
(
field
&&
state
.
focus
&&
state
.
selectionStart
>
-
1
&&
state
.
selectionEnd
>
-
1
&&
field
.
type
!==
"
number
"
)
{
...
...
@@ -3043,7 +3050,7 @@ function useEvent(fieldRef, state, trigger, triggerInput, beforeInput) {
return
;
}
state
.
value
=
field
.
value
;
if
(
!
state
.
composing
)
{
if
(
!
state
.
composing
||
!
props2
.
ignoreCompositionEvent
)
{
triggerInput
(
event
,
{
value
:
field
.
value
,
cursor
:
getFieldSelectionEnd
(
field
)
...
...
@@ -3068,6 +3075,7 @@ function useEvent(fieldRef, state, trigger, triggerInput, beforeInput) {
field
.
addEventListener
(
"
compositionstart
"
,
(
event
)
=>
{
event
.
stopPropagation
();
state
.
composing
=
true
;
_onComposition
(
event
);
});
field
.
addEventListener
(
"
compositionend
"
,
(
event
)
=>
{
event
.
stopPropagation
();
...
...
@@ -3075,7 +3083,16 @@ function useEvent(fieldRef, state, trigger, triggerInput, beforeInput) {
state
.
composing
=
false
;
onInput
(
event
);
}
_onComposition
(
event
);
});
field
.
addEventListener
(
"
compositionupdate
"
,
_onComposition
);
function
_onComposition
(
event
)
{
if
(
!
props2
.
ignoreCompositionEvent
)
{
trigger
(
event
.
type
,
event
,
{
value
:
event
.
data
});
}
}
}
vue
.
watch
([()
=>
state
.
selectionStart
,
()
=>
state
.
selectionEnd
],
checkSelection
);
vue
.
watch
(()
=>
state
.
cursor
,
checkCursor
);
...
...
@@ -3089,7 +3106,7 @@ function useField(props2, rootRef, emit2, beforeInput) {
useKeyboard$1
(
props2
,
fieldRef
);
const
{
state
:
scopedAttrsState
}
=
useScopedAttrs
();
useFormField
(
"
name
"
,
state
);
useEvent
(
fieldRef
,
state
,
trigger
,
triggerInput
,
beforeInput
);
useEvent
(
fieldRef
,
state
,
props2
,
trigger
,
triggerInput
,
beforeInput
);
const
fixDisabledColor
=
false
;
return
{
fieldRef
,
...
...
@@ -6408,7 +6425,7 @@ let fixMargin = false;
var
index$i
=
/* @__PURE__ */
defineBuiltInComponent
({
name
:
"
Textarea
"
,
props
:
props$a
,
emit
:
[
"
confirm
"
,
"
linechange
"
,
...
emit
],
emit
s
:
[
"
confirm
"
,
"
linechange
"
,
...
emit
],
setup
(
props2
,
{
emit
:
emit2
})
{
...
...
packages/uni-h5/dist/uni-h5.es.js
浏览文件 @
50a55241
...
...
@@ -8449,6 +8449,10 @@ const props$r = /* @__PURE__ */ extend({}, {
confirmHold: {
type: Boolean,
default: false
},
ignoreCompositionEvent: {
type: Boolean,
default: true
}
}, props$u);
const emit = [
...
...
@@ -8458,6 +8462,9 @@ const emit = [
"update:value",
"update:modelValue",
"update:focus",
"compositionstart",
"compositionupdate",
"compositionend",
...emit$1
];
function useBase(props2, rootRef, emit2) {
...
...
@@ -8561,7 +8568,7 @@ function useAutoFocus(props2, fieldRef) {
}
});
}
function useEvent(fieldRef, state2, trigger, triggerInput, beforeInput) {
function useEvent(fieldRef, state2,
props2,
trigger, triggerInput, beforeInput) {
function checkSelection() {
const field = fieldRef.value;
if (field && state2.focus && state2.selectionStart > -1 && state2.selectionEnd > -1 && field.type !== "number") {
...
...
@@ -8598,7 +8605,7 @@ function useEvent(fieldRef, state2, trigger, triggerInput, beforeInput) {
return;
}
state2.value = field.value;
if (!state2.composing) {
if (!state2.composing
|| !props2.ignoreCompositionEvent
) {
triggerInput(event, {
value: field.value,
cursor: getFieldSelectionEnd(field)
...
...
@@ -8623,6 +8630,7 @@ function useEvent(fieldRef, state2, trigger, triggerInput, beforeInput) {
field.addEventListener("compositionstart", (event) => {
event.stopPropagation();
state2.composing = true;
_onComposition(event);
});
field.addEventListener("compositionend", (event) => {
event.stopPropagation();
...
...
@@ -8630,7 +8638,16 @@ function useEvent(fieldRef, state2, trigger, triggerInput, beforeInput) {
state2.composing = false;
onInput(event);
}
_onComposition(event);
});
field.addEventListener("compositionupdate", _onComposition);
function _onComposition(event) {
if (!props2.ignoreCompositionEvent) {
trigger(event.type, event, {
value: event.data
});
}
}
}
watch([() => state2.selectionStart, () => state2.selectionEnd], checkSelection);
watch(() => state2.cursor, checkCursor);
...
...
@@ -8644,7 +8661,7 @@ function useField(props2, rootRef, emit2, beforeInput) {
useKeyboard$1(props2, fieldRef);
const { state: scopedAttrsState } = useScopedAttrs();
useFormField("name", state2);
useEvent(fieldRef, state2, trigger, triggerInput, beforeInput);
useEvent(fieldRef, state2,
props2,
trigger, triggerInput, beforeInput);
const fixDisabledColor = String(navigator.vendor).indexOf("Apple") === 0 && CSS.supports("image-orientation:from-image");
return {
fieldRef,
...
...
@@ -13397,7 +13414,7 @@ function setFixMargin() {
var index$i = /* @__PURE__ */ defineBuiltInComponent({
name: "Textarea",
props: props$h,
emit: ["confirm", "linechange", ...emit],
emit
s
: ["confirm", "linechange", ...emit],
setup(props2, {
emit: emit2
}) {
...
...
packages/uni-mp-alipay/dist/uni.mp.esm.js
浏览文件 @
50a55241
...
...
@@ -22,8 +22,7 @@ const ON_BACK_PRESS = 'onBackPress';
const
ON_TAB_ITEM_TAP
=
'
onTabItemTap
'
;
const
ON_REACH_BOTTOM
=
'
onReachBottom
'
;
const
ON_PULL_DOWN_REFRESH
=
'
onPullDownRefresh
'
;
const
ON_ADD_TO_FAVORITES
=
'
onAddToFavorites
'
;
const
ON_SHARE_APP_MESSAGE
=
'
onShareAppMessage
'
;
const
ON_ADD_TO_FAVORITES
=
'
onAddToFavorites
'
;
const
customizeRE
=
/:/g
;
function
customizeEvent
(
str
)
{
...
...
@@ -315,9 +314,6 @@ const HOOKS = [
ON_PAGE_NOT_FOUND
,
ON_UNHANDLE_REJECTION
,
];
{
HOOKS
.
push
(
ON_SHARE_APP_MESSAGE
);
}
function
parseApp
(
instance
,
parseAppOptions
)
{
const
internalInstance
=
instance
.
$
;
const
appOptions
=
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录