azs-doc-editor 1.0.2 → 1.0.3
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 +26 -3
- package/dist/azs-doc-editor.es.js +143 -142
- package/dist/azs-doc-editor.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,7 +13,26 @@
|
|
|
13
13
|
## 安装
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npm install
|
|
16
|
+
npm install azs-doc-editor
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 重要:样式导入
|
|
20
|
+
|
|
21
|
+
**必须在你的项目中导入以下样式,否则编辑器的按钮和图标将不显示:**
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
// main.ts 或 main.js
|
|
25
|
+
import 'element-plus/dist/index.css'
|
|
26
|
+
import 'remixicon/fonts/remixicon.css'
|
|
27
|
+
import 'azs-doc-editor/style.css'
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
或者在你的 HTML 中引入:
|
|
31
|
+
|
|
32
|
+
```html
|
|
33
|
+
<link rel="stylesheet" href="node_modules/element-plus/dist/index.css">
|
|
34
|
+
<link rel="stylesheet" href="node_modules/remixicon/fonts/remixicon.css">
|
|
35
|
+
<link rel="stylesheet" href="node_modules/azs-doc-editor/dist/style.css">
|
|
17
36
|
```
|
|
18
37
|
|
|
19
38
|
## 前置要求
|
|
@@ -36,8 +55,12 @@ npm install vue-document-editor
|
|
|
36
55
|
|
|
37
56
|
```typescript
|
|
38
57
|
import { createApp } from 'vue'
|
|
39
|
-
import DocumentConverter from '
|
|
40
|
-
|
|
58
|
+
import DocumentConverter from 'azs-doc-editor'
|
|
59
|
+
|
|
60
|
+
// 必须导入这些样式
|
|
61
|
+
import 'element-plus/dist/index.css'
|
|
62
|
+
import 'remixicon/fonts/remixicon.css'
|
|
63
|
+
import 'azs-doc-editor/style.css'
|
|
41
64
|
|
|
42
65
|
const app = createApp(App)
|
|
43
66
|
app.use(DocumentConverter)
|
|
@@ -10107,7 +10107,7 @@ const df = /* @__PURE__ */ Se(cf, [["__scopeId", "data-v-e8b5969a"]]), uf = { cl
|
|
|
10107
10107
|
};
|
|
10108
10108
|
}
|
|
10109
10109
|
});
|
|
10110
|
-
const yf = /* @__PURE__ */ Se(gf, [["__scopeId", "data-v-7c7b1a7b"]]), bf = { class: "editor-
|
|
10110
|
+
const yf = /* @__PURE__ */ Se(gf, [["__scopeId", "data-v-7c7b1a7b"]]), bf = { class: "editor-header" }, Cf = { class: "editor-page-main" }, kf = { class: "editor-body" }, Sf = {
|
|
10111
10111
|
id: "editor",
|
|
10112
10112
|
class: "editor-area-container"
|
|
10113
10113
|
}, vf = /* @__PURE__ */ G({
|
|
@@ -10230,146 +10230,146 @@ const yf = /* @__PURE__ */ Se(gf, [["__scopeId", "data-v-7c7b1a7b"]]), bf = { cl
|
|
|
10230
10230
|
ref: i
|
|
10231
10231
|
}, [
|
|
10232
10232
|
v("div", bf, [
|
|
10233
|
-
|
|
10234
|
-
|
|
10235
|
-
|
|
10236
|
-
|
|
10237
|
-
|
|
10238
|
-
|
|
10239
|
-
|
|
10240
|
-
|
|
10241
|
-
|
|
10242
|
-
|
|
10243
|
-
|
|
10244
|
-
|
|
10245
|
-
|
|
10246
|
-
|
|
10247
|
-
|
|
10248
|
-
|
|
10249
|
-
|
|
10250
|
-
|
|
10251
|
-
|
|
10252
|
-
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
|
|
10256
|
-
|
|
10257
|
-
|
|
10258
|
-
|
|
10259
|
-
|
|
10260
|
-
|
|
10261
|
-
|
|
10262
|
-
|
|
10263
|
-
|
|
10264
|
-
|
|
10265
|
-
|
|
10266
|
-
|
|
10267
|
-
|
|
10268
|
-
|
|
10269
|
-
|
|
10270
|
-
|
|
10271
|
-
|
|
10272
|
-
|
|
10273
|
-
|
|
10274
|
-
|
|
10275
|
-
|
|
10276
|
-
|
|
10277
|
-
|
|
10278
|
-
|
|
10279
|
-
|
|
10280
|
-
|
|
10281
|
-
|
|
10282
|
-
|
|
10283
|
-
|
|
10284
|
-
|
|
10285
|
-
|
|
10286
|
-
|
|
10287
|
-
|
|
10288
|
-
|
|
10289
|
-
|
|
10290
|
-
|
|
10291
|
-
|
|
10292
|
-
|
|
10293
|
-
|
|
10294
|
-
|
|
10295
|
-
|
|
10296
|
-
|
|
10297
|
-
|
|
10298
|
-
|
|
10299
|
-
|
|
10300
|
-
|
|
10301
|
-
|
|
10302
|
-
|
|
10303
|
-
|
|
10304
|
-
|
|
10305
|
-
|
|
10306
|
-
|
|
10307
|
-
|
|
10308
|
-
|
|
10309
|
-
|
|
10310
|
-
|
|
10311
|
-
|
|
10312
|
-
|
|
10313
|
-
|
|
10314
|
-
|
|
10315
|
-
|
|
10316
|
-
|
|
10317
|
-
|
|
10318
|
-
|
|
10319
|
-
|
|
10320
|
-
|
|
10321
|
-
|
|
10322
|
-
|
|
10323
|
-
|
|
10324
|
-
|
|
10325
|
-
|
|
10326
|
-
|
|
10327
|
-
|
|
10328
|
-
|
|
10329
|
-
return (be = a.value) == null ? void 0 : be.chain().focus().setHorizontalRule().run();
|
|
10330
|
-
})
|
|
10331
|
-
}, {
|
|
10332
|
-
default: T(() => [...A[10] || (A[10] = [
|
|
10333
|
-
v("i", { class: "ri-separator" }, null, -1),
|
|
10334
|
-
v("span", { class: "desc" }, "分割线", -1)
|
|
10335
|
-
])]),
|
|
10336
|
-
_: 1
|
|
10337
|
-
}),
|
|
10338
|
-
S(re, { class: "dropdown-item" }, {
|
|
10339
|
-
default: T(() => [
|
|
10340
|
-
S(M(oa), { "insert-content": b })
|
|
10341
|
-
]),
|
|
10342
|
-
_: 1
|
|
10233
|
+
S(M(J), {
|
|
10234
|
+
type: "action",
|
|
10235
|
+
desc: "撤销",
|
|
10236
|
+
icon: "ri-arrow-go-back-line",
|
|
10237
|
+
onClick: A[0] || (A[0] = (Te) => {
|
|
10238
|
+
var be;
|
|
10239
|
+
return (be = a.value) == null ? void 0 : be.chain().focus().undo().run();
|
|
10240
|
+
}),
|
|
10241
|
+
disabled: !((ae = a.value) != null && ae.can().chain().focus().undo().run()) || !d.value
|
|
10242
|
+
}, null, 8, ["disabled"]),
|
|
10243
|
+
S(M(J), {
|
|
10244
|
+
type: "action",
|
|
10245
|
+
desc: "重做",
|
|
10246
|
+
icon: "ri-arrow-go-forward-line",
|
|
10247
|
+
onClick: A[1] || (A[1] = (Te) => {
|
|
10248
|
+
var be;
|
|
10249
|
+
return (be = a.value) == null ? void 0 : be.chain().focus().redo().run();
|
|
10250
|
+
}),
|
|
10251
|
+
disabled: !((xe = a.value) != null && xe.can().chain().focus().redo().run()) || !d.value
|
|
10252
|
+
}, null, 8, ["disabled"]),
|
|
10253
|
+
S(M(J), {
|
|
10254
|
+
type: "action",
|
|
10255
|
+
desc: "清除样式",
|
|
10256
|
+
icon: "ri-eraser-fill",
|
|
10257
|
+
onClick: A[2] || (A[2] = (Te) => {
|
|
10258
|
+
var be;
|
|
10259
|
+
return (be = a.value) == null ? void 0 : be.chain().focus().unsetAllMarks().run();
|
|
10260
|
+
}),
|
|
10261
|
+
disabled: !((mo = a.value) != null && mo.can().chain().focus().unsetAllMarks().run()) || !d.value
|
|
10262
|
+
}, null, 8, ["disabled"]),
|
|
10263
|
+
S(X, { direction: "vertical" }),
|
|
10264
|
+
S(M(Ds), {
|
|
10265
|
+
editor: a.value,
|
|
10266
|
+
editable: d.value
|
|
10267
|
+
}, null, 8, ["editor", "editable"]),
|
|
10268
|
+
S(M(Ls), {
|
|
10269
|
+
editor: a.value,
|
|
10270
|
+
editable: d.value
|
|
10271
|
+
}, null, 8, ["editor", "editable"]),
|
|
10272
|
+
S(M(zs), {
|
|
10273
|
+
editor: a.value,
|
|
10274
|
+
editable: d.value
|
|
10275
|
+
}, null, 8, ["editor", "editable"]),
|
|
10276
|
+
S(M(js), {
|
|
10277
|
+
editor: a.value,
|
|
10278
|
+
editable: d.value
|
|
10279
|
+
}, null, 8, ["editor", "editable"]),
|
|
10280
|
+
S(M(Us), {
|
|
10281
|
+
editor: a.value,
|
|
10282
|
+
editable: d.value
|
|
10283
|
+
}, null, 8, ["editor", "editable"]),
|
|
10284
|
+
S(X, { direction: "vertical" }),
|
|
10285
|
+
S(M(Bs), {
|
|
10286
|
+
editor: a.value,
|
|
10287
|
+
editable: d.value
|
|
10288
|
+
}, null, 8, ["editor", "editable"]),
|
|
10289
|
+
S(X, { direction: "vertical" }),
|
|
10290
|
+
S(_e, {
|
|
10291
|
+
trigger: "click",
|
|
10292
|
+
disabled: !d.value
|
|
10293
|
+
}, {
|
|
10294
|
+
dropdown: T(() => [
|
|
10295
|
+
S(Ie, { style: { overflow: "hidden" } }, {
|
|
10296
|
+
default: T(() => [
|
|
10297
|
+
S(re, {
|
|
10298
|
+
icon: M(nf),
|
|
10299
|
+
class: "dropdown-item"
|
|
10300
|
+
}, {
|
|
10301
|
+
default: T(() => [
|
|
10302
|
+
v("input", {
|
|
10303
|
+
type: "file",
|
|
10304
|
+
id: "file",
|
|
10305
|
+
class: "select-file",
|
|
10306
|
+
title: "",
|
|
10307
|
+
accept: "image/*",
|
|
10308
|
+
onChange: w
|
|
10309
|
+
}, null, 32),
|
|
10310
|
+
A[8] || (A[8] = v("span", { class: "desc" }, "图片", -1))
|
|
10311
|
+
]),
|
|
10312
|
+
_: 1
|
|
10313
|
+
}, 8, ["icon"]),
|
|
10314
|
+
S(re, {
|
|
10315
|
+
icon: M(ef),
|
|
10316
|
+
class: "dropdown-item",
|
|
10317
|
+
onClick: A[3] || (A[3] = (Te) => y.value = !0)
|
|
10318
|
+
}, {
|
|
10319
|
+
default: T(() => [...A[9] || (A[9] = [
|
|
10320
|
+
v("span", { class: "desc" }, "链接", -1)
|
|
10321
|
+
])]),
|
|
10322
|
+
_: 1
|
|
10323
|
+
}, 8, ["icon"]),
|
|
10324
|
+
S(re, {
|
|
10325
|
+
class: "dropdown-item",
|
|
10326
|
+
onClick: A[4] || (A[4] = (Te) => {
|
|
10327
|
+
var be;
|
|
10328
|
+
return (be = a.value) == null ? void 0 : be.chain().focus().setHorizontalRule().run();
|
|
10343
10329
|
})
|
|
10344
|
-
|
|
10345
|
-
|
|
10346
|
-
|
|
10347
|
-
|
|
10348
|
-
|
|
10349
|
-
|
|
10350
|
-
|
|
10351
|
-
|
|
10352
|
-
|
|
10353
|
-
|
|
10354
|
-
|
|
10355
|
-
|
|
10356
|
-
|
|
10357
|
-
|
|
10358
|
-
|
|
10359
|
-
|
|
10360
|
-
|
|
10361
|
-
|
|
10362
|
-
|
|
10363
|
-
|
|
10364
|
-
|
|
10365
|
-
|
|
10366
|
-
|
|
10367
|
-
|
|
10368
|
-
|
|
10369
|
-
|
|
10370
|
-
|
|
10371
|
-
|
|
10372
|
-
|
|
10330
|
+
}, {
|
|
10331
|
+
default: T(() => [...A[10] || (A[10] = [
|
|
10332
|
+
v("i", { class: "ri-separator" }, null, -1),
|
|
10333
|
+
v("span", { class: "desc" }, "分割线", -1)
|
|
10334
|
+
])]),
|
|
10335
|
+
_: 1
|
|
10336
|
+
}),
|
|
10337
|
+
S(re, { class: "dropdown-item" }, {
|
|
10338
|
+
default: T(() => [
|
|
10339
|
+
S(M(oa), { "insert-content": b })
|
|
10340
|
+
]),
|
|
10341
|
+
_: 1
|
|
10342
|
+
})
|
|
10343
|
+
]),
|
|
10344
|
+
_: 1
|
|
10345
|
+
})
|
|
10346
|
+
]),
|
|
10347
|
+
default: T(() => [
|
|
10348
|
+
A[11] || (A[11] = v("div", { style: { outline: "none", cursor: "pointer", "font-size": "14px" } }, [
|
|
10349
|
+
v("i", { class: "ri-add-circle-fill" }),
|
|
10350
|
+
v("span", null, "插入"),
|
|
10351
|
+
v("i", { class: "ri-arrow-drop-down-line" })
|
|
10352
|
+
], -1))
|
|
10353
|
+
]),
|
|
10354
|
+
_: 1
|
|
10355
|
+
}, 8, ["disabled"]),
|
|
10356
|
+
S(M(ea), {
|
|
10357
|
+
editor: a.value,
|
|
10358
|
+
editable: d.value
|
|
10359
|
+
}, null, 8, ["editor", "editable"]),
|
|
10360
|
+
S(X, { direction: "vertical" }),
|
|
10361
|
+
S(He, {
|
|
10362
|
+
type: "primary",
|
|
10363
|
+
size: "small",
|
|
10364
|
+
onClick: N
|
|
10365
|
+
}, {
|
|
10366
|
+
default: T(() => [...A[12] || (A[12] = [
|
|
10367
|
+
_("保存", -1)
|
|
10368
|
+
])]),
|
|
10369
|
+
_: 1
|
|
10370
|
+
})
|
|
10371
|
+
]),
|
|
10372
|
+
v("div", Cf, [
|
|
10373
10373
|
v("div", kf, [
|
|
10374
10374
|
v("div", {
|
|
10375
10375
|
class: "catalogue-list",
|
|
@@ -10419,7 +10419,7 @@ const yf = /* @__PURE__ */ Se(gf, [["__scopeId", "data-v-7c7b1a7b"]]), bf = { cl
|
|
|
10419
10419
|
};
|
|
10420
10420
|
}
|
|
10421
10421
|
});
|
|
10422
|
-
const wf = /* @__PURE__ */ Se(vf, [["__scopeId", "data-v-
|
|
10422
|
+
const wf = /* @__PURE__ */ Se(vf, [["__scopeId", "data-v-97cbf9b9"]]), xf = { class: "excel-editor-container" }, Tf = ["id"], Af = /* @__PURE__ */ G({
|
|
10423
10423
|
__name: "ExcelEditor",
|
|
10424
10424
|
props: {
|
|
10425
10425
|
content: {},
|
|
@@ -10580,7 +10580,8 @@ const Ef = /* @__PURE__ */ Se(Af, [["__scopeId", "data-v-a8c6ba69"]]), Rf = { cl
|
|
|
10580
10580
|
]));
|
|
10581
10581
|
}
|
|
10582
10582
|
});
|
|
10583
|
-
const Lf = /* @__PURE__ */ Se(Of, [["__scopeId", "data-v-9db96d3c"]])
|
|
10583
|
+
const Lf = /* @__PURE__ */ Se(Of, [["__scopeId", "data-v-9db96d3c"]]);
|
|
10584
|
+
const $f = {
|
|
10584
10585
|
install(n) {
|
|
10585
10586
|
n.component("DocumentEditorPage", Lf);
|
|
10586
10587
|
}
|