@jx3box/jx3box-editor 1.8.0 → 1.8.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/Article.vue +20 -51
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-editor",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "description": "JX3BOX Article & Editor",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/Article.vue CHANGED
@@ -2,28 +2,10 @@
2
2
  <div class="c-article-tinymce c-article-box">
3
3
  <!-- <div id="c-article-origin" class="c-article-origin" ref="origin"><slot></slot></div> -->
4
4
  <div id="c-article" class="c-article" ref="article" v-if="pageable">
5
- <div
6
- class="c-article-chunk"
7
- v-for="(text, i) in data"
8
- :key="i"
9
- v-html="text"
10
- :class="{ on: i == page - 1 || all == true }"
11
- :id="'c-article-part' + ~~(i + 1)"
12
- ></div>
5
+ <div class="c-article-chunk" v-for="(text, i) in data" :key="i" v-html="text" :class="{ on: i == page - 1 || all == true }" :id="'c-article-part' + ~~(i + 1)"></div>
13
6
  </div>
14
- <div
15
- id="c-article"
16
- class="c-article"
17
- ref="article"
18
- v-else-if="data && data.length"
19
- v-html="data[0]"
20
- ></div>
21
- <el-button
22
- class="c-article-all"
23
- type="primary"
24
- v-if="!all && hasPages"
25
- @click="showAll"
26
- >加载全部</el-button>
7
+ <div id="c-article" class="c-article" ref="article" v-else-if="data && data.length" v-html="data[0]"></div>
8
+ <el-button class="c-article-all" type="primary" v-if="!all && hasPages" @click="showAll">加载全部</el-button>
27
9
  <el-pagination
28
10
  class="c-article-pages"
29
11
  v-if="!all"
@@ -36,23 +18,9 @@
36
18
  :total="total"
37
19
  ></el-pagination>
38
20
  <div class="w-jx3-element-pop" :style="jx3_element.style">
39
- <jx3-item
40
- :item_id="item.id"
41
- :jx3ClientType="item.client"
42
- v-show="jx3_element.type == 'item'"
43
- />
44
- <jx3-buff
45
- :client="buff.client"
46
- :id="buff.id"
47
- :level="buff.level"
48
- v-show="jx3_element.type == 'buff'"
49
- />
50
- <jx3-skill
51
- :client="skill.client"
52
- :id="skill.id"
53
- :level="skill.level"
54
- v-show="jx3_element.type == 'skill'"
55
- />
21
+ <jx3-item :item_id="item.id" :jx3ClientType="item.client" v-show="jx3_element.type == 'item'" />
22
+ <jx3-buff :client="buff.client" :id="buff.id" :level="buff.level" v-show="jx3_element.type == 'buff'" />
23
+ <jx3-skill :client="skill.client" :id="skill.id" :level="skill.level" v-show="jx3_element.type == 'skill'" />
56
24
  <jx3-npc :client="npc.client" :id="npc.id" v-show="jx3_element.type === 'npc'" />
57
25
  <jx3-author :uid="author.id" v-show="jx3_element.type === 'author'" />
58
26
  <jx3-emotion-author :id="emotion.id" v-show="jx3_element.type === 'emotion'" />
@@ -96,7 +64,7 @@ import renderTalent2 from "../assets/js/talent2";
96
64
  import renderKatex from "../assets/js/katex";
97
65
  import renderCode from "../assets/js/code";
98
66
  import renderImgPreview from "../assets/js/renderImgPreview";
99
- import renderPzIframe from '../assets/js/pz_iframe'
67
+ import renderPzIframe from "../assets/js/pz_iframe";
100
68
 
101
69
  // 剑三
102
70
  import Item from "./Item";
@@ -104,7 +72,7 @@ import Buff from "./Buff";
104
72
  import Skill from "./Skill";
105
73
  import Npc from "./Npc";
106
74
  import Author from "./components/Author";
107
- import PostAuthor from './components/PostAuthor.vue'
75
+ import PostAuthor from "./components/PostAuthor.vue";
108
76
  import renderJx3Element from "../assets/js/jx3_element";
109
77
 
110
78
  export default {
@@ -147,15 +115,15 @@ export default {
147
115
  level: "",
148
116
  },
149
117
  // NPC
150
- npc : {
151
- client : 'std',
152
- id : '',
118
+ npc: {
119
+ client: "std",
120
+ id: "",
153
121
  },
154
122
  author: {
155
- id: '',
123
+ id: "",
156
124
  },
157
125
  emotion: {
158
- id: ''
126
+ id: "",
159
127
  },
160
128
  // COMMON
161
129
  jx3_element: {
@@ -199,7 +167,7 @@ export default {
199
167
  // 折叠块
200
168
  renderFoldBlock($root);
201
169
  // 代码
202
- renderCode(`code[class=^'language-']`)
170
+ renderCode(`code[class=^'language-']`);
203
171
  // Tatex
204
172
  renderKatex();
205
173
 
@@ -226,14 +194,15 @@ export default {
226
194
  target = "#c-article";
227
195
  }
228
196
  let dir = renderDirectory(target, this.directorybox);
229
- this.$emit("directoryRendered",dir);
197
+ this.$emit("directoryRendered", dir);
230
198
 
231
- $('.w-directory-anchor').on('click', function(){
232
- let id = $(this).attr('id')
199
+ $(".w-directory-anchor").on("click", function () {
200
+ e.preventDefault();
201
+ let id = $(this).attr("id");
233
202
  let target = $(`#${id}`).offset().top;
234
203
  $(document).scrollTop(target - HEADER_HEIGHT);
235
204
  window.location.hash = `#${id}`;
236
- })
205
+ });
237
206
  },
238
207
  changePage: function (i) {
239
208
  this.page = i;
@@ -292,7 +261,7 @@ export default {
292
261
  "jx3-skill": Skill,
293
262
  "jx3-npc": Npc,
294
263
  "jx3-author": Author,
295
- 'jx3-emotion-author': PostAuthor,
264
+ "jx3-emotion-author": PostAuthor,
296
265
  // "gallery":gallery,
297
266
  // VueViewer
298
267
  },