主题包升级webpack4

This commit is contained in:
结发受长生
2019-04-30 12:24:31 +08:00
parent 8d764b4dba
commit e1c0029234
15 changed files with 5126 additions and 2140 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
// 样式
import '../css/main.scss'
// 图片查看器
import Viewer from './viewer'
// 图片查看器 -> 改为单独分块打包
// import Viewer from './viewer'
// 分享
import Share from './share'
// 边缘
@@ -11,6 +11,6 @@ import Util from './util'
Util.addLoadEvent(function() {
Share.init()
Viewer.init()
// Viewer.init()
Aside.init()
})
+6 -2
View File
@@ -3,6 +3,8 @@ import PhotoSwipeUI_Default from '../lib/photoswipe/photoswipe-ui-default'
import '../lib/photoswipe/photoswipe.css'
import '../lib/photoswipe/default-skin/default-skin.css'
import Util from './util'
function init() {
let pswpElement = document.querySelectorAll('.pswp')[0];
let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))
@@ -12,7 +14,6 @@ function init() {
if (document.querySelector('.left-col.show')) return
let items = []
Array.prototype.forEach.call($imgArr, ($em2, i2) => {
let img = $em2.getAttribute('data-idx', i2)
let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
let title = $em2.getAttribute('alt')
// 获得原图尺寸
@@ -34,4 +35,7 @@ function init() {
})
}
export default { init }
// export default { init }
Util.addLoadEvent(function() {
init()
})