Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
873141ba
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5995
Star
90
Fork
162
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
18
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
18
Issue
18
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
873141ba
编写于
9月 08, 2023
作者:
D
DCloud_LXH
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: 处理 warning
上级
a4b9d0a6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
49 addition
and
52 deletion
+49
-52
components/enum-data/enum-data.vue
components/enum-data/enum-data.vue
+48
-46
components/input-data/input-data.vue
components/input-data/input-data.vue
+1
-6
未找到文件。
components/enum-data/enum-data.vue
浏览文件 @
873141ba
<
script
lang=
"uts"
>
export
type
ItemType
=
{
value
:
number
;
name
:
string
}
export
type
ItemType
=
{
value
:
number
;
name
:
string
}
export
default
{
props
:
{
title
:
{
type
:
String
,
default
:
''
},
items
:
{
type
:
Array
as
PropType
<
Array
<
ItemType
>>
,
required
:
true
}
},
data
()
{
return
{
current
:
0
}
},
methods
:
{
// @ts-ignore
_change
(
e
:
RadioGroupChangeEvent
)
{
const
selected
=
this
.
items
.
find
((
item
)
:
boolean
=>
{
return
item
.
name
===
e
.
detail
.
value
as
string
})
this
.
current
=
selected
?.
value
as
number
this
.
$emit
(
'
change
'
,
this
.
current
)
uni
.
showToast
({
icon
:
'
none
'
,
title
:
'
当前选中:
'
+
selected
?.
name
,
})
}
}
}
export
default
{
props
:
{
title
:
{
type
:
String
,
default
:
''
},
items
:
{
type
:
Array
as
PropType
<
Array
<
ItemType
>>
,
required
:
true
}
},
data
()
{
return
{
current
:
0
}
},
methods
:
{
// @ts-ignore
_change
(
e
:
RadioGroupChangeEvent
)
{
const
selected
=
this
.
items
.
find
((
item
:
ItemType
)
:
boolean
=>
{
return
item
.
name
===
e
.
detail
.
value
})
as
ItemType
|
null
if
(
selected
!==
null
)
{
this
.
current
=
selected
.
value
this
.
$emit
(
'
change
'
,
this
.
current
)
uni
.
showToast
({
icon
:
'
none
'
,
title
:
'
当前选中:
'
+
selected
.
name
,
})
}
}
}
}
</
script
>
<
template
>
<view
class=
"uni-padding-wrap"
>
<view
class=
"uni-title uni-common-mt"
>
<text
class=
"uni-title-text"
>
{{
title
}}
</text>
</view>
</view>
<view
class=
"uni-list uni-common-pl"
>
<radio-group
@
change=
"_change"
class=
"radio-group"
>
<radio
class=
"uni-list-cell uni-list-cell-pd radio"
v-for=
"(item, index) in items"
:key=
"item.name"
:class=
"index
<
items.length
-
1
?
'
uni-list-cell-line
'
:
''"
:value=
"item.name"
:checked=
"index === current"
>
{{
item
.
name
}}
</radio>
</radio-group>
</view>
<view
class=
"uni-padding-wrap"
>
<view
class=
"uni-title uni-common-mt"
>
<text
class=
"uni-title-text"
>
{{
title
}}
</text>
</view>
</view>
<view
class=
"uni-list uni-common-pl"
>
<radio-group
@
change=
"_change"
class=
"radio-group"
>
<radio
class=
"uni-list-cell uni-list-cell-pd radio"
v-for=
"(item, index) in items"
:key=
"item.name"
:class=
"index
<
items.length
-
1
?
'
uni-list-cell-line
'
:
''"
:value=
"item.name"
:checked=
"index === current"
>
{{
item
.
name
}}
</radio>
</radio-group>
</view>
</
template
>
<
style
></
style
>
\ No newline at end of file
<
style
></
style
>
components/input-data/input-data.vue
浏览文件 @
873141ba
...
...
@@ -48,10 +48,6 @@
this
.
showClearIcon
=
false
this
.
$emit
(
'
confirm
'
,
this
.
getValue
(
this
.
inputClearValue
))
},
// @ts-ignore
confirm
(
e
:
InputConfirmEvent
)
{
// this.$emit('confirm', this.getValue(e.detail.value))
},
blur
()
{
this
.
showClearIcon
=
false
},
...
...
@@ -85,8 +81,7 @@
</view>
</view>
<view
class=
"uni-input-wrapper input-wrapper"
>
<input
class=
"uni-input"
:type=
"inputType"
:value=
"inputClearValue"
:placeholder=
"title"
@
input=
"input"
@
confirm=
"confirm"
@
blur=
"blur"
@
focus=
"focus"
/>
<input
class=
"uni-input"
:type=
"inputType"
:value=
"inputClearValue"
:placeholder=
"title"
@
input=
"input"
@
blur=
"blur"
@
focus=
"focus"
/>
<image
class=
"input-wrapper_image"
src=
"/static/icons/clear.png"
v-if=
"showClearIcon"
@
click=
"clearIcon"
>
</image>
</view>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录