npmapps 1.0.25 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PUBLISH.md +268 -0
- package/app/.codegraph/daemon.pid +6 -0
- package/app/.eslintrc.js +19 -0
- package/app/README.md +24 -0
- package/app/babel.config.js +5 -0
- package/app/devtool-windows-amd64.zip +0 -0
- package/app/docs/superpowers/plans/2026-05-29-quill-editor.md +836 -0
- package/app/docs/superpowers/specs/2026-05-29-quill-editor-design.md +210 -0
- package/app/docs/superpowers/specs/2026-06-06-lazy-cascader-design.md +400 -0
- package/app/jsconfig.json +19 -0
- package/app/package-lock.json +21347 -0
- package/app/package.json +63 -0
- package/app/postcss.config.js +10 -0
- package/app/public/favicon.ico +0 -0
- package/app/public/index.html +17 -0
- package/app/public//344/270/200/351/224/256/351/273/221/346/232/227.html +136 -0
- package/app/src/App.vue +110 -0
- package/app/src/assets/bpmn-camunda.jpg +0 -0
- package/app/src/assets/css/diagram.less +17 -0
- package/app/src/assets/icon/Icon.less +31 -0
- package/app/src/assets/icon/font/app-codes.css +26 -0
- package/app/src/assets/icon/font/app.eot +0 -0
- package/app/src/assets/icon/font/app.svg +60 -0
- package/app/src/assets/icon/font/app.ttf +0 -0
- package/app/src/assets/icon/font/app.woff +0 -0
- package/app/src/assets/icon/font/app.woff2 +0 -0
- package/app/src/assets/icon/font/config.json +248 -0
- package/app/src/assets/icon/font/source/raw/align-bottom-tool.svg +30 -0
- package/app/src/assets/icon/font/source/raw/align-horizontal-center-tool.svg +85 -0
- package/app/src/assets/icon/font/source/raw/align-left-tool.svg +84 -0
- package/app/src/assets/icon/font/source/raw/align-right-tool.svg +80 -0
- package/app/src/assets/icon/font/source/raw/align-top-tool.svg +84 -0
- package/app/src/assets/icon/font/source/raw/align-vertical-center-tool.svg +89 -0
- package/app/src/assets/icon/font/source/raw/distribute-horizontally-tool.svg +95 -0
- package/app/src/assets/icon/font/source/raw/distribute-vertically-tool.svg +99 -0
- package/app/src/assets/icon/font/source/raw/set-color-tool.svg +111 -0
- package/app/src/assets/icon/font/source/symbols/align-bottom-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/align-horizontal-center-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/align-left-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/align-right-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/align-top-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/align-vertical-center-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/distribute-horizontally-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/distribute-vertically-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/set-color-tool.svg +63 -0
- package/app/src/assets/logo.png +0 -0
- package/app/src/components/EllTable/README.md +70 -0
- package/app/src/components/EllTable/article.md +184 -0
- package/app/src/components/EllTable/index.js +213 -0
- package/app/src/components/FormulaEditor/FunctionSelector.vue +123 -0
- package/app/src/components/FormulaEditor/OperatorSelector.vue +184 -0
- package/app/src/components/FormulaEditor/ParameterSelector.vue +123 -0
- package/app/src/components/FormulaEditor/api.js +69 -0
- package/app/src/components/FormulaEditor/index.vue +435 -0
- package/app/src/components/HelloWorld.vue +58 -0
- package/app/src/components/PageHeader/index.vue +158 -0
- package/app/src/components/Splitter/README.md +144 -0
- package/app/src/components/Splitter/example.vue +88 -0
- package/app/src/components/Splitter/index.vue +203 -0
- package/app/src/components/diagram/ToolBar.vue +357 -0
- package/app/src/components/diagram/customTranslate/customTranslate.js +12 -0
- package/app/src/components/diagram/customTranslate/translationsGerman.js +241 -0
- package/app/src/components/diagram/index.vue +261 -0
- package/app/src/components/diagram/xmlData.js +29 -0
- package/app/src/directives/filldown.js +155 -0
- package/app/src/directives/filldownTable.js +291 -0
- package/app/src/main.js +40 -0
- package/app/src/router/index.js +63 -0
- package/app/src/store/index.js +23 -0
- package/app/src/utils/winBox.js +23 -0
- package/app/src/views/Extend/A.vue +12 -0
- package/app/src/views/Extend/B.vue +10 -0
- package/app/src/views/Extend/MagicalComponentsForELFormItem.vue +87 -0
- package/app/src/views/Extend/index.vue +59 -0
- package/app/src/views/Extend/tableMouseHorizontalWheel.vue +193 -0
- package/app/src/views/Home.vue +37 -0
- package/app/src/views/RouterJump.vue +155 -0
- package/app/src/views/css.vue +57 -0
- package/app/src/views/cssComponents/EllipsisText.vue +83 -0
- package/app/src/views/cssComponents/HoverCard.vue +79 -0
- package/app/src/views/cssComponents/TableHover.vue +140 -0
- package/app/src/views/cssComponents/inputSlo.vue +52 -0
- package/app/src/views/cssComponents/tableFixed.vue +158 -0
- package/app/src/views/echarts/echart-dome.vue +82 -0
- package/app/src/views/echarts/index.vue +118 -0
- package/app/src/views/echarts/pei3d.vue +667 -0
- package/app/src/views/element/bpmn/index.vue +18 -0
- package/app/src/views/element/components/attendanceCycle/index.vue +131 -0
- package/app/src/views/element/components/attendanceGroup/index.vue +147 -0
- package/app/src/views/element/components/attendancePersonnel/index.vue +158 -0
- package/app/src/views/element/components/companyCalendar/index.vue +147 -0
- package/app/src/views/element/components/shift/index.vue +147 -0
- package/app/src/views/element/components/shiftRotationSystem/index.vue +147 -0
- package/app/src/views/element/elTableJsx/columnManagement.vue +340 -0
- package/app/src/views/element/elTableJsx/dialogInput.vue +71 -0
- package/app/src/views/element/elTableJsx/elTableJsx.vue +1826 -0
- package/app/src/views/element/elTableJsx/formTable.vue +598 -0
- package/app/src/views/element/elTableJsx/index.vue +29 -0
- package/app/src/views/element/elTableJsx/simpleTable.vue +192 -0
- package/app/src/views/element/elTableJsx.zip +0 -0
- package/app/src/views/element/index.vue +44 -0
- package/app/src/views/element/lazyCascader/LazyCascader.vue +302 -0
- package/app/src/views/element/lazyCascader/data.js +205 -0
- package/app/src/views/element/lazyCascader/index.vue +315 -0
- package/app/src/views/element/quillEditor/README.md +163 -0
- package/app/src/views/element/quillEditor/example.vue +314 -0
- package/app/src/views/element/quillEditor/index.vue +409 -0
- package/app/src/views/element/quillEditor/toolbar.js +122 -0
- package/app/vue.config.js +15 -0
- package/package.json +1 -1
- package/app/wujie-vue3-child/.claude/settings.local.json +0 -8
- package/app/wujie-vue3-child/.vscode/extensions.json +0 -3
- package/app/wujie-vue3-child/PROJECT_MEMORY.md +0 -427
- package/app/wujie-vue3-child/README.md +0 -5
- package/app/wujie-vue3-child/index.html +0 -13
- package/app/wujie-vue3-child/package-lock.json +0 -5744
- package/app/wujie-vue3-child/package.json +0 -28
- package/app/wujie-vue3-child/public/vite.svg +0 -1
- package/app/wujie-vue3-child/src/App.vue +0 -130
- package/app/wujie-vue3-child/src/assets/vue.svg +0 -1
- package/app/wujie-vue3-child/src/components/HelloWorld.vue +0 -43
- package/app/wujie-vue3-child/src/components/SmartAnchorTabs/index.jsx +0 -224
- package/app/wujie-vue3-child/src/components/SmartAnchorTabs/style.css +0 -154
- package/app/wujie-vue3-child/src/components/tags-view.vue +0 -193
- package/app/wujie-vue3-child/src/components/tags-view1.vue +0 -131
- package/app/wujie-vue3-child/src/directives/aiLoading.js +0 -182
- package/app/wujie-vue3-child/src/hooks/useClickOutside.js +0 -11
- package/app/wujie-vue3-child/src/hooks/useTableDragSort.js +0 -28
- package/app/wujie-vue3-child/src/main.js +0 -18
- package/app/wujie-vue3-child/src/router/index.js +0 -104
- package/app/wujie-vue3-child/src/store/tagsViewStroe.js +0 -34
- package/app/wujie-vue3-child/src/style.css +0 -171
- package/app/wujie-vue3-child/src/views/aiCoach/collapseExpand/index.jsx +0 -108
- package/app/wujie-vue3-child/src/views/aiCoach/collapseExpand/index.module.scss +0 -97
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/README.md +0 -836
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/REFLEX_EXAMPLES.md +0 -728
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentPersonnelSelector.jsx +0 -687
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentPersonnelSelector.module.scss +0 -560
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelector.jsx +0 -570
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelector.module.scss +0 -330
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelectorV2.jsx +0 -378
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelectorV2.module.scss +0 -228
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/OptionsSelector.jsx +0 -399
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/OptionsSelector.module.scss +0 -252
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PersonnelSelector.jsx +0 -585
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PersonnelSelector.module.scss +0 -331
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PopoverSelector.jsx +0 -392
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PopoverSelector.module.scss +0 -39
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/README.md +0 -248
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/SelectorTrigger.jsx +0 -194
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/index.jsx +0 -1459
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/mockData.js +0 -301
- package/app/wujie-vue3-child/src/views/aiCoach/dialogueSegment/index.jsx +0 -182
- package/app/wujie-vue3-child/src/views/aiCoach/dialogueSegment/index.module.scss +0 -28
- package/app/wujie-vue3-child/src/views/aiCoach/index.jsx +0 -375
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ChartsPanel/index.jsx +0 -121
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ChartsPanel/index.module.scss +0 -76
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/DonutChart/index.jsx +0 -104
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/PracticeTable/index.jsx +0 -75
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/PracticeTable/index.module.scss +0 -12
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankBarChart/index.jsx +0 -62
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankBarChart/index.module.scss +0 -43
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingGroup/index.jsx +0 -29
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingGroup/index.module.scss +0 -5
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingList/index.jsx +0 -58
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingList/index.module.scss +0 -85
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ScriptStatsPanel/index.jsx +0 -92
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ScriptStatsPanel/index.module.scss +0 -56
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/StatCardsRow/index.jsx +0 -40
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/StatCardsRow/index.module.scss +0 -53
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/echarts/EchartsDonut.jsx +0 -106
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/echarts/EchartsRankBar.jsx +0 -132
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/index.jsx +0 -176
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/index.module.scss +0 -96
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/CoachReport/index.jsx +0 -162
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/CoachReport/index.module.scss +0 -16
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ComprehensiveEvaluation/index.jsx +0 -29
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ComprehensiveEvaluation/index.module.scss +0 -25
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueBubble/index.jsx +0 -106
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueBubble/index.module.scss +0 -164
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueRecord/index.jsx +0 -182
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueRecord/index.module.scss +0 -203
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionDetail/index.jsx +0 -145
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionDetail/index.module.scss +0 -126
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionScores/index.jsx +0 -67
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionScores/index.module.scss +0 -105
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ReportHeader/index.jsx +0 -81
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ReportHeader/index.module.scss +0 -47
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/RoleInfo/index.jsx +0 -64
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/RoleInfo/index.module.scss +0 -85
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ScoreBadge/index.jsx +0 -39
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ScoreBadge/index.module.scss +0 -44
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/SubDimensionItem/index.jsx +0 -83
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/SubDimensionItem/index.module.scss +0 -101
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/index.jsx +0 -50
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/index.module.scss +0 -25
- package/app/wujie-vue3-child/src/views/aiCoach/scriptTable/index.jsx +0 -196
- package/app/wujie-vue3-child/src/views/aiCoach/scriptTable/index.module.scss +0 -41
- package/app/wujie-vue3-child/src/views/aiCoach/scriptTable/inputColumn/index.jsx +0 -183
- package/app/wujie-vue3-child/src/views/aiCoach/scriptTable/inputColumn/index.module.scss +0 -115
- package/app/wujie-vue3-child/src/views/child-to-parent.vue +0 -117
- package/app/wujie-vue3-child/src/views/home.vue +0 -53
- package/app/wujie-vue3-child/src/views/jsx/btnSelect/btnSelect.vue +0 -169
- package/app/wujie-vue3-child/src/views/jsx/btnSelect/index.vue +0 -69
- package/app/wujie-vue3-child/src/views/jsx/com.vue +0 -44
- package/app/wujie-vue3-child/src/views/jsx/dialog.jsx +0 -66
- package/app/wujie-vue3-child/src/views/jsx/index.vue +0 -72
- package/app/wujie-vue3-child/src/views/jsx/props.vue +0 -33
- package/app/wujie-vue3-child/src/views/parent-to-child.vue +0 -225
- package/app/wujie-vue3-child/src/views/phone-code.vue +0 -318
- package/app/wujie-vue3-child/src/views/router-jump.vue +0 -123
- package/app/wujie-vue3-child/src/views/test.vue +0 -192
- package/app/wujie-vue3-child/vite.config.js +0 -15
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="quill-demo">
|
|
3
|
+
<PageHeader
|
|
4
|
+
title="Quill 富文本编辑器"
|
|
5
|
+
:description="versionTip"
|
|
6
|
+
usage="<QuillEditor v-model="content" :toolbar-preset="'default'" :height="300" /> toolbar-preset 可选 simple/default/full,通过 ref 调用 getHtml()/getText()/clear()/focus()"
|
|
7
|
+
/>
|
|
8
|
+
|
|
9
|
+
<!-- 卡片① 工具栏预设切换 -->
|
|
10
|
+
<el-card class="demo-card" shadow="never">
|
|
11
|
+
<div slot="header" class="demo-card__header">
|
|
12
|
+
<span class="demo-card__title">① 工具栏预设切换(toolbarPreset)</span>
|
|
13
|
+
<el-radio-group v-model="presetMode" size="small">
|
|
14
|
+
<el-radio-button label="simple">精简</el-radio-button>
|
|
15
|
+
<el-radio-button label="default">默认</el-radio-button>
|
|
16
|
+
<el-radio-button label="full">全部</el-radio-button>
|
|
17
|
+
</el-radio-group>
|
|
18
|
+
</div>
|
|
19
|
+
<p class="demo-tip">
|
|
20
|
+
切换上方单选即可实时更换工具栏。当前预设:<b>{{ presetMode }}</b>
|
|
21
|
+
(组件通过 <code>:key</code> 重新挂载以应用新工具栏,内容经 v-model 自动保留)。
|
|
22
|
+
</p>
|
|
23
|
+
<QuillEditor
|
|
24
|
+
:key="presetMode"
|
|
25
|
+
v-model="presetContent"
|
|
26
|
+
:toolbar-preset="presetMode"
|
|
27
|
+
:height="240"
|
|
28
|
+
/>
|
|
29
|
+
</el-card>
|
|
30
|
+
|
|
31
|
+
<!-- 卡片② 基础编辑器 + HTML 源码联动 -->
|
|
32
|
+
<el-card class="demo-card" shadow="never">
|
|
33
|
+
<div slot="header" class="demo-card__title">② 基础编辑器 + HTML 源码联动(实例1)</div>
|
|
34
|
+
<QuillEditor v-model="content1" :height="260" @ready="onReady" />
|
|
35
|
+
<div class="source-head">
|
|
36
|
+
<span class="demo-card__subtitle">HTML 源码(可编辑)</span>
|
|
37
|
+
<div>
|
|
38
|
+
<el-button type="primary" size="small" @click="applySource">应用到编辑器1</el-button>
|
|
39
|
+
<el-button size="small" @click="refreshSource">从编辑器1刷新源码</el-button>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
<el-input
|
|
43
|
+
v-model="source1"
|
|
44
|
+
type="textarea"
|
|
45
|
+
:rows="6"
|
|
46
|
+
class="source-box"
|
|
47
|
+
placeholder="在此编辑 HTML,点「应用到编辑器1」整体写回上方编辑器"
|
|
48
|
+
/>
|
|
49
|
+
<p class="demo-tip">
|
|
50
|
+
编辑器1 的内容变化会实时同步到源码框;点「应用到编辑器1」把源码整体写回编辑器(Quill 会规范化 HTML)。
|
|
51
|
+
</p>
|
|
52
|
+
</el-card>
|
|
53
|
+
|
|
54
|
+
<!-- 卡片③ 只读 / 禁用 -->
|
|
55
|
+
<el-card class="demo-card" shadow="never">
|
|
56
|
+
<div slot="header" class="demo-card__title">③ 只读 / 禁用模式</div>
|
|
57
|
+
<el-row :gutter="16">
|
|
58
|
+
<el-col :span="12">
|
|
59
|
+
<div class="demo-card__subtitle">只读 readonly(可选可看,不可改)</div>
|
|
60
|
+
<QuillEditor v-model="content2" :readonly="true" :height="220" />
|
|
61
|
+
</el-col>
|
|
62
|
+
<el-col :span="12">
|
|
63
|
+
<div class="demo-card__subtitle">禁用 disabled(整体灰掉)</div>
|
|
64
|
+
<QuillEditor v-model="content3" :disabled="true" :height="220" />
|
|
65
|
+
</el-col>
|
|
66
|
+
</el-row>
|
|
67
|
+
</el-card>
|
|
68
|
+
|
|
69
|
+
<!-- 卡片④ 自定义工具栏 -->
|
|
70
|
+
<el-card class="demo-card" shadow="never">
|
|
71
|
+
<div slot="header" class="demo-card__title">④ 自定义工具栏(传 toolbar 数组)</div>
|
|
72
|
+
<p class="demo-tip">
|
|
73
|
+
传入 <code>:toolbar</code> 数组即可完全自定义(优先级高于 toolbarPreset)。本例只保留:加粗 / 斜体、列表、链接、清除。
|
|
74
|
+
</p>
|
|
75
|
+
<QuillEditor :toolbar="customToolbar" v-model="content4" :height="200" />
|
|
76
|
+
</el-card>
|
|
77
|
+
|
|
78
|
+
<!-- 卡片⑤ Ref 方法调用 -->
|
|
79
|
+
<el-card class="demo-card" shadow="never">
|
|
80
|
+
<div slot="header" class="demo-card__title">⑤ 通过 ref 调用组件方法</div>
|
|
81
|
+
<QuillEditor ref="refDemo" v-model="content5" toolbar-preset="simple" :height="180" />
|
|
82
|
+
<div class="btn-row">
|
|
83
|
+
<el-button size="small" @click="callGetHtml">getHtml()</el-button>
|
|
84
|
+
<el-button size="small" @click="callGetText">getText()</el-button>
|
|
85
|
+
<el-button size="small" @click="callClear">clear()</el-button>
|
|
86
|
+
<el-button size="small" @click="callFocus">focus()</el-button>
|
|
87
|
+
</div>
|
|
88
|
+
<el-input
|
|
89
|
+
v-model="methodOutput"
|
|
90
|
+
type="textarea"
|
|
91
|
+
:rows="4"
|
|
92
|
+
readonly
|
|
93
|
+
class="source-box"
|
|
94
|
+
placeholder="方法返回值显示在这里"
|
|
95
|
+
/>
|
|
96
|
+
</el-card>
|
|
97
|
+
|
|
98
|
+
<!-- 卡片⑥ 事件监听 -->
|
|
99
|
+
<el-card class="demo-card" shadow="never">
|
|
100
|
+
<div slot="header" class="demo-card__header">
|
|
101
|
+
<span class="demo-card__title">⑥ 事件监听(focus / blur / change)</span>
|
|
102
|
+
<el-button size="small" @click="eventLogs = []">清空日志</el-button>
|
|
103
|
+
</div>
|
|
104
|
+
<QuillEditor
|
|
105
|
+
v-model="content6"
|
|
106
|
+
toolbar-preset="simple"
|
|
107
|
+
:height="180"
|
|
108
|
+
@focus="onEvtFocus"
|
|
109
|
+
@blur="onEvtBlur"
|
|
110
|
+
@change="onEvtChange"
|
|
111
|
+
/>
|
|
112
|
+
<div class="log-panel">
|
|
113
|
+
<div v-if="!eventLogs.length" class="log-empty">(在上方编辑器中操作以触发事件)</div>
|
|
114
|
+
<div v-for="(log, i) in eventLogs" :key="i" class="log-line">{{ log }}</div>
|
|
115
|
+
</div>
|
|
116
|
+
</el-card>
|
|
117
|
+
</div>
|
|
118
|
+
</template>
|
|
119
|
+
|
|
120
|
+
<script>
|
|
121
|
+
import QuillEditor from './index.vue';
|
|
122
|
+
import PageHeader from '@/components/PageHeader/index.vue';
|
|
123
|
+
|
|
124
|
+
const SAMPLE_WITH_TABLE = `<h2>富文本编辑器示例</h2>
|
|
125
|
+
<p>这是一个 <strong>Quill</strong> 富文本编辑器示例,包含以下功能:</p>
|
|
126
|
+
<ul>
|
|
127
|
+
<li>基础格式:加粗、斜体、下划线、删除线</li>
|
|
128
|
+
<li>标题、段落、引用、列表</li>
|
|
129
|
+
<li>字号、颜色、对齐、缩进</li>
|
|
130
|
+
<li>图片(支持 base64 内联)</li>
|
|
131
|
+
<li>表格(quill-table-better)</li>
|
|
132
|
+
</ul>
|
|
133
|
+
<table>
|
|
134
|
+
<thead>
|
|
135
|
+
<tr><th>姓名</th><th>年龄</th><th>城市</th></tr>
|
|
136
|
+
</thead>
|
|
137
|
+
<tbody>
|
|
138
|
+
<tr><td>张三</td><td>28</td><td>北京</td></tr>
|
|
139
|
+
<tr><td>李四</td><td>32</td><td>上海</td></tr>
|
|
140
|
+
</tbody>
|
|
141
|
+
</table>
|
|
142
|
+
<p>试着编辑上方内容,查看下方 <code>HTML 源码</code> 输出。</p>`;
|
|
143
|
+
|
|
144
|
+
const SIMPLE_SAMPLE = '<p>这是一个<strong>精简</strong>示例,可在上方编辑触发事件。</p>';
|
|
145
|
+
|
|
146
|
+
export default {
|
|
147
|
+
name: 'QuillEditorDemo',
|
|
148
|
+
components: { QuillEditor, PageHeader },
|
|
149
|
+
data() {
|
|
150
|
+
return {
|
|
151
|
+
versionTip:
|
|
152
|
+
'基于 Quill 2 + quill-table-better,支持表格 / 图片 / 撤销重做,工具栏已中文化。',
|
|
153
|
+
// 卡片① 预设切换
|
|
154
|
+
presetMode: 'default',
|
|
155
|
+
presetContent: SAMPLE_WITH_TABLE,
|
|
156
|
+
// 卡片② 基础编辑器 + 源码联动
|
|
157
|
+
content1: SAMPLE_WITH_TABLE,
|
|
158
|
+
source1: SAMPLE_WITH_TABLE,
|
|
159
|
+
// 卡片③ 只读 / 禁用
|
|
160
|
+
content2: SAMPLE_WITH_TABLE,
|
|
161
|
+
content3: SAMPLE_WITH_TABLE,
|
|
162
|
+
// 卡片④ 自定义工具栏
|
|
163
|
+
content4: '<p>自定义工具栏示例:<strong>加粗</strong>、<em>斜体</em>、列表。</p>',
|
|
164
|
+
customToolbar: [
|
|
165
|
+
['bold', 'italic'],
|
|
166
|
+
[{ list: 'ordered' }, { list: 'bullet' }],
|
|
167
|
+
['link'],
|
|
168
|
+
['clean'],
|
|
169
|
+
],
|
|
170
|
+
// 卡片⑤ ref 方法
|
|
171
|
+
content5: '<p>点下方按钮调用组件方法(getHtml / getText / clear / focus)。</p>',
|
|
172
|
+
methodOutput: '',
|
|
173
|
+
// 卡片⑥ 事件监听
|
|
174
|
+
content6: SIMPLE_SAMPLE,
|
|
175
|
+
eventLogs: [],
|
|
176
|
+
};
|
|
177
|
+
},
|
|
178
|
+
watch: {
|
|
179
|
+
// 编辑器1 内容变化时,实时把源码同步到下方文本框
|
|
180
|
+
content1(val) {
|
|
181
|
+
this.source1 = val;
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
methods: {
|
|
185
|
+
onReady(quill) {
|
|
186
|
+
this.versionTip = `基于 Quill ${quill.version} + quill-table-better,支持表格 / 图片 / 撤销重做,工具栏已中文化。`;
|
|
187
|
+
},
|
|
188
|
+
// 卡片② 源码 → 编辑器1(整体写回)
|
|
189
|
+
applySource() {
|
|
190
|
+
this.content1 = this.source1;
|
|
191
|
+
if (this.$message) this.$message.success('已写回编辑器1');
|
|
192
|
+
},
|
|
193
|
+
// 卡片② 编辑器1 → 源码(手动刷新)
|
|
194
|
+
refreshSource() {
|
|
195
|
+
this.source1 = this.content1;
|
|
196
|
+
},
|
|
197
|
+
// 卡片⑤ ref 方法
|
|
198
|
+
callGetHtml() {
|
|
199
|
+
this.methodOutput = this.$refs.refDemo.getHtml();
|
|
200
|
+
},
|
|
201
|
+
callGetText() {
|
|
202
|
+
this.methodOutput = this.$refs.refDemo.getText();
|
|
203
|
+
},
|
|
204
|
+
callClear() {
|
|
205
|
+
this.$refs.refDemo.clear();
|
|
206
|
+
this.methodOutput = '(已清空)';
|
|
207
|
+
},
|
|
208
|
+
callFocus() {
|
|
209
|
+
this.$refs.refDemo.focus();
|
|
210
|
+
},
|
|
211
|
+
// 卡片⑥ 事件
|
|
212
|
+
onEvtFocus() {
|
|
213
|
+
this.pushLog('focus 获得焦点');
|
|
214
|
+
},
|
|
215
|
+
onEvtBlur() {
|
|
216
|
+
this.pushLog('blur 失去焦点');
|
|
217
|
+
},
|
|
218
|
+
onEvtChange(html) {
|
|
219
|
+
this.pushLog(`change 内容长度 ${html.length}`);
|
|
220
|
+
},
|
|
221
|
+
pushLog(text) {
|
|
222
|
+
const t = new Date().toLocaleTimeString();
|
|
223
|
+
this.eventLogs.unshift(`[${t}] ${text}`);
|
|
224
|
+
if (this.eventLogs.length > 20) this.eventLogs.splice(20);
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
</script>
|
|
229
|
+
|
|
230
|
+
<style scoped>
|
|
231
|
+
.quill-demo {
|
|
232
|
+
padding: 20px;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.demo-alert {
|
|
236
|
+
margin-bottom: 16px;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.demo-card {
|
|
240
|
+
margin-bottom: 16px;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.demo-card__header {
|
|
244
|
+
display: flex;
|
|
245
|
+
align-items: center;
|
|
246
|
+
justify-content: space-between;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.demo-card__title {
|
|
250
|
+
font-size: 15px;
|
|
251
|
+
font-weight: 600;
|
|
252
|
+
color: #303133;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.demo-card__subtitle {
|
|
256
|
+
display: block;
|
|
257
|
+
margin: 8px 0;
|
|
258
|
+
font-size: 13px;
|
|
259
|
+
color: #606266;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.demo-tip {
|
|
263
|
+
margin: 8px 0;
|
|
264
|
+
font-size: 12px;
|
|
265
|
+
line-height: 1.6;
|
|
266
|
+
color: #909399;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.demo-tip code,
|
|
270
|
+
.demo-card code {
|
|
271
|
+
padding: 1px 4px;
|
|
272
|
+
border-radius: 3px;
|
|
273
|
+
background: #f5f7fa;
|
|
274
|
+
color: #c7254e;
|
|
275
|
+
font-family: Consolas, 'Courier New', monospace;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.source-head {
|
|
279
|
+
display: flex;
|
|
280
|
+
align-items: center;
|
|
281
|
+
justify-content: space-between;
|
|
282
|
+
margin: 12px 0 8px;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.source-box >>> .el-textarea__inner {
|
|
286
|
+
font-family: Consolas, 'Courier New', monospace;
|
|
287
|
+
font-size: 12px;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.btn-row {
|
|
291
|
+
margin: 12px 0;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.log-panel {
|
|
295
|
+
margin-top: 12px;
|
|
296
|
+
max-height: 160px;
|
|
297
|
+
padding: 8px 12px;
|
|
298
|
+
overflow: auto;
|
|
299
|
+
border: 1px solid #ebeef5;
|
|
300
|
+
border-radius: 4px;
|
|
301
|
+
background: #f5f7fa;
|
|
302
|
+
font-family: Consolas, 'Courier New', monospace;
|
|
303
|
+
font-size: 12px;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.log-line {
|
|
307
|
+
line-height: 1.8;
|
|
308
|
+
color: #475669;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.log-empty {
|
|
312
|
+
color: #909399;
|
|
313
|
+
}
|
|
314
|
+
</style>
|