Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-editor
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
zeroing-editor
Commits
45b15e27
Commit
45b15e27
authored
Dec 04, 2019
by
张晨辰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 增加文本行高和自动换行
parent
a12ad020
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
5 deletions
+40
-5
index.vue
src/components/customElement/node/index.vue
+0
-1
common.js
src/utils/common.js
+15
-3
properties.js
src/utils/properties.js
+15
-1
PropsTab.vue
src/views/Editor/Inspector/PropsTab.vue
+10
-0
No files found.
src/components/customElement/node/index.vue
View file @
45b15e27
...
...
@@ -15,7 +15,6 @@
margin
:
0
;
width
:
100%
;
height
:
100%
;
line-height
:
1
;
}
}
</
style
>
...
...
src/utils/common.js
View file @
45b15e27
...
...
@@ -297,6 +297,16 @@ export const styles = {
// 如果是label类型,把fillColor转换为color
cmpSelfProps
.
color
=
cmpSelfProps
.
fillColor
;
delete
cmpSelfProps
.
fillColor
;
if
(
!
onlyOpera
)
{
if
(
cmpSelfProps
.
lineType
===
'single'
)
{
// word-break: keep-all;white-space: nowrap;
cmpSelfProps
.
wordBreak
=
'keep-all'
;
cmpSelfProps
.
whiteSpace
=
'nowrap'
;
}
else
{
cmpSelfProps
.
wordBreak
=
'break-all'
;
cmpSelfProps
.
whiteSpace
=
'normal'
;
}
}
}
// console.log('cmpSelfProps after inherit ', cmpSelfProps);
...
...
@@ -314,10 +324,12 @@ export const styles = {
result
+=
'border-radius: 50%;'
}
if
(
component
.
type
===
'label'
&&
!
onlyOpera
)
{
//
if (component.type === 'label' && !onlyOpera) {
// 如果是label类型,禁止自动换行
result
+=
'word-break: keep-all;white-space: nowrap;'
}
// console.log('cmpSelfProps', cmpSelfProps);
// result += 'word-break: keep-all;white-space: nowrap;'
// }
// console.log('getComponentStyle',component.name, result);
return
result
;
...
...
src/utils/properties.js
View file @
45b15e27
...
...
@@ -131,7 +131,7 @@ export default {
groupName
:
'文本'
,
text
:
{
title
:
'文本内容'
,
type
:
'
input
'
,
type
:
'
textArea
'
,
value
:
''
},
fillColor
:
{
...
...
@@ -139,6 +139,15 @@ export default {
type
:
'colorPicker'
,
value
:
'#000'
},
lineType
:
{
title
:
'自动换行'
,
type
:
'select'
,
options
:
[
{
label
:
'单行'
,
value
:
'single'
},
{
label
:
'多行'
,
value
:
'multi'
}
],
value
:
'single'
},
size
:
{
title
:
'字体大小'
,
type
:
'swSelect'
,
...
...
@@ -147,6 +156,11 @@ export default {
},
value
:
12
},
lineHeight
:
{
title
:
'行高'
,
type
:
'inputNumber'
,
value
:
1
},
textAlign
:
{
title
:
'文本对齐'
,
type
:
'select'
,
...
...
src/views/Editor/Inspector/PropsTab.vue
View file @
45b15e27
...
...
@@ -95,6 +95,16 @@ const componentMapper = {
'controls-position'
:
'right'
}
},
textArea
:
{
component
:
'el-input'
,
props
:
{
type
:
'textarea'
,
autosize
:
{
minRows
:
3
,
maxRows
:
10
}
}
},
input
:
{
component
:
'el-input'
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment