hookehuyr

测试tiny富文本

Showing 73 changed files with 850 additions and 5 deletions
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
30 "sha1": "^1.1.1", 30 "sha1": "^1.1.1",
31 "typescript": "^4.7.3", 31 "typescript": "^4.7.3",
32 "uuid": "^8.3.2", 32 "uuid": "^8.3.2",
33 - "vant": "^4.9.0", 33 + "vant": "^4.9.1",
34 "vconsole": "^3.14.6", 34 "vconsole": "^3.14.6",
35 "vite-plugin-dynamic-import": "^0.9.6", 35 "vite-plugin-dynamic-import": "^0.9.6",
36 "vite-plugin-mp": "^1.6.1", 36 "vite-plugin-mp": "^1.6.1",
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
36 }, 36 },
37 "dependencies": { 37 "dependencies": {
38 "@dedisuryadi/json-form-data": "^0.1.1", 38 "@dedisuryadi/json-form-data": "^0.1.1",
39 + "@tinymce/tinymce-vue": "^5",
39 "@vant/area-data": "^1.3.1", 40 "@vant/area-data": "^1.3.1",
40 "@vant/touch-emulator": "^1.4.0", 41 "@vant/touch-emulator": "^1.4.0",
41 "@vitejs/plugin-legacy": "^1.8.2", 42 "@vitejs/plugin-legacy": "^1.8.2",
...@@ -55,6 +56,7 @@ ...@@ -55,6 +56,7 @@
55 "moment": "^2.29.3", 56 "moment": "^2.29.3",
56 "mui-player": "^1.7.0", 57 "mui-player": "^1.7.0",
57 "sha1": "^1.1.1", 58 "sha1": "^1.1.1",
59 + "tinymce": "^7.2.1",
58 "typescript": "^4.7.3", 60 "typescript": "^4.7.3",
59 "uuid": "^8.3.2", 61 "uuid": "^8.3.2",
60 "vant": "^4.9.1", 62 "vant": "^4.9.1",
......
This diff is collapsed. Click to expand it.
1 +body {
2 + background-color: #222f3e;
3 + color: #fff;
4 + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
5 + line-height: 1.4;
6 + margin: 1rem;
7 +}
8 +a {
9 + color: #4099ff;
10 +}
11 +table {
12 + border-collapse: collapse;
13 +}
14 +/* Apply a default padding if legacy cellpadding attribute is missing */
15 +table:not([cellpadding]) th,
16 +table:not([cellpadding]) td {
17 + padding: 0.4rem;
18 +}
19 +/* Set default table styles if a table has a positive border attribute
20 + and no inline css */
21 +table[border]:not([border="0"]):not([style*="border-width"]) th,
22 +table[border]:not([border="0"]):not([style*="border-width"]) td {
23 + border-width: 1px;
24 +}
25 +/* Set default table styles if a table has a positive border attribute
26 + and no inline css */
27 +table[border]:not([border="0"]):not([style*="border-style"]) th,
28 +table[border]:not([border="0"]):not([style*="border-style"]) td {
29 + border-style: solid;
30 +}
31 +/* Set default table styles if a table has a positive border attribute
32 + and no inline css */
33 +table[border]:not([border="0"]):not([style*="border-color"]) th,
34 +table[border]:not([border="0"]):not([style*="border-color"]) td {
35 + border-color: #6d737b;
36 +}
37 +figure {
38 + display: table;
39 + margin: 1rem auto;
40 +}
41 +figure figcaption {
42 + color: #8a8f97;
43 + display: block;
44 + margin-top: 0.25rem;
45 + text-align: center;
46 +}
47 +hr {
48 + border-color: #6d737b;
49 + border-style: solid;
50 + border-width: 1px 0 0 0;
51 +}
52 +code {
53 + background-color: #6d737b;
54 + border-radius: 3px;
55 + padding: 0.1rem 0.2rem;
56 +}
57 +.mce-content-body:not([dir=rtl]) blockquote {
58 + border-left: 2px solid #6d737b;
59 + margin-left: 1.5rem;
60 + padding-left: 1rem;
61 +}
62 +.mce-content-body[dir=rtl] blockquote {
63 + border-right: 2px solid #6d737b;
64 + margin-right: 1.5rem;
65 + padding-right: 1rem;
66 +}
1 +tinymce.Resource.add('content/dark/content.css', "body{background-color:#222f3e;color:#fff;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}a{color:#4099ff}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border=\"0\"]):not([style*=border-width]) td,table[border]:not([border=\"0\"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border=\"0\"]):not([style*=border-style]) td,table[border]:not([border=\"0\"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border=\"0\"]):not([style*=border-color]) td,table[border]:not([border=\"0\"]):not([style*=border-color]) th{border-color:#6d737b}figure{display:table;margin:1rem auto}figure figcaption{color:#8a8f97;display:block;margin-top:.25rem;text-align:center}hr{border-color:#6d737b;border-style:solid;border-width:1px 0 0 0}code{background-color:#6d737b;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #6d737b;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #6d737b;margin-right:1.5rem;padding-right:1rem}")
2 +//# sourceMappingURL=content.js.map
1 +body{background-color:#222f3e;color:#fff;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}a{color:#4099ff}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#6d737b}figure{display:table;margin:1rem auto}figure figcaption{color:#8a8f97;display:block;margin-top:.25rem;text-align:center}hr{border-color:#6d737b;border-style:solid;border-width:1px 0 0 0}code{background-color:#6d737b;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #6d737b;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #6d737b;margin-right:1.5rem;padding-right:1rem}
1 +body {
2 + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
3 + line-height: 1.4;
4 + margin: 1rem;
5 +}
6 +table {
7 + border-collapse: collapse;
8 +}
9 +/* Apply a default padding if legacy cellpadding attribute is missing */
10 +table:not([cellpadding]) th,
11 +table:not([cellpadding]) td {
12 + padding: 0.4rem;
13 +}
14 +/* Set default table styles if a table has a positive border attribute
15 + and no inline css */
16 +table[border]:not([border="0"]):not([style*="border-width"]) th,
17 +table[border]:not([border="0"]):not([style*="border-width"]) td {
18 + border-width: 1px;
19 +}
20 +/* Set default table styles if a table has a positive border attribute
21 + and no inline css */
22 +table[border]:not([border="0"]):not([style*="border-style"]) th,
23 +table[border]:not([border="0"]):not([style*="border-style"]) td {
24 + border-style: solid;
25 +}
26 +/* Set default table styles if a table has a positive border attribute
27 + and no inline css */
28 +table[border]:not([border="0"]):not([style*="border-color"]) th,
29 +table[border]:not([border="0"]):not([style*="border-color"]) td {
30 + border-color: #ccc;
31 +}
32 +figure {
33 + display: table;
34 + margin: 1rem auto;
35 +}
36 +figure figcaption {
37 + color: #999;
38 + display: block;
39 + margin-top: 0.25rem;
40 + text-align: center;
41 +}
42 +hr {
43 + border-color: #ccc;
44 + border-style: solid;
45 + border-width: 1px 0 0 0;
46 +}
47 +code {
48 + background-color: #e8e8e8;
49 + border-radius: 3px;
50 + padding: 0.1rem 0.2rem;
51 +}
52 +.mce-content-body:not([dir=rtl]) blockquote {
53 + border-left: 2px solid #ccc;
54 + margin-left: 1.5rem;
55 + padding-left: 1rem;
56 +}
57 +.mce-content-body[dir=rtl] blockquote {
58 + border-right: 2px solid #ccc;
59 + margin-right: 1.5rem;
60 + padding-right: 1rem;
61 +}
1 +tinymce.Resource.add('content/default/content.css', "body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border=\"0\"]):not([style*=border-width]) td,table[border]:not([border=\"0\"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border=\"0\"]):not([style*=border-style]) td,table[border]:not([border=\"0\"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border=\"0\"]):not([style*=border-color]) td,table[border]:not([border=\"0\"]):not([style*=border-color]) th{border-color:#ccc}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem}")
2 +//# sourceMappingURL=content.js.map
1 +body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#ccc}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem}
1 +@media screen {
2 + html {
3 + background: #f4f4f4;
4 + min-height: 100%;
5 + }
6 +}
7 +body {
8 + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
9 +}
10 +@media screen {
11 + body {
12 + background-color: #fff;
13 + box-shadow: 0 0 4px rgba(0, 0, 0, 0.15);
14 + box-sizing: border-box;
15 + margin: 1rem auto 0;
16 + max-width: 820px;
17 + min-height: calc(100vh - 1rem);
18 + padding: 4rem 6rem 6rem 6rem;
19 + }
20 +}
21 +table {
22 + border-collapse: collapse;
23 +}
24 +/* Apply a default padding if legacy cellpadding attribute is missing */
25 +table:not([cellpadding]) th,
26 +table:not([cellpadding]) td {
27 + padding: 0.4rem;
28 +}
29 +/* Set default table styles if a table has a positive border attribute
30 + and no inline css */
31 +table[border]:not([border="0"]):not([style*="border-width"]) th,
32 +table[border]:not([border="0"]):not([style*="border-width"]) td {
33 + border-width: 1px;
34 +}
35 +/* Set default table styles if a table has a positive border attribute
36 + and no inline css */
37 +table[border]:not([border="0"]):not([style*="border-style"]) th,
38 +table[border]:not([border="0"]):not([style*="border-style"]) td {
39 + border-style: solid;
40 +}
41 +/* Set default table styles if a table has a positive border attribute
42 + and no inline css */
43 +table[border]:not([border="0"]):not([style*="border-color"]) th,
44 +table[border]:not([border="0"]):not([style*="border-color"]) td {
45 + border-color: #ccc;
46 +}
47 +figure figcaption {
48 + color: #999;
49 + margin-top: 0.25rem;
50 + text-align: center;
51 +}
52 +hr {
53 + border-color: #ccc;
54 + border-style: solid;
55 + border-width: 1px 0 0 0;
56 +}
57 +.mce-content-body:not([dir=rtl]) blockquote {
58 + border-left: 2px solid #ccc;
59 + margin-left: 1.5rem;
60 + padding-left: 1rem;
61 +}
62 +.mce-content-body[dir=rtl] blockquote {
63 + border-right: 2px solid #ccc;
64 + margin-right: 1.5rem;
65 + padding-right: 1rem;
66 +}
1 +tinymce.Resource.add('content/document/content.css', "@media screen{html{background:#f4f4f4;min-height:100%}}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif}@media screen{body{background-color:#fff;box-shadow:0 0 4px rgba(0,0,0,.15);box-sizing:border-box;margin:1rem auto 0;max-width:820px;min-height:calc(100vh - 1rem);padding:4rem 6rem 6rem 6rem}}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border=\"0\"]):not([style*=border-width]) td,table[border]:not([border=\"0\"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border=\"0\"]):not([style*=border-style]) td,table[border]:not([border=\"0\"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border=\"0\"]):not([style*=border-color]) td,table[border]:not([border=\"0\"]):not([style*=border-color]) th{border-color:#ccc}figure figcaption{color:#999;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem}")
2 +//# sourceMappingURL=content.js.map
1 +@media screen{html{background:#f4f4f4;min-height:100%}}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif}@media screen{body{background-color:#fff;box-shadow:0 0 4px rgba(0,0,0,.15);box-sizing:border-box;margin:1rem auto 0;max-width:820px;min-height:calc(100vh - 1rem);padding:4rem 6rem 6rem 6rem}}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#ccc}figure figcaption{color:#999;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem}
1 +body {
2 + background-color: #2f3742;
3 + color: #dfe0e4;
4 + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
5 + line-height: 1.4;
6 + margin: 1rem;
7 +}
8 +a {
9 + color: #4099ff;
10 +}
11 +table {
12 + border-collapse: collapse;
13 +}
14 +/* Apply a default padding if legacy cellpadding attribute is missing */
15 +table:not([cellpadding]) th,
16 +table:not([cellpadding]) td {
17 + padding: 0.4rem;
18 +}
19 +/* Set default table styles if a table has a positive border attribute
20 + and no inline css */
21 +table[border]:not([border="0"]):not([style*="border-width"]) th,
22 +table[border]:not([border="0"]):not([style*="border-width"]) td {
23 + border-width: 1px;
24 +}
25 +/* Set default table styles if a table has a positive border attribute
26 + and no inline css */
27 +table[border]:not([border="0"]):not([style*="border-style"]) th,
28 +table[border]:not([border="0"]):not([style*="border-style"]) td {
29 + border-style: solid;
30 +}
31 +/* Set default table styles if a table has a positive border attribute
32 + and no inline css */
33 +table[border]:not([border="0"]):not([style*="border-color"]) th,
34 +table[border]:not([border="0"]):not([style*="border-color"]) td {
35 + border-color: #6d737b;
36 +}
37 +figure {
38 + display: table;
39 + margin: 1rem auto;
40 +}
41 +figure figcaption {
42 + color: #8a8f97;
43 + display: block;
44 + margin-top: 0.25rem;
45 + text-align: center;
46 +}
47 +hr {
48 + border-color: #6d737b;
49 + border-style: solid;
50 + border-width: 1px 0 0 0;
51 +}
52 +code {
53 + background-color: #6d737b;
54 + border-radius: 3px;
55 + padding: 0.1rem 0.2rem;
56 +}
57 +.mce-content-body:not([dir=rtl]) blockquote {
58 + border-left: 2px solid #6d737b;
59 + margin-left: 1.5rem;
60 + padding-left: 1rem;
61 +}
62 +.mce-content-body[dir=rtl] blockquote {
63 + border-right: 2px solid #6d737b;
64 + margin-right: 1.5rem;
65 + padding-right: 1rem;
66 +}
1 +tinymce.Resource.add('content/tinymce-5-dark/content.css', "body{background-color:#2f3742;color:#dfe0e4;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}a{color:#4099ff}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border=\"0\"]):not([style*=border-width]) td,table[border]:not([border=\"0\"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border=\"0\"]):not([style*=border-style]) td,table[border]:not([border=\"0\"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border=\"0\"]):not([style*=border-color]) td,table[border]:not([border=\"0\"]):not([style*=border-color]) th{border-color:#6d737b}figure{display:table;margin:1rem auto}figure figcaption{color:#8a8f97;display:block;margin-top:.25rem;text-align:center}hr{border-color:#6d737b;border-style:solid;border-width:1px 0 0 0}code{background-color:#6d737b;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #6d737b;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #6d737b;margin-right:1.5rem;padding-right:1rem}")
2 +//# sourceMappingURL=content.js.map
1 +body{background-color:#2f3742;color:#dfe0e4;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}a{color:#4099ff}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#6d737b}figure{display:table;margin:1rem auto}figure figcaption{color:#8a8f97;display:block;margin-top:.25rem;text-align:center}hr{border-color:#6d737b;border-style:solid;border-width:1px 0 0 0}code{background-color:#6d737b;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #6d737b;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #6d737b;margin-right:1.5rem;padding-right:1rem}
1 +body {
2 + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
3 + line-height: 1.4;
4 + margin: 1rem;
5 +}
6 +table {
7 + border-collapse: collapse;
8 +}
9 +/* Apply a default padding if legacy cellpadding attribute is missing */
10 +table:not([cellpadding]) th,
11 +table:not([cellpadding]) td {
12 + padding: 0.4rem;
13 +}
14 +/* Set default table styles if a table has a positive border attribute
15 + and no inline css */
16 +table[border]:not([border="0"]):not([style*="border-width"]) th,
17 +table[border]:not([border="0"]):not([style*="border-width"]) td {
18 + border-width: 1px;
19 +}
20 +/* Set default table styles if a table has a positive border attribute
21 + and no inline css */
22 +table[border]:not([border="0"]):not([style*="border-style"]) th,
23 +table[border]:not([border="0"]):not([style*="border-style"]) td {
24 + border-style: solid;
25 +}
26 +/* Set default table styles if a table has a positive border attribute
27 + and no inline css */
28 +table[border]:not([border="0"]):not([style*="border-color"]) th,
29 +table[border]:not([border="0"]):not([style*="border-color"]) td {
30 + border-color: #ccc;
31 +}
32 +figure {
33 + display: table;
34 + margin: 1rem auto;
35 +}
36 +figure figcaption {
37 + color: #999;
38 + display: block;
39 + margin-top: 0.25rem;
40 + text-align: center;
41 +}
42 +hr {
43 + border-color: #ccc;
44 + border-style: solid;
45 + border-width: 1px 0 0 0;
46 +}
47 +code {
48 + background-color: #e8e8e8;
49 + border-radius: 3px;
50 + padding: 0.1rem 0.2rem;
51 +}
52 +.mce-content-body:not([dir=rtl]) blockquote {
53 + border-left: 2px solid #ccc;
54 + margin-left: 1.5rem;
55 + padding-left: 1rem;
56 +}
57 +.mce-content-body[dir=rtl] blockquote {
58 + border-right: 2px solid #ccc;
59 + margin-right: 1.5rem;
60 + padding-right: 1rem;
61 +}
1 +tinymce.Resource.add('content/tinymce-5/content.css', "body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border=\"0\"]):not([style*=border-width]) td,table[border]:not([border=\"0\"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border=\"0\"]):not([style*=border-style]) td,table[border]:not([border=\"0\"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border=\"0\"]):not([style*=border-color]) td,table[border]:not([border=\"0\"]):not([style*=border-color]) th{border-color:#ccc}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem}")
2 +//# sourceMappingURL=content.js.map
1 +body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#ccc}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem}
1 +body {
2 + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
3 + line-height: 1.4;
4 + margin: 1rem auto;
5 + max-width: 900px;
6 +}
7 +table {
8 + border-collapse: collapse;
9 +}
10 +/* Apply a default padding if legacy cellpadding attribute is missing */
11 +table:not([cellpadding]) th,
12 +table:not([cellpadding]) td {
13 + padding: 0.4rem;
14 +}
15 +/* Set default table styles if a table has a positive border attribute
16 + and no inline css */
17 +table[border]:not([border="0"]):not([style*="border-width"]) th,
18 +table[border]:not([border="0"]):not([style*="border-width"]) td {
19 + border-width: 1px;
20 +}
21 +/* Set default table styles if a table has a positive border attribute
22 + and no inline css */
23 +table[border]:not([border="0"]):not([style*="border-style"]) th,
24 +table[border]:not([border="0"]):not([style*="border-style"]) td {
25 + border-style: solid;
26 +}
27 +/* Set default table styles if a table has a positive border attribute
28 + and no inline css */
29 +table[border]:not([border="0"]):not([style*="border-color"]) th,
30 +table[border]:not([border="0"]):not([style*="border-color"]) td {
31 + border-color: #ccc;
32 +}
33 +figure {
34 + display: table;
35 + margin: 1rem auto;
36 +}
37 +figure figcaption {
38 + color: #999;
39 + display: block;
40 + margin-top: 0.25rem;
41 + text-align: center;
42 +}
43 +hr {
44 + border-color: #ccc;
45 + border-style: solid;
46 + border-width: 1px 0 0 0;
47 +}
48 +code {
49 + background-color: #e8e8e8;
50 + border-radius: 3px;
51 + padding: 0.1rem 0.2rem;
52 +}
53 +.mce-content-body:not([dir=rtl]) blockquote {
54 + border-left: 2px solid #ccc;
55 + margin-left: 1.5rem;
56 + padding-left: 1rem;
57 +}
58 +.mce-content-body[dir=rtl] blockquote {
59 + border-right: 2px solid #ccc;
60 + margin-right: 1.5rem;
61 + padding-right: 1rem;
62 +}
1 +tinymce.Resource.add('content/writer/content.css', "body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem auto;max-width:900px}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border=\"0\"]):not([style*=border-width]) td,table[border]:not([border=\"0\"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border=\"0\"]):not([style*=border-style]) td,table[border]:not([border=\"0\"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border=\"0\"]):not([style*=border-color]) td,table[border]:not([border=\"0\"]):not([style*=border-color]) th{border-color:#ccc}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem}")
2 +//# sourceMappingURL=content.js.map
1 +body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem auto;max-width:900px}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#ccc}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +body.tox-dialog__disable-scroll {
2 + overflow: hidden;
3 +}
4 +.tox-fullscreen {
5 + border: 0;
6 + height: 100%;
7 + margin: 0;
8 + overflow: hidden;
9 + overscroll-behavior: none;
10 + padding: 0;
11 + touch-action: pinch-zoom;
12 + width: 100%;
13 +}
14 +.tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle {
15 + display: none;
16 +}
17 +.tox.tox-tinymce.tox-fullscreen,
18 +.tox-shadowhost.tox-fullscreen {
19 + left: 0;
20 + position: fixed;
21 + top: 0;
22 + z-index: 1200;
23 +}
24 +.tox.tox-tinymce.tox-fullscreen {
25 + background-color: transparent;
26 +}
27 +.tox-fullscreen .tox.tox-tinymce-aux,
28 +.tox-fullscreen ~ .tox.tox-tinymce-aux {
29 + z-index: 1201;
30 +}
1 +tinymce.Resource.add('ui/dark/skin.shadowdom.css', "body.tox-dialog__disable-scroll{overflow:hidden}.tox-fullscreen{border:0;height:100%;margin:0;overflow:hidden;overscroll-behavior:none;padding:0;touch-action:pinch-zoom;width:100%}.tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle{display:none}.tox-shadowhost.tox-fullscreen,.tox.tox-tinymce.tox-fullscreen{left:0;position:fixed;top:0;z-index:1200}.tox.tox-tinymce.tox-fullscreen{background-color:transparent}.tox-fullscreen .tox.tox-tinymce-aux,.tox-fullscreen~.tox.tox-tinymce-aux{z-index:1201}")
2 +//# sourceMappingURL=skin.shadowdom.js.map
1 +body.tox-dialog__disable-scroll{overflow:hidden}.tox-fullscreen{border:0;height:100%;margin:0;overflow:hidden;overscroll-behavior:none;padding:0;touch-action:pinch-zoom;width:100%}.tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle{display:none}.tox-shadowhost.tox-fullscreen,.tox.tox-tinymce.tox-fullscreen{left:0;position:fixed;top:0;z-index:1200}.tox.tox-tinymce.tox-fullscreen{background-color:transparent}.tox-fullscreen .tox.tox-tinymce-aux,.tox-fullscreen~.tox.tox-tinymce-aux{z-index:1201}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +body.tox-dialog__disable-scroll {
2 + overflow: hidden;
3 +}
4 +.tox-fullscreen {
5 + border: 0;
6 + height: 100%;
7 + margin: 0;
8 + overflow: hidden;
9 + overscroll-behavior: none;
10 + padding: 0;
11 + touch-action: pinch-zoom;
12 + width: 100%;
13 +}
14 +.tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle {
15 + display: none;
16 +}
17 +.tox.tox-tinymce.tox-fullscreen,
18 +.tox-shadowhost.tox-fullscreen {
19 + left: 0;
20 + position: fixed;
21 + top: 0;
22 + z-index: 1200;
23 +}
24 +.tox.tox-tinymce.tox-fullscreen {
25 + background-color: transparent;
26 +}
27 +.tox-fullscreen .tox.tox-tinymce-aux,
28 +.tox-fullscreen ~ .tox.tox-tinymce-aux {
29 + z-index: 1201;
30 +}
1 +tinymce.Resource.add('ui/default/skin.shadowdom.css', "body.tox-dialog__disable-scroll{overflow:hidden}.tox-fullscreen{border:0;height:100%;margin:0;overflow:hidden;overscroll-behavior:none;padding:0;touch-action:pinch-zoom;width:100%}.tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle{display:none}.tox-shadowhost.tox-fullscreen,.tox.tox-tinymce.tox-fullscreen{left:0;position:fixed;top:0;z-index:1200}.tox.tox-tinymce.tox-fullscreen{background-color:transparent}.tox-fullscreen .tox.tox-tinymce-aux,.tox-fullscreen~.tox.tox-tinymce-aux{z-index:1201}")
2 +//# sourceMappingURL=skin.shadowdom.js.map
1 +body.tox-dialog__disable-scroll{overflow:hidden}.tox-fullscreen{border:0;height:100%;margin:0;overflow:hidden;overscroll-behavior:none;padding:0;touch-action:pinch-zoom;width:100%}.tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle{display:none}.tox-shadowhost.tox-fullscreen,.tox.tox-tinymce.tox-fullscreen{left:0;position:fixed;top:0;z-index:1200}.tox.tox-tinymce.tox-fullscreen{background-color:transparent}.tox-fullscreen .tox.tox-tinymce-aux,.tox-fullscreen~.tox.tox-tinymce-aux{z-index:1201}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +body.tox-dialog__disable-scroll {
2 + overflow: hidden;
3 +}
4 +.tox-fullscreen {
5 + border: 0;
6 + height: 100%;
7 + margin: 0;
8 + overflow: hidden;
9 + overscroll-behavior: none;
10 + padding: 0;
11 + touch-action: pinch-zoom;
12 + width: 100%;
13 +}
14 +.tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle {
15 + display: none;
16 +}
17 +.tox.tox-tinymce.tox-fullscreen,
18 +.tox-shadowhost.tox-fullscreen {
19 + left: 0;
20 + position: fixed;
21 + top: 0;
22 + z-index: 1200;
23 +}
24 +.tox.tox-tinymce.tox-fullscreen {
25 + background-color: transparent;
26 +}
27 +.tox-fullscreen .tox.tox-tinymce-aux,
28 +.tox-fullscreen ~ .tox.tox-tinymce-aux {
29 + z-index: 1201;
30 +}
1 +tinymce.Resource.add('ui/tinymce-5-dark/skin.shadowdom.css', "body.tox-dialog__disable-scroll{overflow:hidden}.tox-fullscreen{border:0;height:100%;margin:0;overflow:hidden;overscroll-behavior:none;padding:0;touch-action:pinch-zoom;width:100%}.tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle{display:none}.tox-shadowhost.tox-fullscreen,.tox.tox-tinymce.tox-fullscreen{left:0;position:fixed;top:0;z-index:1200}.tox.tox-tinymce.tox-fullscreen{background-color:transparent}.tox-fullscreen .tox.tox-tinymce-aux,.tox-fullscreen~.tox.tox-tinymce-aux{z-index:1201}")
2 +//# sourceMappingURL=skin.shadowdom.js.map
1 +body.tox-dialog__disable-scroll{overflow:hidden}.tox-fullscreen{border:0;height:100%;margin:0;overflow:hidden;overscroll-behavior:none;padding:0;touch-action:pinch-zoom;width:100%}.tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle{display:none}.tox-shadowhost.tox-fullscreen,.tox.tox-tinymce.tox-fullscreen{left:0;position:fixed;top:0;z-index:1200}.tox.tox-tinymce.tox-fullscreen{background-color:transparent}.tox-fullscreen .tox.tox-tinymce-aux,.tox-fullscreen~.tox.tox-tinymce-aux{z-index:1201}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +body.tox-dialog__disable-scroll {
2 + overflow: hidden;
3 +}
4 +.tox-fullscreen {
5 + border: 0;
6 + height: 100%;
7 + margin: 0;
8 + overflow: hidden;
9 + overscroll-behavior: none;
10 + padding: 0;
11 + touch-action: pinch-zoom;
12 + width: 100%;
13 +}
14 +.tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle {
15 + display: none;
16 +}
17 +.tox.tox-tinymce.tox-fullscreen,
18 +.tox-shadowhost.tox-fullscreen {
19 + left: 0;
20 + position: fixed;
21 + top: 0;
22 + z-index: 1200;
23 +}
24 +.tox.tox-tinymce.tox-fullscreen {
25 + background-color: transparent;
26 +}
27 +.tox-fullscreen .tox.tox-tinymce-aux,
28 +.tox-fullscreen ~ .tox.tox-tinymce-aux {
29 + z-index: 1201;
30 +}
1 +tinymce.Resource.add('ui/tinymce-5/skin.shadowdom.css', "body.tox-dialog__disable-scroll{overflow:hidden}.tox-fullscreen{border:0;height:100%;margin:0;overflow:hidden;overscroll-behavior:none;padding:0;touch-action:pinch-zoom;width:100%}.tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle{display:none}.tox-shadowhost.tox-fullscreen,.tox.tox-tinymce.tox-fullscreen{left:0;position:fixed;top:0;z-index:1200}.tox.tox-tinymce.tox-fullscreen{background-color:transparent}.tox-fullscreen .tox.tox-tinymce-aux,.tox-fullscreen~.tox.tox-tinymce-aux{z-index:1201}")
2 +//# sourceMappingURL=skin.shadowdom.js.map
1 +body.tox-dialog__disable-scroll{overflow:hidden}.tox-fullscreen{border:0;height:100%;margin:0;overflow:hidden;overscroll-behavior:none;padding:0;touch-action:pinch-zoom;width:100%}.tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle{display:none}.tox-shadowhost.tox-fullscreen,.tox.tox-tinymce.tox-fullscreen{left:0;position:fixed;top:0;z-index:1200}.tox.tox-tinymce.tox-fullscreen{background-color:transparent}.tox-fullscreen .tox.tox-tinymce-aux,.tox-fullscreen~.tox.tox-tinymce-aux{z-index:1201}
1 +<!--
2 + * @Date: 2024-07-12 13:28:27
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2024-07-12 14:20:07
5 + * @FilePath: /data-table/src/components/TEditor/index.vue
6 + * @Description: 文件描述
7 +-->
8 +<template>
9 + <div style="height: 100%; overflow: hidden">
10 + <editor
11 + api-key="no-api-key"
12 + v-model="myValue"
13 + :init="init"
14 + :enabled="enabled"
15 + :id="tinymceId"
16 + ></editor>
17 + </div>
18 +</template>
19 +
20 +<script setup>
21 +import {computed, reactive, watch, ref, nextTick, onMounted} from "vue"; //全屏
22 +
23 +import tinymce from "tinymce/tinymce";
24 +// import "tinymce/skins/content/default/content.css";
25 +import Editor from "@tinymce/tinymce-vue";
26 +import "tinymce/icons/default/icons";
27 +import "tinymce/models/dom"; // 一定要引入
28 +import "tinymce/themes/silver"; // 界面UI主题
29 +import "tinymce/plugins/image";
30 +import "tinymce/plugins/table";
31 +import "tinymce/plugins/lists"; // 列表插件
32 +import "tinymce/plugins/wordcount"; // 文字计数
33 +import "tinymce/plugins/preview"; // 预览
34 +import "tinymce/plugins/emoticons"; // emoji表情
35 +import "tinymce/plugins/emoticons/js/emojis.js"; //必须引入这个文件才有表情图库
36 +import "tinymce/plugins/code"; // 编辑源码
37 +import "tinymce/plugins/link"; // 链接插件
38 +import "tinymce/plugins/advlist"; //高级列表
39 +import "tinymce/plugins/codesample"; //代码示例
40 +import "tinymce/plugins/autoresize"; // 自动调整编辑器大小
41 +import "tinymce/plugins/quickbars"; // 光标处快捷提示
42 +import "tinymce/plugins/nonbreaking"; //插入不间断空格
43 +import "tinymce/plugins/searchreplace"; //查找替换
44 +import "tinymce/plugins/autolink"; //自动链接
45 +import "tinymce/plugins/directionality"; //文字方向
46 +import "tinymce/plugins/visualblocks"; //显示元素范围
47 +import "tinymce/plugins/visualchars"; //显示不可见字符
48 +import "tinymce/plugins/charmap"; // 特殊符号
49 +import "tinymce/plugins/nonbreaking"; //插入不间断空格
50 +import "tinymce/plugins/insertdatetime"; //插入日期时间
51 +import "tinymce/plugins/importcss"; //引入自定义样式的css文件
52 +import "tinymce/plugins/accordion"; // 可折叠数据手风琴模式
53 +import "tinymce/plugins/anchor"; //锚点
54 +import "tinymce/plugins/fullscreen";
55 +
56 +
57 +const emits = defineEmits(["update:modelValue", "setHtml"]);
58 +//这里我选择将数据定义在props里面,方便在不同的页面也可以配置出不同的编辑器,当然也可以直接在组件中直接定义
59 +const props = defineProps({
60 + value: {
61 + type: String,
62 + default: () => {
63 + return "";
64 + },
65 + },
66 + baseUrl: {
67 + type: String,
68 + default: "",
69 + },
70 + enabled: {
71 + type: Boolean,
72 + default: true,
73 + },
74 + // 编辑器初始可编辑状态
75 + editable_root: {
76 + type: Boolean,
77 + default: true,
78 + },
79 + plugins: {
80 + type: [String, Array],
81 + default:
82 + "importcss autoresize searchreplace autolink directionality code visualblocks visualchars fullscreen image link codesample table charmap nonbreaking anchor insertdatetime advlist lists wordcount charmap quickbars emoticons accordion",
83 + },
84 + knwlgId: {
85 + type: String,
86 + },
87 + toolbar: {
88 + type: [String, Array, Boolean],
89 + default: "undo redo | accordion accordionremove | blocks fontfamily fontsize| bold italic underline strikethrough ltr rtl | align numlist bullist | link image | table | lineheight outdent indent| forecolor backcolor removeformat | charmap emoticons | anchor codesample",
90 + },
91 + readonly: {
92 + type: Boolean,
93 + default: false,
94 + },
95 + minHeight: {
96 + type: Number,
97 + default: 630,
98 + },
99 +});
100 +const loading = ref(false);
101 +const tinymceId = ref(
102 + "vue-tinymce-" + +new Date() + ((Math.random() * 1000).toFixed(0) + "")
103 +);
104 +
105 +
106 +//定义一个对象 init初始化
107 +const init = reactive({
108 + selector: "#" + tinymceId.value, //富文本编辑器的id,
109 + // language_url: "/tinymce/langs/zh_CN.js", // 语言包的路径,具体路径看自己的项目
110 + language_url: "https://cdn.ipadbiz.cn/custom_form/tinymce/langs/zh_CN.js", // 语言包的路径,具体路径看自己的项目
111 + language: "zh_CN",
112 + // skin_url: "/tinymce/skins/ui/oxide", // skin路径,具体路径看自己的项目
113 + skin_url: "https://cdn.ipadbiz.cn/custom_form/tinymce/skins/ui/oxide", // skin路径,具体路径看自己的项目
114 + editable_root: props.editable_root,
115 + height: 600,
116 + branding: false, // 是否禁用“Powered by TinyMCE”
117 + promotion: false, //去掉 upgrade
118 + // toolbar_sticky: true,
119 + // toolbar_sticky_offset: 100,
120 + menubar: "edit view insert format tools table",
121 + paste_data_images: true, //允许粘贴图像
122 + image_dimensions: false, //去除宽高属性
123 + plugins: props.plugins, //这里的数据是在props里面就定义好了的
124 + toolbar: props.toolbar, //这里的数据是在props里面就定义好了的
125 + // 取消图片资源路径转换
126 + convert_urls: false,
127 + // table边框位0是否展示网格线
128 + // visual: false,
129 + // 超链接默认打开方式
130 + link_default_target: "_blank",
131 + link_context_toolbar: true,
132 + // 默认快捷菜单
133 + quickbars_insert_toolbar: "image codesample table",
134 + // 选中图片的快捷提示
135 + quickbars_image_toolbar: "alignleft aligncenter alignright | rotateleft rotateright | imageoptions",
136 + editimage_toolbar: "rotateleft rotateright | flipv fliph | editimage imageoptions",
137 + // 文字样式
138 + font_family_formats:
139 + "Arial=arial,helvetica,sans-serif; 宋体=SimSun; 微软雅黑=Microsoft Yahei; Impact=impact,chicago;", //字体
140 + font_size_formats: "11px 12px 14px 16px 18px 24px 36px 48px 64px 72px", //文字大小
141 + image_caption: true,
142 + editimage_cors_hosts: ["picsum.photos"],
143 + noneditable_class: "mceNonEditable",
144 + toolbar_mode: "wrap", // 工具栏模式 floating / sliding / scrolling / wrap
145 + // 默认样式
146 + content_style:
147 + "body { font-family:Helvetica,Arial,sans-serif; font-size:16px }p {margin:3px; line-height:24px;}",
148 + image_advtab: true,
149 + importcss_append: true,
150 + paste_webkit_styles: "all",
151 + paste_merge_formats: true,
152 + nonbreaking_force_tab: false,
153 + paste_auto_cleanup_on_paste: false,
154 + file_picker_types: "file",
155 + // 选中文字的快捷提示
156 + quickbars_selection_toolbar:
157 + "bold italic | quicklink h2 h3 blockquote quickimage quicktable",
158 + // 编辑器高度自适应
159 + autoresize_bottom_margin: 20,
160 + // autoresize_overflow_padding: 16,
161 + min_height: props.minHeight,
162 + // content_css: "/tinymce/skins/content/default/content.css", //以css文件方式自定义可编辑区域的css样式,css文件需自己创建并引入
163 + content_css: "https://cdn.ipadbiz.cn/custom_form/tinymce/skins/content/default/content.css", //以css文件方式自定义可编辑区域的css样式,css文件需自己创建并引入
164 + // setup: function (editor) {
165 + // },
166 + //图片上传 -实列 具体请根据官网补充-
167 + images_upload_handler: function (blobInfo, progress) {
168 + new Promise((resolve, reject) => {
169 + let file = blobInfo.blob();
170 + if (file.size / 1024 / 1024 > 200) {
171 + reject({
172 + message: "上传失败,图片大小请控制在 200M 以内",
173 + remove: true,
174 + });
175 + }
176 + const formData = new FormData();
177 + formData.append("file", file);
178 + console.log( formData)
179 + axios.post("/api/upload/upload", formData, {
180 + headers: {
181 + "Content-Type": "multipart/form-data",
182 + },
183 + onUploadProgress: (progressEvent) => {
184 + progress(
185 + Math.round((progressEvent.loaded / progressEvent.total) * 100)
186 + );
187 + },
188 + }).then((res) => {
189 + resolve(res.data.url);
190 + })
191 + .catch()
192 +
193 + });
194 + },
195 +});
196 +
197 +// 外部传递进来的数据变化
198 +const myValue = computed({
199 + get() {
200 + return props.modelValue;
201 + },
202 + set(val) {
203 + emits("update:modelValue", val);
204 + },
205 +});
206 +
207 +//监听富文本中的数据变化
208 +watch(
209 + () => myValue.value,
210 + () => {
211 + emits(
212 + "setHtml",
213 + tinymce.activeEditor.getContent({format: "text"}),
214 + myValue.value
215 + );
216 + }
217 +);
218 +
219 +// 设置编辑器只读模式
220 +watch(
221 + () => props.readonly,
222 + (newValue, oldValue) => {
223 + nextTick(() => {
224 + tinymce.activeEditor.mode.set(newValue ? "readonly" : "design");
225 + let iframeDom = document.querySelector("iframe");
226 + iframeDom &&
227 + (iframeDom.contentWindow.document.body.style.margin = newValue
228 + ? 0
229 + : "16px");
230 + });
231 + },
232 + {immediate: true}
233 +);
234 +
235 +//初始化编辑器
236 +onMounted(() => {
237 + tinymce.init({});
238 +});
239 +
240 +// 设置值
241 +const handleSetContent = (content) => {
242 + tinymce.activeEditor.setContent(content);
243 +};
244 +
245 +// 获取值
246 +const handleGetContent = () => {
247 + return tinymce.activeEditor.getContent();
248 +};
249 +
250 +defineExpose({
251 + handleSetContent,
252 + handleGetContent,
253 +});
254 +</script>
255 +
256 +<style lang="less" scoped>
257 +:deep(.tox-tinymce) {
258 + border: 1px solid #dcdfe6;
259 + border-radius: 4px;
260 +
261 + .tox-statusbar {
262 + display: none;
263 + }
264 +}
265 +</style>
1 /* 1 /*
2 - * @Date: 2022-07-18 10:22:22 2 + * @Date: 2023-09-01 10:29:30
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-06-24 17:10:34 4 + * @LastEditTime: 2024-07-12 13:20:45
5 * @FilePath: /data-table/src/route.js 5 * @FilePath: /data-table/src/route.js
6 * @Description: 文件描述 6 * @Description: 文件描述
7 */ 7 */
...@@ -35,4 +35,10 @@ export default [{ ...@@ -35,4 +35,10 @@ export default [{
35 meta: { 35 meta: {
36 title: '未授权页面', 36 title: '未授权页面',
37 } 37 }
38 +}, {
39 + path: '/test',
40 + component: () => import('@/views/test.vue'),
41 + meta: {
42 + title: 'test',
43 + }
38 }]; 44 }];
......
1 +<template>
2 + <div class="tinymce-box">
3 + <TEditor ref="refEdit" ></TEditor>
4 + <div @click="getValue">获取内容</div>
5 + </div>
6 +</template>
7 +
8 +<script setup>
9 + import TEditor from "@/components/TEditor/index.vue";
10 +
11 + const refEdit = ref(null);
12 +
13 + // refEdit.value.handleGetContent()
14 + const getValue = () => {
15 + console.warn(refEdit.value.handleGetContent());
16 + }
17 +</script>
18 +
19 +<style>
20 +.tinymce-box {
21 + width: 200px;
22 +}
23 +</style>
...@@ -251,7 +251,7 @@ ...@@ -251,7 +251,7 @@
251 251
252 "@dedisuryadi/json-form-data@^0.1.1": 252 "@dedisuryadi/json-form-data@^0.1.1":
253 version "0.1.1" 253 version "0.1.1"
254 - resolved "https://mirrors.cloud.tencent.com/npm/@dedisuryadi/json-form-data/-/json-form-data-0.1.1.tgz#49597360f7375ef7f95866b88ccb1bcef675a84e" 254 + resolved "https://mirrors.cloud.tencent.com/npm/@dedisuryadi/json-form-data/-/json-form-data-0.1.1.tgz"
255 integrity sha512-QOok/btRgsPlFADxe0gFQpquGO9hQ5jpiIZF2OgHEK/wCw4PdOsz8f1BU9hmOjnyFphZIseaAaHYpDgq4xdAhg== 255 integrity sha512-QOok/btRgsPlFADxe0gFQpquGO9hQ5jpiIZF2OgHEK/wCw4PdOsz8f1BU9hmOjnyFphZIseaAaHYpDgq4xdAhg==
256 256
257 "@jridgewell/gen-mapping@^0.1.0": 257 "@jridgewell/gen-mapping@^0.1.0":
...@@ -375,6 +375,13 @@ ...@@ -375,6 +375,13 @@
375 estree-walker "^2.0.2" 375 estree-walker "^2.0.2"
376 picomatch "^2.3.1" 376 picomatch "^2.3.1"
377 377
378 +"@tinymce/tinymce-vue@^5":
379 + version "5.1.1"
380 + resolved "https://mirrors.cloud.tencent.com/npm/@tinymce/tinymce-vue/-/tinymce-vue-5.1.1.tgz#0879787e07833a4316b2eaf0417c7c6a2abce86b"
381 + integrity sha512-iO57HOWesFOhsaqjA5Ea6sDvQBmJJH3/dq00Uvg7metlct2kLF+ctRgoDsetLt6gmeZ7COPftr814/XzqnJ/dg==
382 + dependencies:
383 + tinymce "^6.0.0 || ^5.5.1"
384 +
378 "@types/estree@^1.0.0": 385 "@types/estree@^1.0.0":
379 version "1.0.0" 386 version "1.0.0"
380 resolved "https://mirrors.cloud.tencent.com/npm/@types%2festree/-/estree-1.0.0.tgz" 387 resolved "https://mirrors.cloud.tencent.com/npm/@types%2festree/-/estree-1.0.0.tgz"
...@@ -3363,6 +3370,16 @@ through@^2.3.8: ...@@ -3363,6 +3370,16 @@ through@^2.3.8:
3363 resolved "https://mirrors.cloud.tencent.com/npm/through/-/through-2.3.8.tgz" 3370 resolved "https://mirrors.cloud.tencent.com/npm/through/-/through-2.3.8.tgz"
3364 integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= 3371 integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=
3365 3372
3373 +"tinymce@^6.0.0 || ^5.5.1":
3374 + version "6.8.4"
3375 + resolved "https://mirrors.cloud.tencent.com/npm/tinymce/-/tinymce-6.8.4.tgz#53e1313ebfe5524b24c0fa45937d51fda058632d"
3376 + integrity sha512-okoJyxuPv1gzASxQDNgQbnUXOdAIyoOSXcXcZZu7tiW0PSKEdf3SdASxPBupRj+64/E3elHwVRnzSdo82Emqbg==
3377 +
3378 +tinymce@^7.2.1:
3379 + version "7.2.1"
3380 + resolved "https://mirrors.cloud.tencent.com/npm/tinymce/-/tinymce-7.2.1.tgz#9b4f6b5a0fa647e2953c174ac69aa47483683332"
3381 + integrity sha512-ADd1cvdIuq6NWyii0ZOZRuu+9sHIdQfcRNWBcBps2K8vy7OjlRkX6iw7zz1WlL9kY4z4L1DvIP+xOrVX/46aHA==
3382 +
3366 tmp@~0.2.1: 3383 tmp@~0.2.1:
3367 version "0.2.1" 3384 version "0.2.1"
3368 resolved "https://mirrors.cloud.tencent.com/npm/tmp/-/tmp-0.2.1.tgz" 3385 resolved "https://mirrors.cloud.tencent.com/npm/tmp/-/tmp-0.2.1.tgz"
...@@ -3632,7 +3649,7 @@ uuid@^8.3.2: ...@@ -3632,7 +3649,7 @@ uuid@^8.3.2:
3632 3649
3633 vant@^4.9.1: 3650 vant@^4.9.1:
3634 version "4.9.1" 3651 version "4.9.1"
3635 - resolved "https://mirrors.cloud.tencent.com/npm/vant/-/vant-4.9.1.tgz#d042702b0d14da987e4b17e46e4297dabb5fae01" 3652 + resolved "https://mirrors.cloud.tencent.com/npm/vant/-/vant-4.9.1.tgz"
3636 integrity sha512-p7iAKJyACYVwrmrkf3COmbuvzjHrFJ+FAmlyOWbxTS2ovkRs+tNKYjX2iibAl4XnHXBQD+qpX0ogUqE3jE7Isg== 3653 integrity sha512-p7iAKJyACYVwrmrkf3COmbuvzjHrFJ+FAmlyOWbxTS2ovkRs+tNKYjX2iibAl4XnHXBQD+qpX0ogUqE3jE7Isg==
3637 dependencies: 3654 dependencies:
3638 "@vant/popperjs" "^1.3.0" 3655 "@vant/popperjs" "^1.3.0"
......