@jx3box/jx3box-editor 1.4.12 → 1.5.0

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.
@@ -1,7 +1,11 @@
1
1
  import $ from 'jquery'
2
2
 
3
3
  function renderImgPreview(vm, selector='.c-article img'){
4
- $(selector).each((i, ele) => {
4
+ // 获取src不为空的图片
5
+ let imgs = $(selector).filter(function(){
6
+ return $(this).attr('src') != ''
7
+ })
8
+ imgs.each((i, ele) => {
5
9
  // 加载全部src(lazyload)
6
10
  vm.images.push($(ele).attr('src'))
7
11
  // 绑定事件挂钩索引位置
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-editor",
3
- "version": "1.4.12",
3
+ "version": "1.5.0",
4
4
  "description": "JX3BOX Article & Editor",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -13,6 +13,10 @@
13
13
  <script>
14
14
  import markdownRender from '@jx3box/markdown/src/render.vue'
15
15
 
16
+ import Vue from "vue";
17
+ import hevueImgPreview from "hevue-img-preview";
18
+ Vue.use(hevueImgPreview);
19
+
16
20
  // 基本文本
17
21
  import execLazyload from "../assets/js/img";
18
22
  import execFilterIframe from "../assets/js/iframe";
@@ -33,6 +37,7 @@ import Buff from "./Buff";
33
37
  import Skill from "./Skill";
34
38
  import Npc from "./Npc";
35
39
  import renderJx3Element from "../assets/js/jx3_element";
40
+ import renderImgPreview from "../assets/js/renderImgPreview";
36
41
 
37
42
  import {xssOptions} from '../assets/data/markdown_whitelist.json'
38
43
 
@@ -79,6 +84,7 @@ export default {
79
84
  },
80
85
  type: "",
81
86
  },
87
+ images: [],
82
88
 
83
89
  xssOptions
84
90
  };
@@ -106,6 +112,8 @@ export default {
106
112
  renderTalent2();
107
113
  // Tatex
108
114
  renderKatex();
115
+ // 画廊
116
+ renderImgPreview(this);
109
117
  // 语法高亮
110
118
  renderCode(`code[class=^'lang-']`)
111
119
  // 物品
@@ -156,4 +164,8 @@ export default {
156
164
 
157
165
  <style lang="less">
158
166
  @import "../assets/css/article_markdown.less";
167
+
168
+ .v-note-img-wrapper {
169
+ display: none;
170
+ }
159
171
  </style>