pxx-vue-quill 1.0.23 → 1.0.25

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.
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Copyright (c) 2025 Pxx-Team
9
9
  * Released under the MIT license
10
- * Date: 2025-08-26T09:54:33.439Z
10
+ * Date: 2025-08-27T08:02:05.295Z
11
11
  */
12
12
  (function (global, factory) {
13
13
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
@@ -18451,20 +18451,6 @@
18451
18451
  ['undo', 'redo'],
18452
18452
  ['math'],
18453
18453
  ['ocr'],
18454
- ],
18455
- // 如果编辑器宽度不够,就显示短的工具栏
18456
- short: [
18457
- ['bold', 'italic', 'underline'],
18458
- [{ color: [] }],
18459
- ['link'],
18460
- ['more']
18461
- ],
18462
- // 点击更多显示的第二栏工具
18463
- extend: [
18464
- [{ list: 'ordered' }, { list: 'bullet' }],
18465
- ['image'],
18466
- ['undo', 'redo'],
18467
- ['math'],
18468
18454
  ]
18469
18455
  };
18470
18456
 
@@ -18796,11 +18782,11 @@
18796
18782
  value: true
18797
18783
  });
18798
18784
 
18799
- var _createClass$1 = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
18785
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
18800
18786
 
18801
18787
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
18802
18788
 
18803
- function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
18789
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
18804
18790
 
18805
18791
  var LEFT_ALIGN = 'left';
18806
18792
  var CENTER_ALIGN = 'center';
@@ -18811,7 +18797,7 @@
18811
18797
  var _this = this,
18812
18798
  _alignments;
18813
18799
 
18814
- _classCallCheck$1(this, DefaultAligner);
18800
+ _classCallCheck(this, DefaultAligner);
18815
18801
 
18816
18802
  this.applyStyle = options.aligner.applyStyle;
18817
18803
  this.alignAttribute = options.attribute;
@@ -18839,7 +18825,7 @@
18839
18825
  }), _alignments);
18840
18826
  }
18841
18827
 
18842
- _createClass$1(DefaultAligner, [{
18828
+ _createClass(DefaultAligner, [{
18843
18829
  key: 'getAlignments',
18844
18830
  value: function getAlignments() {
18845
18831
  var _this2 = this;
@@ -19564,148 +19550,156 @@
19564
19550
 
19565
19551
  var IframeVideoSpec = {};
19566
19552
 
19567
- var UnclickableBlotSpec$1 = {};
19553
+ var UnclickableBlotSpec = {};
19568
19554
 
19569
- Object.defineProperty(UnclickableBlotSpec$1, "__esModule", {
19570
- value: true
19571
- });
19555
+ var hasRequiredUnclickableBlotSpec;
19572
19556
 
19573
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
19557
+ function requireUnclickableBlotSpec () {
19558
+ if (hasRequiredUnclickableBlotSpec) return UnclickableBlotSpec;
19559
+ hasRequiredUnclickableBlotSpec = 1;
19574
19560
 
19575
- var _BlotSpec2 = requireBlotSpec();
19561
+ Object.defineProperty(UnclickableBlotSpec, "__esModule", {
19562
+ value: true
19563
+ });
19576
19564
 
19577
- var _BlotSpec3 = _interopRequireDefault(_BlotSpec2);
19565
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
19578
19566
 
19579
- var _BlotFormatter = requireBlotFormatter();
19567
+ var _BlotSpec2 = requireBlotSpec();
19580
19568
 
19581
- _interopRequireDefault(_BlotFormatter);
19569
+ var _BlotSpec3 = _interopRequireDefault(_BlotSpec2);
19582
19570
 
19583
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19571
+ var _BlotFormatter = requireBlotFormatter();
19584
19572
 
19585
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19573
+ _interopRequireDefault(_BlotFormatter);
19586
19574
 
19587
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
19575
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19588
19576
 
19589
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
19577
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19590
19578
 
19591
- var MOUSE_ENTER_ATTRIBUTE = 'data-blot-formatter-unclickable-bound';
19592
- var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
19579
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
19593
19580
 
19594
- var UnclickableBlotSpec = function (_BlotSpec) {
19595
- _inherits(UnclickableBlotSpec, _BlotSpec);
19581
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
19596
19582
 
19597
- function UnclickableBlotSpec(formatter, selector) {
19598
- _classCallCheck(this, UnclickableBlotSpec);
19583
+ var MOUSE_ENTER_ATTRIBUTE = 'data-blot-formatter-unclickable-bound';
19584
+ var PROXY_IMAGE_CLASS = 'blot-formatter__proxy-image';
19599
19585
 
19600
- var _this = _possibleConstructorReturn(this, (UnclickableBlotSpec.__proto__ || Object.getPrototypeOf(UnclickableBlotSpec)).call(this, formatter));
19586
+ var UnclickableBlotSpec$1 = function (_BlotSpec) {
19587
+ _inherits(UnclickableBlotSpec, _BlotSpec);
19601
19588
 
19602
- _this.onTextChange = function () {
19603
- Array.from(document.querySelectorAll(_this.selector + ':not([' + MOUSE_ENTER_ATTRIBUTE + '])')).forEach(function (unclickable) {
19604
- unclickable.setAttribute(MOUSE_ENTER_ATTRIBUTE, 'true');
19605
- unclickable.addEventListener('mouseenter', _this.onMouseEnter);
19606
- });
19607
- };
19589
+ function UnclickableBlotSpec(formatter, selector) {
19590
+ _classCallCheck(this, UnclickableBlotSpec);
19608
19591
 
19609
- _this.onMouseEnter = function (event) {
19610
- var unclickable = event.target;
19611
- if (!(unclickable instanceof HTMLElement)) {
19612
- return;
19613
- }
19592
+ var _this = _possibleConstructorReturn(this, (UnclickableBlotSpec.__proto__ || Object.getPrototypeOf(UnclickableBlotSpec)).call(this, formatter));
19614
19593
 
19615
- _this.nextUnclickable = unclickable;
19616
- _this.repositionProxyImage(_this.nextUnclickable);
19617
- };
19594
+ _this.onTextChange = function () {
19595
+ Array.from(document.querySelectorAll(_this.selector + ':not([' + MOUSE_ENTER_ATTRIBUTE + '])')).forEach(function (unclickable) {
19596
+ unclickable.setAttribute(MOUSE_ENTER_ATTRIBUTE, 'true');
19597
+ unclickable.addEventListener('mouseenter', _this.onMouseEnter);
19598
+ });
19599
+ };
19618
19600
 
19619
- _this.onProxyImageClick = function () {
19620
- _this.unclickable = _this.nextUnclickable;
19621
- _this.nextUnclickable = null;
19622
- _this.formatter.show(_this);
19623
- _this.hideProxyImage();
19624
- };
19601
+ _this.onMouseEnter = function (event) {
19602
+ var unclickable = event.target;
19603
+ if (!(unclickable instanceof HTMLElement)) {
19604
+ return;
19605
+ }
19625
19606
 
19626
- _this.selector = selector;
19627
- _this.unclickable = null;
19628
- _this.nextUnclickable = null;
19629
- return _this;
19630
- }
19607
+ _this.nextUnclickable = unclickable;
19608
+ _this.repositionProxyImage(_this.nextUnclickable);
19609
+ };
19631
19610
 
19632
- _createClass(UnclickableBlotSpec, [{
19633
- key: 'init',
19634
- value: function init() {
19635
- if (document.body) {
19636
- /*
19637
- it's important that this is attached to the body instead of the root quill element.
19638
- this prevents the click event from overlapping with ImageSpec
19639
- */
19640
- document.body.appendChild(this.createProxyImage());
19641
- }
19611
+ _this.onProxyImageClick = function () {
19612
+ _this.unclickable = _this.nextUnclickable;
19613
+ _this.nextUnclickable = null;
19614
+ _this.formatter.show(_this);
19615
+ _this.hideProxyImage();
19616
+ };
19642
19617
 
19643
- this.hideProxyImage();
19644
- this.proxyImage.addEventListener('click', this.onProxyImageClick);
19645
- this.formatter.quill.on('text-change', this.onTextChange);
19646
- }
19647
- }, {
19648
- key: 'getTargetElement',
19649
- value: function getTargetElement() {
19650
- return this.unclickable;
19651
- }
19652
- }, {
19653
- key: 'getOverlayElement',
19654
- value: function getOverlayElement() {
19655
- return this.unclickable;
19656
- }
19657
- }, {
19658
- key: 'onHide',
19659
- value: function onHide() {
19660
- this.hideProxyImage();
19661
- this.nextUnclickable = null;
19662
- this.unclickable = null;
19663
- }
19664
- }, {
19665
- key: 'createProxyImage',
19666
- value: function createProxyImage() {
19667
- var canvas = document.createElement('canvas');
19668
- var context = canvas.getContext('2d');
19669
- context.globalAlpha = 0;
19670
- context.fillRect(0, 0, 1, 1);
19671
-
19672
- this.proxyImage = document.createElement('img');
19673
- this.proxyImage.src = canvas.toDataURL('image/png');
19674
- this.proxyImage.classList.add(PROXY_IMAGE_CLASS);
19675
-
19676
- Object.assign(this.proxyImage.style, {
19677
- position: 'absolute',
19678
- margin: '0'
19679
- });
19618
+ _this.selector = selector;
19619
+ _this.unclickable = null;
19620
+ _this.nextUnclickable = null;
19621
+ return _this;
19622
+ }
19680
19623
 
19681
- return this.proxyImage;
19682
- }
19683
- }, {
19684
- key: 'hideProxyImage',
19685
- value: function hideProxyImage() {
19686
- Object.assign(this.proxyImage.style, {
19687
- display: 'none'
19688
- });
19689
- }
19690
- }, {
19691
- key: 'repositionProxyImage',
19692
- value: function repositionProxyImage(unclickable) {
19693
- var rect = unclickable.getBoundingClientRect();
19694
-
19695
- Object.assign(this.proxyImage.style, {
19696
- display: 'block',
19697
- left: rect.left + window.pageXOffset + 'px',
19698
- top: rect.top + window.pageYOffset + 'px',
19699
- width: rect.width + 'px',
19700
- height: rect.height + 'px'
19701
- });
19702
- }
19703
- }]);
19624
+ _createClass(UnclickableBlotSpec, [{
19625
+ key: 'init',
19626
+ value: function init() {
19627
+ if (document.body) {
19628
+ /*
19629
+ it's important that this is attached to the body instead of the root quill element.
19630
+ this prevents the click event from overlapping with ImageSpec
19631
+ */
19632
+ document.body.appendChild(this.createProxyImage());
19633
+ }
19704
19634
 
19705
- return UnclickableBlotSpec;
19706
- }(_BlotSpec3.default);
19635
+ this.hideProxyImage();
19636
+ this.proxyImage.addEventListener('click', this.onProxyImageClick);
19637
+ this.formatter.quill.on('text-change', this.onTextChange);
19638
+ }
19639
+ }, {
19640
+ key: 'getTargetElement',
19641
+ value: function getTargetElement() {
19642
+ return this.unclickable;
19643
+ }
19644
+ }, {
19645
+ key: 'getOverlayElement',
19646
+ value: function getOverlayElement() {
19647
+ return this.unclickable;
19648
+ }
19649
+ }, {
19650
+ key: 'onHide',
19651
+ value: function onHide() {
19652
+ this.hideProxyImage();
19653
+ this.nextUnclickable = null;
19654
+ this.unclickable = null;
19655
+ }
19656
+ }, {
19657
+ key: 'createProxyImage',
19658
+ value: function createProxyImage() {
19659
+ var canvas = document.createElement('canvas');
19660
+ var context = canvas.getContext('2d');
19661
+ context.globalAlpha = 0;
19662
+ context.fillRect(0, 0, 1, 1);
19663
+
19664
+ this.proxyImage = document.createElement('img');
19665
+ this.proxyImage.src = canvas.toDataURL('image/png');
19666
+ this.proxyImage.classList.add(PROXY_IMAGE_CLASS);
19667
+
19668
+ Object.assign(this.proxyImage.style, {
19669
+ position: 'absolute',
19670
+ margin: '0'
19671
+ });
19672
+
19673
+ return this.proxyImage;
19674
+ }
19675
+ }, {
19676
+ key: 'hideProxyImage',
19677
+ value: function hideProxyImage() {
19678
+ Object.assign(this.proxyImage.style, {
19679
+ display: 'none'
19680
+ });
19681
+ }
19682
+ }, {
19683
+ key: 'repositionProxyImage',
19684
+ value: function repositionProxyImage(unclickable) {
19685
+ var rect = unclickable.getBoundingClientRect();
19686
+
19687
+ Object.assign(this.proxyImage.style, {
19688
+ display: 'block',
19689
+ left: rect.left + window.pageXOffset + 'px',
19690
+ top: rect.top + window.pageYOffset + 'px',
19691
+ width: rect.width + 'px',
19692
+ height: rect.height + 'px'
19693
+ });
19694
+ }
19695
+ }]);
19696
+
19697
+ return UnclickableBlotSpec;
19698
+ }(_BlotSpec3.default);
19707
19699
 
19708
- UnclickableBlotSpec$1.default = UnclickableBlotSpec;
19700
+ UnclickableBlotSpec.default = UnclickableBlotSpec$1;
19701
+ return UnclickableBlotSpec;
19702
+ }
19709
19703
 
19710
19704
  var hasRequiredIframeVideoSpec;
19711
19705
 
@@ -19717,7 +19711,7 @@
19717
19711
  value: true
19718
19712
  });
19719
19713
 
19720
- var _UnclickableBlotSpec2 = UnclickableBlotSpec$1;
19714
+ var _UnclickableBlotSpec2 = requireUnclickableBlotSpec();
19721
19715
 
19722
19716
  var _UnclickableBlotSpec3 = _interopRequireDefault(_UnclickableBlotSpec2);
19723
19717
 
@@ -19944,7 +19938,7 @@
19944
19938
  }
19945
19939
  });
19946
19940
 
19947
- var _UnclickableBlotSpec = UnclickableBlotSpec$1;
19941
+ var _UnclickableBlotSpec = requireUnclickableBlotSpec();
19948
19942
 
19949
19943
  Object.defineProperty(exports, 'UnclickableBlotSpec', {
19950
19944
  enumerable: true,
@@ -19974,6 +19968,10 @@
19974
19968
  type: String,
19975
19969
  required: true,
19976
19970
  },
19971
+ toolbarStyle: {
19972
+ type: Object,
19973
+ default: () => ({}),
19974
+ },
19977
19975
  },
19978
19976
  emits: ['toolClick'],
19979
19977
  setup(props, { emit }) {
@@ -19988,7 +19986,8 @@
19988
19986
  class: {
19989
19987
  'short-tools': true,
19990
19988
  'collapse': showMoreTools.value
19991
- }
19989
+ },
19990
+ style: props.toolbarStyle
19992
19991
  }, [
19993
19992
  // 第一组:基础格式工具
19994
19993
  vue.h('span', { class: 'ql-formats' }, [
@@ -20038,7 +20037,7 @@
20038
20037
  class: {
20039
20038
  "more-tools": true,
20040
20039
  "collapse": showMoreTools.value
20041
- }, style: { display: showMoreTools.value ? 'block' : 'none' }
20040
+ }, style: { display: showMoreTools.value ? 'block' : 'none', ...props.toolbarStyle }
20042
20041
  }, [
20043
20042
  vue.h('div', { class: "more-tools-item" }, [
20044
20043
  vue.h('span', { class: 'ql-formats' }, [
@@ -20122,12 +20121,12 @@
20122
20121
  inheritAttrs: false,
20123
20122
  props: {
20124
20123
  /**
20125
- * 编辑器的key
20126
- * 如果页面上存在多个编辑器的话需要传递
20124
+ * 编辑器的key(唯一值)
20125
+ * 如果页面上存在多个needCollapse为true的编辑器的话必须传递
20126
+ * 为什么需要传? 因为needCollapse为true的时候,初始化toolbar需要用到id,如果id相同,则toolbar会互相影响
20127
20127
  */
20128
20128
  editorKey: {
20129
- type: String,
20130
- required: true,
20129
+ type: [String, Number],
20131
20130
  },
20132
20131
  /**
20133
20132
  * 编辑器内容
@@ -20207,7 +20206,7 @@
20207
20206
  * 工具栏自定义样式
20208
20207
  * 传入CSS样式对象,会应用到工具栏容器上
20209
20208
  * 例如:{ 'background-color': '#f0f0f0', 'border-radius': '8px' }
20210
- * 支持所有CSS属性
20209
+ * 为了让编辑器的toolbar的样式更灵活,支持所有CSS属性
20211
20210
  */
20212
20211
  toolbarStyle: {
20213
20212
  type: Object,
@@ -20218,50 +20217,13 @@
20218
20217
  * 编辑器内容区域自定义样式
20219
20218
  * 传入CSS样式对象,会应用到编辑器内容区域(.ql-editor)上
20220
20219
  * 例如:{ 'font-size': '16px', 'line-height': '1.6' }
20221
- * 支持所有CSS属性
20220
+ * 为了让编辑器的输入部分的样式更灵活,支持所有CSS属性
20222
20221
  */
20223
20222
  editorStyle: {
20224
20223
  type: Object,
20225
20224
  required: false,
20226
20225
  default: () => ({})
20227
20226
  },
20228
- /**
20229
- * 编辑器主题
20230
- * - 'snow': 雪花主题,经典工具栏样式(默认)
20231
- * - 'bubble': 气泡主题,浮动工具栏样式
20232
- * - '': 无主题,不应用任何样式
20233
- * 影响编辑器的整体外观和交互方式
20234
- */
20235
- theme: {
20236
- type: String,
20237
- default: 'snow',
20238
- validator: (value) => {
20239
- return ['snow', 'bubble', ''].includes(value);
20240
- },
20241
- },
20242
- /**
20243
- * 工具栏配置
20244
- * 支持多种格式:
20245
- * - 字符串: 使用预定义的工具栏配置(如'full', 'short')
20246
- * - 数组: 自定义工具栏按钮数组
20247
- * - 对象: 自定义工具栏配置对象
20248
- * - 布尔值: true显示默认工具栏,false隐藏工具栏
20249
- * - 以'#'开头: 使用CSS选择器指定的DOM元素作为工具栏
20250
- */
20251
- toolbar: {
20252
- type: [String, Array, Object, Boolean],
20253
- required: false,
20254
- validator: (value) => {
20255
- if (!value)
20256
- return false;
20257
- if (typeof value === 'string' && value !== '') {
20258
- return value.charAt(0) === '#'
20259
- ? true
20260
- : Object.keys(toolbarOptions).indexOf(value) !== -1;
20261
- }
20262
- return true;
20263
- },
20264
- },
20265
20227
  /**
20266
20228
  * Quill模块配置
20267
20229
  * 支持单个模块或模块数组
@@ -20349,17 +20311,13 @@
20349
20311
  }
20350
20312
  }
20351
20313
  };
20352
- // 监听 toolbarStyle 变化
20353
- vue.watch(() => props.toolbarStyle, () => {
20354
- vue.nextTick(() => {
20314
+ vue.watchEffect(() => {
20315
+ if (!props.needCollapse && props.toolbarStyle) {
20355
20316
  applyToolbarStyle();
20356
- });
20317
+ }
20357
20318
  });
20358
- // 监听 editorStyle 变化
20359
- vue.watch(() => props.editorStyle, () => {
20360
- vue.nextTick(() => {
20361
- applyEditorStyle();
20362
- });
20319
+ vue.watchEffect(() => {
20320
+ applyEditorStyle();
20363
20321
  });
20364
20322
  const registerModule = (moduleName, module) => {
20365
20323
  Quill.register(moduleName, module);
@@ -20402,66 +20360,55 @@
20402
20360
  quill.on('text-change', handleTextChange);
20403
20361
  quill.on('selection-change', handleSelectionChange);
20404
20362
  quill.on('editor-change', handleEditorChange);
20405
- if (props.theme !== 'bubble')
20406
- editor.value.classList.remove('ql-bubble');
20407
- if (props.theme !== 'snow')
20408
- editor.value.classList.remove('ql-snow');
20409
20363
  (_b = quill
20410
20364
  .getModule('toolbar')) === null || _b === void 0 ? void 0 : _b.container.addEventListener('mousedown', (e) => {
20411
20365
  e.preventDefault();
20412
20366
  });
20413
- // 应用初始toolbar样式
20414
- applyToolbarStyle();
20415
- // 应用初始editor样式
20416
- applyEditorStyle();
20417
20367
  ctx.emit('ready', quill);
20418
20368
  };
20419
20369
  // Compose Options
20420
20370
  const composeOptions = () => {
20421
20371
  const clientOptions = {};
20422
- if (props.theme !== '')
20423
- clientOptions.theme = props.theme;
20372
+ clientOptions.theme = 'snow';
20424
20373
  if (props.readOnly)
20425
20374
  clientOptions.readOnly = props.readOnly;
20426
20375
  if (props.placeholder)
20427
20376
  clientOptions.placeholder = props.placeholder;
20428
- if (props.toolbar && props.toolbar !== '') {
20429
- if (props.needCollapse) {
20430
- clientOptions.modules = {
20431
- toolbar: "#toolbar-" + props.editorKey,
20432
- };
20433
- }
20434
- else {
20435
- clientOptions.modules = {
20436
- toolbar: {
20437
- // 需要展开的话显示完整的工具栏
20438
- container: [
20439
- ...toolbarOptions.full,
20440
- ],
20441
- handlers: {
20442
- redo: function () {
20443
- var _a;
20444
- (_a = quill === null || quill === void 0 ? void 0 : quill.getModule('history')) === null || _a === void 0 ? void 0 : _a.redo();
20445
- },
20446
- undo: function () {
20447
- var _a;
20448
- (_a = quill === null || quill === void 0 ? void 0 : quill.getModule('history')) === null || _a === void 0 ? void 0 : _a.undo();
20449
- },
20450
- ocr: function () {
20451
- // 按钮点击逻辑
20452
- ctx.emit('ocr');
20453
- },
20454
- math: function () {
20455
- // 按钮点击逻辑
20456
- ctx.emit('math');
20457
- },
20458
- more: function () {
20459
- showMoreToolbar.value = !showMoreToolbar.value;
20460
- }
20377
+ if (props.needCollapse) {
20378
+ clientOptions.modules = {
20379
+ toolbar: "#toolbar-" + props.editorKey,
20380
+ };
20381
+ }
20382
+ else {
20383
+ clientOptions.modules = {
20384
+ toolbar: {
20385
+ // 需要展开的话显示完整的工具栏
20386
+ container: [
20387
+ ...toolbarOptions.full,
20388
+ ],
20389
+ handlers: {
20390
+ redo: function () {
20391
+ var _a;
20392
+ (_a = quill === null || quill === void 0 ? void 0 : quill.getModule('history')) === null || _a === void 0 ? void 0 : _a.redo();
20393
+ },
20394
+ undo: function () {
20395
+ var _a;
20396
+ (_a = quill === null || quill === void 0 ? void 0 : quill.getModule('history')) === null || _a === void 0 ? void 0 : _a.undo();
20461
20397
  },
20398
+ ocr: function () {
20399
+ // 按钮点击逻辑
20400
+ ctx.emit('ocr');
20401
+ },
20402
+ math: function () {
20403
+ // 按钮点击逻辑
20404
+ ctx.emit('math');
20405
+ },
20406
+ more: function () {
20407
+ showMoreToolbar.value = !showMoreToolbar.value;
20408
+ }
20462
20409
  },
20463
- };
20464
- }
20410
+ },
20411
+ };
20465
20412
  }
20466
20413
  if (props.modules) {
20467
20414
  const modules = (() => {
@@ -20673,10 +20620,9 @@
20673
20620
  render() {
20674
20621
  return [
20675
20622
  vue.h('div', { class: this.editorWrapClass }, [
20676
- // this.$slots.toolbar?.(), // 工具栏内容固定
20677
20623
  // 当 needCollapse 为 false 时,显示 MoreToolbar 组件
20678
- this.$props.needCollapse && vue.h(MoreToolbar, {
20679
- editorKey: this.$props.editorKey,
20624
+ this.$props.needCollapse && this.$props.editorKey && vue.h(MoreToolbar, {
20625
+ editorKey: String(this.$props.editorKey),
20680
20626
  needCollapse: this.needCollapse,
20681
20627
  toolbarStyle: this.$props.toolbarStyle,
20682
20628
  onToolClick: (tool) => {