Skip to content

Commit b2cfcfb

Browse files
authored
docs(fluent-editor): optimize mobile-first demo (#1836)
1 parent 5a6b45a commit b2cfcfb

File tree

6 files changed

+56
-16
lines changed

6 files changed

+56
-16
lines changed

examples/sites/demos/mobile-first/app/fluent-editor/options.vue

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,33 @@ export default {
1717
return {
1818
content: '',
1919
options: {
20-
placeholder: '请输入内容'
20+
placeholder: '请输入内容',
21+
modules: {
22+
// 工具栏
23+
toolbar: [
24+
['bold', 'italic', 'underline', 'strike'],
25+
[{ list: 'bullet' }, { list: 'ordered' }],
26+
[{ align: '' }, { align: 'center' }, { align: 'right' }],
27+
['better-table'],
28+
['fullscreen'],
29+
],
30+
// 字数统计
31+
counter: true,
32+
// 表格
33+
'better-table': {
34+
operationMenu: {
35+
color: {
36+
text: '主题色',
37+
colors: [
38+
'#ffffff', '#f2f2f2', '#dddddd', '#a6a6a6', '#666666', '#000000',
39+
'#c00000', '#ff0000', '#ffc8d3', '#ffc000', '#ffff00', '#fff4cb',
40+
'#92d050', '#00b050', '#dff3d2', '#00b0f0', '#0070c0', '#d4f1f5',
41+
'#002060', '#7030a0', '#7b69ee', '#1476ff', '#ec66ab', '#42b883',
42+
]
43+
}
44+
}
45+
}
46+
}
2147
}
2248
}
2349
}

examples/sites/demos/mobile-first/app/fluent-editor/webdoc/fluent-editor.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,10 @@ export default {
1414
},
1515
codeFiles: ['basic-usage.vue']
1616
},
17-
{
18-
demoId: 'data-switch',
19-
name: {
20-
'zh-CN': '数据格式转换',
21-
'en-US': 'Vertical divider line'
22-
},
23-
desc: {
24-
'zh-CN':
25-
'<p>通过 <code>data-type</code> 指定富文本数据保存的格式。数据默认保存格式为 Delta 形式,若需要将数据保存格式设置为 HTML 形式,并关闭 HTML 格式自动转 Delta 格式,设置 <code>:data-type="false"</code>,<code>:data-upgrade="false"</code>。</p>',
26-
'en-US': '<p>The direction of the separator line can be set through the<code>direction</code>attribute.</p>'
27-
},
28-
codeFiles: ['data-switch.vue']
29-
},
3017
{
3118
demoId: 'disabled',
3219
name: {
33-
'zh-CN': '禁用态',
20+
'zh-CN': '禁用状态',
3421
'en-US': 'The position of the separator copy'
3522
},
3623
desc: {
@@ -64,5 +51,18 @@ export default {
6451
},
6552
codeFiles: ['options.vue']
6653
},
54+
{
55+
demoId: 'data-switch',
56+
name: {
57+
'zh-CN': '数据格式转换',
58+
'en-US': 'Vertical divider line'
59+
},
60+
desc: {
61+
'zh-CN':
62+
'<p>通过 <code>data-type</code> 指定富文本数据保存的格式。数据默认保存格式为 Delta 形式,若需要将数据保存格式设置为 HTML 形式,并关闭 HTML 格式自动转 Delta 格式,设置 <code>:data-type="false"</code>,<code>:data-upgrade="false"</code>。</p>',
63+
'en-US': '<p>The direction of the separator line can be set through the<code>direction</code>attribute.</p>'
64+
},
65+
codeFiles: ['data-switch.vue']
66+
},
6767
]
6868
}

packages/fluent-editor/src/assets/toolbar.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ $arrowWidth: 5px; // 下拉框箭头宽度
289289
}
290290

291291
.ql-picker-options {
292-
width: 180px;
292+
width: 210px;
293293
padding: 15px 20px;
294294
}
295295

packages/theme-saas/src/fluent-editor/index.less

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
}
6363

6464
span.ql-lineheight {
65+
@apply w-16;
66+
6567
> span {
6668
@apply w-16;
6769
}
@@ -132,6 +134,13 @@
132134
}
133135
}
134136

137+
span.ql-picker.ql-color-picker.ql-expanded {
138+
.ql-picker-options {
139+
@apply w-45;
140+
@apply py-1 px-1;
141+
}
142+
}
143+
135144
.ql-align.ql-picker {
136145
.ql-picker-label {
137146
@apply pt-1 ~'pr-1.5' pb-0 ~'pl-1.5';

packages/theme-saas/theme/defaultTheme.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ module.exports = {
6262
56: '14rem',
6363
52: '13rem',
6464
48: '12rem',
65+
45: '11.25rem',
6566
44: '11rem',
6667
40: '10rem',
6768
36: '9rem',

packages/theme/src/fluent-editor/index.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
margin-bottom: 4px;
1818

1919
.ql-color-picker {
20+
.ql-picker-options {
21+
width: 180px;
22+
}
23+
2024
.ql-picker-label {
2125
> div {
2226
display: flex;

0 commit comments

Comments
 (0)