Compare commits

...

3 Commits

Author SHA1 Message Date
Pietro Brenna 80b0c8a9de come mai this.$refs.container non esiste? 2025-06-24 14:02:15 +02:00
Pietro Brenna 2947ae8440 fix warning build 2025-06-24 14:02:01 +02:00
Pietro Brenna 034a1b1a86 fix build 2025-06-19 16:55:45 +02:00
7 changed files with 27803 additions and 4306 deletions

View File

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

21990
package-lock.json generated 100644

File diff suppressed because it is too large Load Diff

View File

@ -18,6 +18,7 @@
"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",
@ -25,7 +26,8 @@
"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",
@ -42,16 +44,13 @@
"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": "^12.3.0", "sass-loader": "^16.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>
@import './RotateWrapper.scss'; @use './RotateWrapper.scss';
</style> </style>

View File

@ -209,8 +209,10 @@ 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,6 +24,7 @@ const baseConfig = {
chrome: '67', chrome: '67',
safari: '11.1', safari: '11.1',
}, },
corejs: '2.0',
useBuiltIns: 'usage', useBuiltIns: 'usage',
}, },
], ],
@ -70,11 +71,11 @@ const baseConfig = {
], ],
}, },
optimization: { optimization: {
minimizer: [ // minimizer: [
new UglifyJsPlugin({ // new UglifyJsPlugin({
parallel: true, // parallel: true,
}), // }),
], // ],
}, },
externals: { externals: {
vue: 'vue', vue: 'vue',
@ -96,15 +97,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()],
}, // },
] ]

10067
yarn.lock

File diff suppressed because it is too large Load Diff