Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
H5Public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
CI / CD
CI / CD
流水线
作业
日程
统计图
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
H5Public
Commits
7a4237fb
提交
7a4237fb
authored
12月 14, 2019
作者:
王绍森
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加灰色背景的多行的textareaItem
上级
fa57284f
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
68 行增加
和
1 行删除
+68
-1
index.js
baseComponents/FormArray/index.js
+11
-1
index.js
baseComponents/TextareaItemMultiRows/index.js
+28
-0
index.less
baseComponents/TextareaItemMultiRows/index.less
+29
-0
TextareaItemMultiRows.png
examples/TextareaItemMultiRows.png
+0
-0
没有找到文件。
baseComponents/FormArray/index.js
浏览文件 @
7a4237fb
...
...
@@ -3,6 +3,7 @@ import { DatePicker, Picker, TextareaItem, InputItem, List, Switch } from 'antd-
import
moment
from
'moment'
;
import
PropTypes
from
'prop-types'
;
import
FieldList
from
'@/H5Public/baseComponents/FieldList'
;
import
TextareaItemMultiRows
from
'../TextareaItemMultiRows'
const
DiyInput
=
(
props
)
=>
{
...
...
@@ -30,7 +31,7 @@ const DiyInput = (props) => {
};
const
DiyTextarea
=
(
props
)
=>
{
let
{
config
,
formValue
,
changeValue
}
=
props
;
let
{
config
,
formValue
,
changeValue
,
noLengthLimit
,
rows
,
}
=
props
;
if
(
config
.
readOnly
)
{
config
.
placeholder
=
''
;
}
else
{
...
...
@@ -196,6 +197,15 @@ class FormArray extends Component {
changeValue
=
{
this
.
changeValue
}
/
>
);
case
'TextareaItemMultiRows'
:
return
(
<
TextareaItemMultiRows
key
=
{
x
.
key
}
config
=
{
x
}
value
=
{
formValues
[
x
.
key
]}
onChange
=
{
val
=>
this
.
changeValue
(
val
,
x
.
key
)}
/
>
)
case
'Picker'
:
return
(
<
DiyPicker
...
...
baseComponents/TextareaItemMultiRows/index.js
0 → 100644
浏览文件 @
7a4237fb
import
{
TextareaItem
}
from
'antd-mobile'
;
import
styles
from
'./index.less'
;
export
default
function
TextareaItemMultiRows
({
config
,
value
,
onChange
})
{
const
{
name
,
readOnly
,
rows
,
required
,
...
rest
}
=
config
;
let
{
placeholder
}
=
config
;
if
(
readOnly
)
{
placeholder
=
''
;
}
else
{
placeholder
=
placeholder
||
'点击输入'
;
}
return
(
<
div
className
=
{
styles
.
container
}
>
<
div
className
=
{
styles
.
label
}
>
<
span
style
=
{{
color
:
required
?
'red'
:
'inherit'
}}
>*&
nbsp
;
<
/span
>
{
name
}
<
/div
>
<
TextareaItem
rows
=
{
rows
}
placeholder
=
{
placeholder
}
editable
=
{
!
readOnly
}
value
=
{
value
}
onChange
=
{
onChange
}
{...
rest
}
/
>
<
/div
>
);
}
baseComponents/TextareaItemMultiRows/index.less
0 → 100644
浏览文件 @
7a4237fb
.container {
position: relative;
&::after {
content: '';
position: absolute;
background-color: #ddd;
display: block;
z-index: 1;
top: auto;
right: auto;
bottom: 0;
left: 0;
width: 100%;
height: 1px;
transform-origin: 50% 100%;
transform: scaleY(0.3);
}
.label {
font-size: 17px;
padding: 15px 0 0 15px;
}
:global {
textarea {
background: rgba(238, 238, 238, 1);
border-radius: 0.12rem;
padding: 0.25rem;
}
}
}
examples/TextareaItemMultiRows.png
0 → 100644
浏览文件 @
7a4237fb
69.6 KB
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论