@itshixun/qckeditor-vue3 1.0.16 → 1.1.0

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/README.md CHANGED
@@ -118,6 +118,31 @@ const htmlContent = '<p>Hello <strong>World</strong></p>';
118
118
  </script>
119
119
  ```
120
120
 
121
+ #### 图片预览(imagePreview)
122
+
123
+ 默认关闭。开启后,点击内容中的图片会打开内置轻量预览弹层(QCKImageViewer),支持关闭(遮罩/×/Esc)、左右切换(按钮/方向键)、计数、缩放(按钮/滚轮)、拖拽平移、双击复位、全屏与底部缩略图栏:
124
+
125
+ ```vue
126
+ <template>
127
+ <!-- 布尔用法:全部默认配置 -->
128
+ <QCKContent :content="htmlContent" :image-preview="true" />
129
+
130
+ <!-- 对象用法:覆盖配置 -->
131
+ <QCKContent :content="htmlContent" :image-preview="{ zIndex: 3000, navbar: false }" />
132
+ </template>
133
+ ```
134
+
135
+ `imagePreview` 对象形式支持的选项(`QCKImagePreviewOptions`):
136
+
137
+ | 选项 | 类型 | 默认值 | 说明 |
138
+ |------|------|--------|------|
139
+ | zIndex | Number | 2100 | 预览弹层 z-index |
140
+ | loop | Boolean | true | 切换到底/顶后是否循环 |
141
+ | navbar | Boolean | true | 底部缩略图栏(图片数 > 1 时显示) |
142
+ | fullscreen | Boolean | true | 是否显示全屏按钮 |
143
+
144
+ `QCKEditorPro` 同样支持 `imagePreview`,会透传给预览态的内容区(预览态点击图片只打开预览,不会激活编辑器)。
145
+
121
146
  ## 上传适配器
122
147
 
123
148
  本库提供了三种上传适配器,用于处理编辑器中的文件上传(图片、音视频等):
@@ -266,6 +291,7 @@ const editorConfig = {
266
291
  | contentBgHoverColor | String | 'rgb(0 0 0 / 4%)' | 悬停背景色 |
267
292
  | borderRadius | Number | 4 | 圆角大小 |
268
293
  | sanitize | Boolean | true | 是否清洗 HTML |
294
+ | imagePreview | Boolean \| Object | false | 预览态图片预览(见 QCKContent 图片预览说明) |
269
295
 
270
296
  ### QCKContent
271
297
 
@@ -274,6 +300,7 @@ const editorConfig = {
274
300
  | content | String | - | HTML 内容 |
275
301
  | containerClass | String | '' | 容器类名 |
276
302
  | sanitize | Boolean | true | 是否清洗 HTML |
303
+ | imagePreview | Boolean \| Object | false | 图片预览,true 或 QCKImagePreviewOptions 对象(见上文) |
277
304
 
278
305
  ## 事件
279
306
 
@@ -290,7 +317,7 @@ const editorConfig = {
290
317
  ## 类型导出
291
318
 
292
319
  ```typescript
293
- import type { Props, ExtractEditorType } from '@itshixun/qckeditor-vue3';
320
+ import type { Props, ExtractEditorType, QCKImagePreviewOptions } from '@itshixun/qckeditor-vue3';
294
321
  ```
295
322
 
296
323
  ## 注意事项