@srcker/editor-vue-next 1.0.9 → 1.1.1

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
@@ -23,28 +23,49 @@
23
23
  安装依赖:
24
24
 
25
25
  ```bash
26
- npm install
26
+ npm i @srcker/editor-vue-next
27
27
  ```
28
28
 
29
- 启动开发服务:
29
+ 使用方法:
30
30
 
31
31
  ```bash
32
- npm run dev
32
+
33
+ # 引入组件
34
+ import { RichEditor } from '@srcker/editor-vue-next'
35
+ # 引入样式
36
+ import '@srcker/editor-vue-next/style/toolbar'
37
+ import '@srcker/editor-vue-next/style/content'
38
+
39
+ # 使用组件
40
+ <RichEditor v-model="form.content" theme="dark" format="html" />
41
+
33
42
  ```
34
43
 
35
- 构建生产版本:
44
+ 参数说明
45
+ ## 配置项
46
+ | 参数 | 说明 | 类型 | 默认值 |
47
+ | --- | --- | --- | --- |
48
+ | theme | 主题,可选值:`light`、`dark` | string | `light` |
49
+ | format | 输出格式,可选值:`html`、`json` | string | `html` |
50
+ | uploadImage | 图片上传配置 | File | - |
36
51
 
37
- ```bash
38
- npm run build
52
+ ## 图片上传配置
39
53
  ```
54
+ const uploadImage = async (file: File) => {
55
+ console.log(file)
56
+ return {
57
+ url: '图片地址',
58
+ name: '图片名称'
59
+ }
60
+ }
61
+ ```
62
+
40
63
 
41
64
  ## 技术栈
42
65
 
43
66
  - Vue 3
44
67
  - Tiptap
45
- - IconPark 图标库
46
68
  - SCSS
47
69
 
48
70
  ## 图片上传
49
-
50
71
  编辑器支持通过工具栏按钮上传图片,支持常见的图片格式(JPG、PNG、GIF、WebP),最大支持5MB的文件。