@jx3box/jx3box-editor 1.0.4 → 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.
@@ -10,7 +10,7 @@ const count = {
10
10
  const MAX_DEPTH = 3;
11
11
  const PREFIX_CLS = "lv"; //class前缀
12
12
 
13
- function directory(from, to) {
13
+ function directory(from, to = '#directory') {
14
14
  // 装载容器设置
15
15
  const $box = $(to);
16
16
  if (!to && $box.length) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-editor",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "JX3BOX Article & Editor",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -36,7 +36,7 @@
36
36
  "@jx3box/jx3box-emotion": "^1.0.10",
37
37
  "@jx3box/jx3box-macro": "^1.0.1",
38
38
  "@jx3box/jx3box-talent": "^1.1.2",
39
- "@jx3box/markdown": "^0.1.3",
39
+ "@jx3box/markdown": "^0.1.4",
40
40
  "@tinymce/tinymce-vue": "^3.2.2",
41
41
  "axios": "^0.19.2",
42
42
  "core-js": "^3.6.5",
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="c-article-markdown">
3
- <markdown-render class="c-markdown" ref="article" v-model="origin" @change="updateOrigin"></markdown-render>
3
+ <markdown-render id="c-article" class="c-markdown" ref="article" v-model="origin" @change="updateOrigin" :preRender="doReg"></markdown-render>
4
4
  <div class="w-jx3-element-pop" :style="jx3_element.style">
5
5
  <jx3-item :item_id="item.id" :jx3ClientType="item.client" v-show="jx3_element.type == 'item'" />
6
6
  <jx3-buff :client="buff.client" :id="buff.id" :level="buff.level" v-show="jx3_element.type == 'buff'" />
@@ -44,10 +44,8 @@ export default {
44
44
  return {
45
45
  // 原始md
46
46
  origin : '',
47
- // 原始渲染md后的html
47
+ // 原始渲染md后的html(传入文本回调处理函数)
48
48
  html: "",
49
- // 文本处理后的html
50
- data: "",
51
49
 
52
50
  // 物品
53
51
  item: {
@@ -107,14 +105,7 @@ export default {
107
105
  renderJx3Element(this);
108
106
  },
109
107
  doDir: function() {
110
- // 显示局部
111
- let target = "";
112
- if (this.hasPages && !this.all) {
113
- target = "#c-article-part" + this.page;
114
- // 全部
115
- } else {
116
- target = "#c-article";
117
- }
108
+ let target = "#c-article";
118
109
  let dir = renderDirectory(target, this.directorybox);
119
110
  if (dir) this.$emit("directoryRendered");
120
111
  },
@@ -123,12 +114,6 @@ export default {
123
114
  this.render()
124
115
  },
125
116
  render: function() {
126
- let result = this.doReg(this.html);
127
- this.data = result;
128
-
129
- // TODO: 过滤未展示
130
- this.$forceUpdate()
131
-
132
117
  // 等待html加载完毕后
133
118
  this.$nextTick(() => {
134
119
  this.$emit("contentLoaded");