@itshixun/qckeditor-vue2 1.0.18 → 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 +30 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +87 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4891 -4610
- package/dist/src/components/QCKContent.d.ts +16 -0
- package/dist/src/components/QCKContent.d.ts.map +1 -1
- package/dist/src/components/QCKEditorPro.d.ts +23 -2
- package/dist/src/components/QCKEditorPro.d.ts.map +1 -1
- package/dist/src/components/QCKImageViewer.d.ts +52 -0
- package/dist/src/components/QCKImageViewer.d.ts.map +1 -0
- package/dist/src/types.d.ts +14 -0
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -179,6 +179,33 @@ export default {
|
|
|
179
179
|
</script>
|
|
180
180
|
```
|
|
181
181
|
|
|
182
|
+
#### 图片预览(imagePreview)
|
|
183
|
+
|
|
184
|
+
默认关闭。开启后,点击内容中的图片会打开内置轻量预览弹层(QCKImageViewer),支持关闭(遮罩/×/Esc)、左右切换(按钮/方向键)、计数、缩放(按钮/滚轮)、拖拽平移、双击复位、全屏与底部缩略图栏:
|
|
185
|
+
|
|
186
|
+
```vue
|
|
187
|
+
<template>
|
|
188
|
+
<!-- 布尔用法:全部默认配置 -->
|
|
189
|
+
<QCKContent :content="htmlContent" :image-preview="true" />
|
|
190
|
+
|
|
191
|
+
<!-- 对象用法:覆盖配置 -->
|
|
192
|
+
<QCKContent :content="htmlContent" :image-preview="{ zIndex: 3000, navbar: false }" />
|
|
193
|
+
</template>
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
`imagePreview` 对象形式支持的选项(`QCKImagePreviewOptions`):
|
|
197
|
+
|
|
198
|
+
| 选项 | 类型 | 默认值 | 说明 |
|
|
199
|
+
|------|------|--------|------|
|
|
200
|
+
| zIndex | Number | 2100 | 预览弹层 z-index |
|
|
201
|
+
| loop | Boolean | true | 切换到底/顶后是否循环 |
|
|
202
|
+
| navbar | Boolean | true | 底部缩略图栏(图片数 > 1 时显示) |
|
|
203
|
+
| fullscreen | Boolean | true | 是否显示全屏按钮 |
|
|
204
|
+
|
|
205
|
+
`QCKEditorPro` 同样支持 `imagePreview`,会透传给预览态的内容区(预览态点击图片只打开预览,不会激活编辑器)。
|
|
206
|
+
|
|
207
|
+
> **已知限制**:Vue 2 版本无内置 Teleport,预览弹层使用 `position: fixed` 内联渲染。若组件祖先存在 `transform`/`filter`/`perspective` 样式,弹层定位会相对该祖先而非视口。
|
|
208
|
+
|
|
182
209
|
## Props
|
|
183
210
|
|
|
184
211
|
### CKEditor
|
|
@@ -216,6 +243,7 @@ export default {
|
|
|
216
243
|
| contentBgHoverColor | String | 'rgb(0 0 0 / 4%)' | 悬停背景色 |
|
|
217
244
|
| borderRadius | Number | 4 | 圆角大小 |
|
|
218
245
|
| sanitize | Boolean | true | 是否清洗 HTML |
|
|
246
|
+
| imagePreview | Boolean \| Object | false | 预览态图片预览(见 QCKContent 图片预览说明) |
|
|
219
247
|
| value / v-model | String | '' | 编辑器内容 |
|
|
220
248
|
|
|
221
249
|
### QCKContent
|
|
@@ -225,6 +253,7 @@ export default {
|
|
|
225
253
|
| content | String | - | HTML 内容 |
|
|
226
254
|
| containerClass | String | '' | 容器类名 |
|
|
227
255
|
| sanitize | Boolean | true | 是否清洗 HTML |
|
|
256
|
+
| imagePreview | Boolean \| Object | false | 图片预览,true 或 QCKImagePreviewOptions 对象(见上文) |
|
|
228
257
|
| value / v-model | String | '' | 内容 |
|
|
229
258
|
|
|
230
259
|
## 事件
|
|
@@ -382,7 +411,7 @@ export default {
|
|
|
382
411
|
## 类型导出
|
|
383
412
|
|
|
384
413
|
```typescript
|
|
385
|
-
import type { Props, ExtractEditorType } from '@itshixun/qckeditor-vue2';
|
|
414
|
+
import type { Props, ExtractEditorType, QCKImagePreviewOptions } from '@itshixun/qckeditor-vue2';
|
|
386
415
|
```
|
|
387
416
|
|
|
388
417
|
## 注意事项
|