Compare commits

..

No commits in common. "nostro" and "master" have entirely different histories.

7 changed files with 4308 additions and 27805 deletions

View File

@ -9,7 +9,7 @@
"chrome": "67", "chrome": "67",
"safari": "11.1" "safari": "11.1"
}, },
"corejs": "2.0", "corejs": 2,
"useBuiltIns": "usage" // @babel/polyfill 配置usage 按需加载 ECMAscript 规范库 "useBuiltIns": "usage" // @babel/polyfill 配置usage 按需加载 ECMAscript 规范库
} }
] ]

21990
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -18,7 +18,6 @@
"author": "Wayne (371377785@qq.com)", "author": "Wayne (371377785@qq.com)",
"repository": "https://github.com/DingRui12138/vue-pdf-viewer", "repository": "https://github.com/DingRui12138/vue-pdf-viewer",
"scripts": { "scripts": {
"prepare": "webpack build",
"test": "webpack -v", "test": "webpack -v",
"build": "webpack build --progress", "build": "webpack build --progress",
"serve": "webpack serve --config webpack.dev.config.js --hot", "serve": "webpack serve --config webpack.dev.config.js --hot",
@ -26,8 +25,7 @@
"lint:fix": "eslint src/** --fix" "lint:fix": "eslint src/** --fix"
}, },
"dependencies": { "dependencies": {
"pdfjs-dist": "2.12.313", "pdfjs-dist": "2.12.313"
"sass": "^1.89.2"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.14.2", "@babel/core": "^7.14.2",
@ -44,13 +42,16 @@
"eslint-plugin-vue": "^7.10.0", "eslint-plugin-vue": "^7.10.0",
"file-loader": "^6.2.0", "file-loader": "^6.2.0",
"html-webpack-plugin": "^5.3.2", "html-webpack-plugin": "^5.3.2",
"node-sass": "^6.0.1",
"prettier": "^2.3.0", "prettier": "^2.3.0",
"sass-loader": "^16.0", "sass-loader": "^12.3.0",
"strip-ansi": "^7.0.1", "strip-ansi": "^7.0.1",
"style-loader": "^3.3.1", "style-loader": "^3.3.1",
"uglifyjs-webpack-plugin": "^2.2.0",
"url-loader": "^4.1.1", "url-loader": "^4.1.1",
"vue": "^2.6.12", "vue": "^2.6.12",
"vue-loader": "^15.9.7", "vue-loader": "^15.9.7",
"vue-loader-next": "npm:vue-loader@^16.2.0",
"vue-style-loader": "^4.1.3", "vue-style-loader": "^4.1.3",
"vue-template-compiler": "^2.6.14", "vue-template-compiler": "^2.6.14",
"webpack": "5", "webpack": "5",

View File

@ -94,5 +94,5 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@use './RotateWrapper.scss'; @import './RotateWrapper.scss';
</style> </style>

View File

@ -209,10 +209,8 @@ export default {
this.$refs.iframe.appendStyle(this.$options.rotateWrapperStyle) this.$refs.iframe.appendStyle(this.$options.rotateWrapperStyle)
// TODO: element resize replace window resize with Observe // TODO: element resize replace window resize with Observe
this.handleResize = throttle(() => { this.handleResize = throttle(() => {
try{
this.viewportHeight = this.$refs.container.clientHeight this.viewportHeight = this.$refs.container.clientHeight
this.viewportWidth = this.$refs.viewerScroller.clientWidth this.viewportWidth = this.$refs.viewerScroller.clientWidth
}catch(e){}
}, 100) }, 100)
window.addEventListener('resize', this.handleResize) window.addEventListener('resize', this.handleResize)

View File

@ -1,8 +1,8 @@
/* eslint-disable no-undef */ /* eslint-disable no-undef */
// const UglifyJsPlugin = require('uglifyjs-webpack-plugin') const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const { VueLoaderPlugin: Vue2LoaderPlugin } = require('vue-loader') const { VueLoaderPlugin: Vue2LoaderPlugin } = require('vue-loader')
// const { VueLoaderPlugin: Vue3LoaderPlugin } = require('vue-loader-next') const { VueLoaderPlugin: Vue3LoaderPlugin } = require('vue-loader-next')
const baseConfig = { const baseConfig = {
mode: 'production', mode: 'production',
@ -24,7 +24,6 @@ const baseConfig = {
chrome: '67', chrome: '67',
safari: '11.1', safari: '11.1',
}, },
corejs: '2.0',
useBuiltIns: 'usage', useBuiltIns: 'usage',
}, },
], ],
@ -71,11 +70,11 @@ const baseConfig = {
], ],
}, },
optimization: { optimization: {
// minimizer: [ minimizer: [
// new UglifyJsPlugin({ new UglifyJsPlugin({
// parallel: true, parallel: true,
// }), }),
// ], ],
}, },
externals: { externals: {
vue: 'vue', vue: 'vue',
@ -97,15 +96,15 @@ module.exports = [
}, },
plugins: [new Vue2LoaderPlugin()], plugins: [new Vue2LoaderPlugin()],
}, },
// { {
// ...baseConfig, ...baseConfig,
// output: { output: {
// filename: 'vue3-pdf-viewer.js', filename: 'vue3-pdf-viewer.js',
// library: { library: {
// name: 'pdf-viewer-vue', name: 'pdf-viewer-vue',
// type: 'umd', type: 'umd',
// }, },
// }, },
// plugins: [new Vue3LoaderPlugin()], plugins: [new Vue3LoaderPlugin()],
// }, },
] ]

10071
yarn.lock

File diff suppressed because it is too large Load Diff