@jx3box/jx3box-editor 1.0.0 → 1.0.5
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/assets/css/article_markdown.less +12 -0
- package/assets/css/markdown/common.less +13 -0
- package/assets/css/markdown.less +0 -7
- package/assets/css/module/code.less +1 -1
- package/assets/data/markdown_whitelist.json +14 -0
- package/assets/js/code.js +13 -0
- package/assets/js/directory.js +1 -1
- package/package.json +73 -71
- package/src/Article.vue +2 -5
- package/src/ArticleMarkdown.vue +151 -0
- package/src/Markdown.vue +35 -3
- package/src/components/markdown/macro.vue +46 -0
- package/src/components/markdown/pz.vue +49 -0
- package/vue.config.js +6 -0
- package/src/components/article/render_markdown.vue +0 -0
- package/src/components/article/render_tinymce.vue +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
.c-article-markdown {
|
|
2
|
+
@import "module/video.less";
|
|
3
|
+
|
|
4
|
+
@import 'module/macro.less';
|
|
5
|
+
@import 'module/qixue.less';
|
|
6
|
+
|
|
7
|
+
@import 'module/jx3_element.less';
|
|
8
|
+
@import 'module/buff.less';
|
|
9
|
+
@import 'module/skill.less';
|
|
10
|
+
@import 'module/icon.less';
|
|
11
|
+
@import 'module/resource.less';
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
.c-editor-markdown-macro {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
|
|
4
|
+
.u-input {
|
|
5
|
+
.el-textarea__inner {
|
|
6
|
+
|
|
7
|
+
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
.el-dialog__body {
|
|
11
|
+
padding-top: 0;
|
|
12
|
+
}
|
|
13
|
+
}
|
package/assets/css/markdown.less
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"xssOptions": {
|
|
3
|
+
"whiteList": {
|
|
4
|
+
"pre": ["class", "style"],
|
|
5
|
+
"div": ["class", "style"],
|
|
6
|
+
"video": ["controls", "width", "height", "style", "src"],
|
|
7
|
+
"audio": ["controls", "src"],
|
|
8
|
+
"source": ["src", "type", "style"],
|
|
9
|
+
"iframe": ["src", "frameborder", "scrolling", "allowfullscreen"],
|
|
10
|
+
"details":[],
|
|
11
|
+
"summary":[]
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
package/assets/js/directory.js
CHANGED
package/package.json
CHANGED
|
@@ -1,76 +1,78 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
"name": "@jx3box/jx3box-editor",
|
|
3
|
+
"version": "1.0.5",
|
|
4
|
+
"description": "JX3BOX Article & Editor",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "env DEV_SERVER=true vue-cli-service serve",
|
|
8
|
+
"serve": "vue-cli-service serve",
|
|
9
|
+
"build": "vue-cli-service build",
|
|
10
|
+
"lint": "vue-cli-service lint",
|
|
11
|
+
"inspect": "vue inspect > output.js",
|
|
12
|
+
"update": "npm --registry https://registry.npmjs.org install @jx3box/jx3box-common@latest @jx3box/jx3box-macro@latest @jx3box/jx3box-talent@latest @jx3box/jx3box-emotion@latest @jx3box/jx3box-data@latest @jx3box/markdown@latest",
|
|
13
|
+
"article": "vue-cli-service build --target lib --name jx3box_article src/Article.vue --mode production",
|
|
14
|
+
"tinymce": "vue-cli-service build --target lib --name tinymce src/Tinymce.vue && cp public/tinymce.html dist/tinymce.html"
|
|
15
|
+
},
|
|
16
|
+
"eslintConfig": {
|
|
17
|
+
"root": true,
|
|
18
|
+
"env": {
|
|
19
|
+
"node": true
|
|
15
20
|
},
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
"env": {
|
|
19
|
-
"node": true
|
|
20
|
-
},
|
|
21
|
-
"extends": [
|
|
22
|
-
"plugin:vue/essential"
|
|
23
|
-
],
|
|
24
|
-
"rules": {},
|
|
25
|
-
"parserOptions": {
|
|
26
|
-
"parser": "babel-eslint"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
"browserslist": [
|
|
30
|
-
"> 1%",
|
|
31
|
-
"last 2 versions"
|
|
21
|
+
"extends": [
|
|
22
|
+
"plugin:vue/essential"
|
|
32
23
|
],
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"@jx3box/jx3box-emotion": "^1.0.10",
|
|
37
|
-
"@jx3box/jx3box-macro": "^1.0.1",
|
|
38
|
-
"@jx3box/jx3box-talent": "^1.1.2",
|
|
39
|
-
"@jx3box/markdown": "0.0.8",
|
|
40
|
-
"@tinymce/tinymce-vue": "^3.2.2",
|
|
41
|
-
"axios": "^0.19.2",
|
|
42
|
-
"core-js": "^3.6.5",
|
|
43
|
-
"csslab": "^4.0.3",
|
|
44
|
-
"element-ui": "^2.13.2",
|
|
45
|
-
"hevue-img-preview": "^5.0.0",
|
|
46
|
-
"jquery": "^3.5.1",
|
|
47
|
-
"js-base64": "^3.6.1",
|
|
48
|
-
"katex": "^0.13.0",
|
|
49
|
-
"lodash": "^4.17.15",
|
|
50
|
-
"photoswipe": "^4.1.2",
|
|
51
|
-
"prismjs": "^1.20.0",
|
|
52
|
-
"vue": "^2.6.11",
|
|
53
|
-
"vue-gallery-slideshow": "^1.5.2",
|
|
54
|
-
"vue-photoswipe.js": "^2.0.23",
|
|
55
|
-
"xss": "^1.0.8"
|
|
56
|
-
},
|
|
57
|
-
"devDependencies": {
|
|
58
|
-
"@vue/cli-plugin-babel": "~4.3.0",
|
|
59
|
-
"@vue/cli-plugin-eslint": "~4.3.0",
|
|
60
|
-
"@vue/cli-plugin-vuex": "^4.0.0",
|
|
61
|
-
"@vue/cli-service": "~4.3.0",
|
|
62
|
-
"babel-eslint": "^10.1.0",
|
|
63
|
-
"eslint": "^6.7.2",
|
|
64
|
-
"eslint-plugin-vue": "^6.2.2",
|
|
65
|
-
"less": "^3.0.4",
|
|
66
|
-
"less-loader": "^5.0.0",
|
|
67
|
-
"style-resources-loader": "^1.3.3",
|
|
68
|
-
"vue-cli-plugin-element": "~1.0.1",
|
|
69
|
-
"vue-svg-inline-loader": "^1.4.6",
|
|
70
|
-
"vue-template-compiler": "^2.6.11"
|
|
71
|
-
},
|
|
72
|
-
"repository": {
|
|
73
|
-
"type": "git",
|
|
74
|
-
"url": "git+https://github.com/JX3BOX/jx3box-editor.git"
|
|
24
|
+
"rules": {},
|
|
25
|
+
"parserOptions": {
|
|
26
|
+
"parser": "babel-eslint"
|
|
75
27
|
}
|
|
28
|
+
},
|
|
29
|
+
"browserslist": [
|
|
30
|
+
"> 1%",
|
|
31
|
+
"last 2 versions"
|
|
32
|
+
],
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@jx3box/jx3box-common": "^6.7.8",
|
|
35
|
+
"@jx3box/jx3box-data": "^1.8.3",
|
|
36
|
+
"@jx3box/jx3box-emotion": "^1.0.10",
|
|
37
|
+
"@jx3box/jx3box-macro": "^1.0.1",
|
|
38
|
+
"@jx3box/jx3box-talent": "^1.1.2",
|
|
39
|
+
"@jx3box/markdown": "^0.1.4",
|
|
40
|
+
"@tinymce/tinymce-vue": "^3.2.2",
|
|
41
|
+
"axios": "^0.19.2",
|
|
42
|
+
"core-js": "^3.6.5",
|
|
43
|
+
"csslab": "^4.0.3",
|
|
44
|
+
"element-ui": "^2.13.2",
|
|
45
|
+
"hevue-img-preview": "^5.0.0",
|
|
46
|
+
"highlight.js": "^11.3.1",
|
|
47
|
+
"jquery": "^3.5.1",
|
|
48
|
+
"js-base64": "^3.6.1",
|
|
49
|
+
"katex": "^0.13.0",
|
|
50
|
+
"lodash": "^4.17.15",
|
|
51
|
+
"photoswipe": "^4.1.2",
|
|
52
|
+
"prismjs": "^1.20.0",
|
|
53
|
+
"vue": "^2.6.11",
|
|
54
|
+
"vue-gallery-slideshow": "^1.5.2",
|
|
55
|
+
"vue-photoswipe.js": "^2.0.23",
|
|
56
|
+
"xss": "^1.0.8"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@babel/plugin-proposal-optional-chaining": "^7.16.5",
|
|
60
|
+
"@vue/cli-plugin-babel": "~4.3.0",
|
|
61
|
+
"@vue/cli-plugin-eslint": "~4.3.0",
|
|
62
|
+
"@vue/cli-plugin-vuex": "^4.0.0",
|
|
63
|
+
"@vue/cli-service": "~4.3.0",
|
|
64
|
+
"babel-eslint": "^10.1.0",
|
|
65
|
+
"eslint": "^6.7.2",
|
|
66
|
+
"eslint-plugin-vue": "^6.2.2",
|
|
67
|
+
"less": "^3.0.4",
|
|
68
|
+
"less-loader": "^5.0.0",
|
|
69
|
+
"style-resources-loader": "^1.3.3",
|
|
70
|
+
"vue-cli-plugin-element": "~1.0.1",
|
|
71
|
+
"vue-svg-inline-loader": "^1.4.6",
|
|
72
|
+
"vue-template-compiler": "^2.6.11"
|
|
73
|
+
},
|
|
74
|
+
"repository": {
|
|
75
|
+
"type": "git",
|
|
76
|
+
"url": "git+https://github.com/JX3BOX/jx3box-editor.git"
|
|
77
|
+
}
|
|
76
78
|
}
|
package/src/Article.vue
CHANGED
|
@@ -62,9 +62,6 @@
|
|
|
62
62
|
import { Pagination, Button, Popover } from "element-ui";
|
|
63
63
|
import "@jx3box/jx3box-common/css/element.css";
|
|
64
64
|
|
|
65
|
-
// 语法高亮
|
|
66
|
-
import Prism from "prismjs";
|
|
67
|
-
|
|
68
65
|
// 相册
|
|
69
66
|
// import gallery from "vue-gallery-slideshow";
|
|
70
67
|
import Vue from "vue";
|
|
@@ -91,7 +88,7 @@ import renderMacro from "../assets/js/macro";
|
|
|
91
88
|
import renderTalent from "../assets/js/qixue";
|
|
92
89
|
import renderTalent2 from "../assets/js/talent2";
|
|
93
90
|
import renderKatex from "../assets/js/katex";
|
|
94
|
-
|
|
91
|
+
import renderCode from "../assets/js/code";
|
|
95
92
|
import renderImgPreview from "../assets/js/renderImgPreview";
|
|
96
93
|
|
|
97
94
|
// 剑三
|
|
@@ -180,7 +177,7 @@ export default {
|
|
|
180
177
|
// 折叠块
|
|
181
178
|
renderFoldBlock($root);
|
|
182
179
|
// 代码
|
|
183
|
-
|
|
180
|
+
renderCode(`code[class=^'language-']`)
|
|
184
181
|
// Tatex
|
|
185
182
|
renderKatex();
|
|
186
183
|
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="c-article-markdown">
|
|
3
|
+
<markdown-render id="c-article" class="c-markdown" ref="article" v-model="origin" @change="updateOrigin" :preRender="doReg"></markdown-render>
|
|
4
|
+
<div class="w-jx3-element-pop" :style="jx3_element.style">
|
|
5
|
+
<jx3-item :item_id="item.id" :jx3ClientType="item.client" v-show="jx3_element.type == 'item'" />
|
|
6
|
+
<jx3-buff :client="buff.client" :id="buff.id" :level="buff.level" v-show="jx3_element.type == 'buff'" />
|
|
7
|
+
<jx3-skill :client="skill.client" :id="skill.id" :level="skill.level" v-show="jx3_element.type == 'skill'" />
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
import markdownRender from '@jx3box/markdown/src/render.vue'
|
|
14
|
+
|
|
15
|
+
// 基本文本
|
|
16
|
+
import execLazyload from "../assets/js/img";
|
|
17
|
+
import execFilterIframe from "../assets/js/iframe";
|
|
18
|
+
import execFilterLink from "../assets/js/a";
|
|
19
|
+
import execFilterXSS from "../assets/js/script";
|
|
20
|
+
|
|
21
|
+
// 扩展文本
|
|
22
|
+
import renderDirectory from "../assets/js/directory";
|
|
23
|
+
import renderMacro from "../assets/js/macro";
|
|
24
|
+
import renderTalent from "../assets/js/qixue";
|
|
25
|
+
import renderTalent2 from "../assets/js/talent2";
|
|
26
|
+
import renderKatex from "../assets/js/katex";
|
|
27
|
+
import renderCode from "../assets/js/code";
|
|
28
|
+
|
|
29
|
+
// 剑三
|
|
30
|
+
import Item from "./Item";
|
|
31
|
+
import Buff from "./Buff";
|
|
32
|
+
import Skill from "./Skill";
|
|
33
|
+
import renderJx3Element from "../assets/js/jx3_element";
|
|
34
|
+
|
|
35
|
+
import {xssOptions} from '../assets/data/markdown_whitelist.json'
|
|
36
|
+
|
|
37
|
+
export default {
|
|
38
|
+
name: "ArticleMarkdown",
|
|
39
|
+
props: {
|
|
40
|
+
content: String,
|
|
41
|
+
directorybox: String,
|
|
42
|
+
},
|
|
43
|
+
data: function() {
|
|
44
|
+
return {
|
|
45
|
+
// 原始md
|
|
46
|
+
origin : '',
|
|
47
|
+
// 原始渲染md后的html(传入文本回调处理函数)
|
|
48
|
+
html: "",
|
|
49
|
+
|
|
50
|
+
// 物品
|
|
51
|
+
item: {
|
|
52
|
+
id: "",
|
|
53
|
+
client: 1,
|
|
54
|
+
},
|
|
55
|
+
// BUFF
|
|
56
|
+
buff: {
|
|
57
|
+
client: "std",
|
|
58
|
+
id: "",
|
|
59
|
+
level: "",
|
|
60
|
+
},
|
|
61
|
+
// SKILL
|
|
62
|
+
skill: {
|
|
63
|
+
client: "std",
|
|
64
|
+
id: "",
|
|
65
|
+
level: "",
|
|
66
|
+
},
|
|
67
|
+
jx3_element: {
|
|
68
|
+
style: {
|
|
69
|
+
top: 0,
|
|
70
|
+
left: 0,
|
|
71
|
+
display: "none",
|
|
72
|
+
},
|
|
73
|
+
type: "",
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
xssOptions
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
computed: {
|
|
80
|
+
},
|
|
81
|
+
methods: {
|
|
82
|
+
doReg: function(data) {
|
|
83
|
+
if (data) {
|
|
84
|
+
// 过滤内容
|
|
85
|
+
data = execLazyload(data);
|
|
86
|
+
data = execFilterIframe(data);
|
|
87
|
+
data = execFilterXSS(data);
|
|
88
|
+
data = execFilterLink(data);
|
|
89
|
+
return data;
|
|
90
|
+
} else {
|
|
91
|
+
return "";
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
doDOM: function() {
|
|
95
|
+
// 宏
|
|
96
|
+
renderMacro();
|
|
97
|
+
// 奇穴
|
|
98
|
+
renderTalent();
|
|
99
|
+
renderTalent2();
|
|
100
|
+
// Tatex
|
|
101
|
+
renderKatex();
|
|
102
|
+
// 语法高亮
|
|
103
|
+
renderCode(`code[class=^'lang-']`)
|
|
104
|
+
// 物品
|
|
105
|
+
renderJx3Element(this);
|
|
106
|
+
},
|
|
107
|
+
doDir: function() {
|
|
108
|
+
let target = "#c-article";
|
|
109
|
+
let dir = renderDirectory(target, this.directorybox);
|
|
110
|
+
if (dir) this.$emit("directoryRendered");
|
|
111
|
+
},
|
|
112
|
+
updateOrigin : function (md,html){
|
|
113
|
+
this.html = html
|
|
114
|
+
this.render()
|
|
115
|
+
},
|
|
116
|
+
render: function() {
|
|
117
|
+
// 等待html加载完毕后
|
|
118
|
+
this.$nextTick(() => {
|
|
119
|
+
this.$emit("contentLoaded");
|
|
120
|
+
|
|
121
|
+
// 统一DOM处理
|
|
122
|
+
this.doDOM();
|
|
123
|
+
this.$emit("contentRendered");
|
|
124
|
+
|
|
125
|
+
// 目录处理
|
|
126
|
+
this.doDir();
|
|
127
|
+
});
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
watch: {
|
|
131
|
+
content : {
|
|
132
|
+
immediate : true,
|
|
133
|
+
handler : function (val){
|
|
134
|
+
this.origin = val
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
mounted: function() {
|
|
139
|
+
},
|
|
140
|
+
components: {
|
|
141
|
+
"jx3-item": Item,
|
|
142
|
+
"jx3-buff": Buff,
|
|
143
|
+
"jx3-skill": Skill,
|
|
144
|
+
markdownRender,
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
</script>
|
|
148
|
+
|
|
149
|
+
<style lang="less">
|
|
150
|
+
@import "../assets/css/article_markdown.less";
|
|
151
|
+
</style>
|
package/src/Markdown.vue
CHANGED
|
@@ -10,12 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
<slot></slot>
|
|
12
12
|
|
|
13
|
-
<
|
|
13
|
+
<markdown-editor class="c-markdown" ref="md" v-model="data" @change="updateData" :subfield="false">
|
|
14
14
|
<template slot="left-toolbar-after">
|
|
15
15
|
<span class="c-markdown-toolbar-image c-markdown-toolbar-item" title="上传图片" @click="selectImages"><i class="el-icon-picture-outline-round"></i></span>
|
|
16
16
|
<span class="c-markdown-toolbar-file c-markdown-toolbar-item" title="上传附件" @click="selectFiles"><i class="el-icon-paperclip"></i></span>
|
|
17
|
+
<!-- <macro @insert="insertMacro" /> -->
|
|
18
|
+
<!-- <pz @insert="insertPz" /> -->
|
|
17
19
|
</template>
|
|
18
|
-
</
|
|
20
|
+
</markdown-editor>
|
|
19
21
|
<input class="c-markdown-store-item" id="c-markdown-store-images" type="file" @change="uploadImages" ref="markdownImages" multiple :accept="allow_image_types" />
|
|
20
22
|
<input class="c-markdown-store-item" id="c-markdown-store-files" type="file" @change="uploadFiles" ref="markdownFiles" multiple />
|
|
21
23
|
|
|
@@ -24,9 +26,19 @@
|
|
|
24
26
|
</template>
|
|
25
27
|
|
|
26
28
|
<script>
|
|
29
|
+
import markdownEditor from '@jx3box/markdown/src/editor.vue'
|
|
30
|
+
|
|
31
|
+
import {xssOptions} from '../assets/data/markdown_whitelist.json'
|
|
32
|
+
import { uploadFile } from "../service/cms";
|
|
33
|
+
|
|
27
34
|
import Upload from "./Upload";
|
|
28
35
|
import Resource from "./Resource";
|
|
29
|
-
|
|
36
|
+
|
|
37
|
+
// jx3
|
|
38
|
+
// import macro from './components/markdown/macro.vue'
|
|
39
|
+
// import pz from './components/markdown/pz.vue'
|
|
40
|
+
|
|
41
|
+
|
|
30
42
|
export default {
|
|
31
43
|
name: "Markdown",
|
|
32
44
|
props: {
|
|
@@ -51,8 +63,12 @@ export default {
|
|
|
51
63
|
}
|
|
52
64
|
},
|
|
53
65
|
components: {
|
|
66
|
+
markdownEditor,
|
|
54
67
|
Upload,
|
|
55
68
|
Resource,
|
|
69
|
+
|
|
70
|
+
// macro,
|
|
71
|
+
// pz,
|
|
56
72
|
},
|
|
57
73
|
data: function() {
|
|
58
74
|
return {
|
|
@@ -62,6 +78,8 @@ export default {
|
|
|
62
78
|
image_ext: ["png", "jpg", "gif", "bmp", "webp"],
|
|
63
79
|
files: [],
|
|
64
80
|
resolved_files: [],
|
|
81
|
+
|
|
82
|
+
xssOptions
|
|
65
83
|
};
|
|
66
84
|
},
|
|
67
85
|
model: {
|
|
@@ -192,6 +210,20 @@ export default {
|
|
|
192
210
|
// TODO:
|
|
193
211
|
// tinyMCE.editors["tinymce"].insertContent(data);
|
|
194
212
|
},
|
|
213
|
+
insertMacro(data) {
|
|
214
|
+
this.$md.insertText(this.$md.getTextareaDom(), {
|
|
215
|
+
prefix: data,
|
|
216
|
+
subfix: "",
|
|
217
|
+
str: "",
|
|
218
|
+
});
|
|
219
|
+
},
|
|
220
|
+
insertPz(data) {
|
|
221
|
+
this.$md.insertText(this.$md.getTextareaDom(), {
|
|
222
|
+
prefix: data,
|
|
223
|
+
subfix: "",
|
|
224
|
+
str: "",
|
|
225
|
+
});
|
|
226
|
+
}
|
|
195
227
|
},
|
|
196
228
|
filters: {},
|
|
197
229
|
created: function() {},
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="c-editor-markdown-dialog c-editor-markdown-macro">
|
|
3
|
+
<span class="c-markdown-toolbar-file c-markdown-toolbar-item" @click="handleClick" title="插入宏">宏</span>
|
|
4
|
+
|
|
5
|
+
<el-dialog :visible.sync="visible" title="插入宏" :modal-append-to-body="false">
|
|
6
|
+
<el-input class="u-input u-input-macro" type="textarea" :rows="15" v-model="macro" show-word-limit :maxlength="128"></el-input>
|
|
7
|
+
|
|
8
|
+
<div slot="footer">
|
|
9
|
+
<el-button @click="cancel">取消</el-button>
|
|
10
|
+
<el-button type="primary" @click="insert">插入</el-button>
|
|
11
|
+
</div>
|
|
12
|
+
</el-dialog>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
export default {
|
|
18
|
+
name: 'markdown_marco',
|
|
19
|
+
data() {
|
|
20
|
+
return {
|
|
21
|
+
visible: false,
|
|
22
|
+
macro: ''
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
methods: {
|
|
26
|
+
handleClick() {
|
|
27
|
+
this.visible = true
|
|
28
|
+
},
|
|
29
|
+
cancel() {
|
|
30
|
+
this.visible = false
|
|
31
|
+
this.macro = ''
|
|
32
|
+
},
|
|
33
|
+
insert() {
|
|
34
|
+
const content = `<pre class="e-jx3macro-area w-jx3macro">${this.macro}</pre>`
|
|
35
|
+
|
|
36
|
+
this.$emit('insert', content)
|
|
37
|
+
|
|
38
|
+
this.visible = false
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<style lang="less">
|
|
45
|
+
@import '../../../assets/css/markdown/common.less';
|
|
46
|
+
</style>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="m-macro-dialog m-pz-dialog">
|
|
3
|
+
<span class="c-markdown-toolbar-file c-markdown-toolbar-item" @click="handleClick" title="插入配装方案">装</span>
|
|
4
|
+
|
|
5
|
+
<el-dialog :visible.sync="visible" title="配装方案" :modal-append-to-body="false">
|
|
6
|
+
|
|
7
|
+
<p>👘 请填入魔盒配装方案的<a target="_blank" href="/tool/32032">【嵌入版】</a>编码</p>
|
|
8
|
+
|
|
9
|
+
<el-input class="m-macro-input" type="textarea" :rows="4" v-model="pzCode"></el-input>
|
|
10
|
+
|
|
11
|
+
<div slot="footer">
|
|
12
|
+
<el-button @click="cancel">取消</el-button>
|
|
13
|
+
<el-button type="primary" @click="insert">插入</el-button>
|
|
14
|
+
</div>
|
|
15
|
+
</el-dialog>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
export default {
|
|
21
|
+
name: 'markdown_marco',
|
|
22
|
+
data() {
|
|
23
|
+
return {
|
|
24
|
+
visible: false,
|
|
25
|
+
pzCode: ''
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
methods: {
|
|
29
|
+
handleClick() {
|
|
30
|
+
this.visible = true
|
|
31
|
+
},
|
|
32
|
+
cancel() {
|
|
33
|
+
this.visible = false
|
|
34
|
+
this.pzCode = ''
|
|
35
|
+
},
|
|
36
|
+
insert() {
|
|
37
|
+
const content = `${this.pzCode}`
|
|
38
|
+
|
|
39
|
+
this.$emit('insert', content)
|
|
40
|
+
|
|
41
|
+
this.visible = false
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<style lang="less">
|
|
48
|
+
@import '../../../assets/css/markdown/common.less';
|
|
49
|
+
</style>
|
package/vue.config.js
CHANGED
|
@@ -24,6 +24,12 @@ module.exports = {
|
|
|
24
24
|
template : 'public/article.html',
|
|
25
25
|
filename:'markdown/index.html',
|
|
26
26
|
},
|
|
27
|
+
article_markdown : {
|
|
28
|
+
title : 'Markdown文章内容渲染',
|
|
29
|
+
entry:'demo/MarkdownArticleDemo.js',
|
|
30
|
+
template : 'public/article.html',
|
|
31
|
+
filename:'article_markdown/index.html',
|
|
32
|
+
},
|
|
27
33
|
},
|
|
28
34
|
|
|
29
35
|
|
|
File without changes
|
|
File without changes
|