Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
af64a79b
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6373
Star
108
Fork
184
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
24
列表
看板
标记
里程碑
合并请求
2
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
24
Issue
24
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
af64a79b
编写于
6月 25, 2025
作者:
taohebin@dcloud.io
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: textarea 增加change示例、自动化测试
上级
43565ce2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
2 deletion
+21
-2
pages/component/textarea/textarea.test.js
pages/component/textarea/textarea.test.js
+14
-0
pages/component/textarea/textarea.uvue
pages/component/textarea/textarea.uvue
+7
-2
未找到文件。
pages/component/textarea/textarea.test.js
浏览文件 @
af64a79b
...
...
@@ -26,6 +26,20 @@ describe('component-native-textarea', () => {
let
res
=
await
page
.
data
(
'
jest_result
'
);
expect
(
res
).
toBe
(
true
)
})
it
(
'
trigger change event
'
,
async
()
=>
{
await
page
.
setData
({
focus_boolean
:
false
,
})
await
page
.
waitFor
(
500
)
const
changeValue
=
await
page
.
data
(
'
changeValue
'
);
expect
(
changeValue
).
not
.
toBe
(
""
)
await
page
.
setData
({
focus_boolean
:
true
,
})
await
page
.
waitFor
(
500
)
})
it
(
"
reset status
"
,
async
()
=>
{
await
program
.
adbCommand
(
"
input keyevent KEYCODE_DEL
"
)
await
page
.
waitFor
(
2000
)
...
...
pages/component/textarea/textarea.uvue
浏览文件 @
af64a79b
...
...
@@ -27,7 +27,8 @@
adjust_position: false,
disabled: false,
jest_result: false,
isAutoTest: false
isAutoTest: false,
changeValue:""
}
},
...
...
@@ -49,6 +50,10 @@
textarea_keyboardheightchange() { console.log("键盘高度发生变化的时候触发此事件,event.detail = {height: height, duration: duration}") },
textarea_focus(event: UniTextareaFocusEvent) {
this.jest_result = event.detail.height >= 0
},
textarea_change(event: UniInputChangeEvent) {
console.log("textarea_change", event.detail.value);
this.changeValue = event.detail.value
},
change_adjust_position_boolean(checked : boolean) { this.adjust_position_boolean = checked },
change_show_confirm_bar_boolean(checked : boolean) { this.show_confirm_bar_boolean = checked },
...
...
@@ -101,7 +106,7 @@
@touchstart="textarea_touchstart" @touchmove="textarea_touchmove" @touchcancel="textarea_touchcancel"
@touchend="textarea_touchend" @tap="textarea_tap" @longpress="textarea_longpress" @confirm="textarea_confirm"
@input="textarea_input" @linechange="textarea_linechange" @blur="textarea_blur"
@keyboardheightchange="textarea_keyboardheightchange" @focus="textarea_focus"
@keyboardheightchange="textarea_keyboardheightchange" @focus="textarea_focus"
@change="textarea_change"
style="padding: 10px; border: 1px solid #666;height: 200px" />
</view>
<view style="margin-bottom: 40px;">
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录