Skip to content

Commit 9eff6eb

Browse files
committed
fix: ERR when get dirname on Windows.
Upgrade some deps.
1 parent d4164f0 commit 9eff6eb

File tree

8 files changed

+199
-210
lines changed

8 files changed

+199
-210
lines changed

README-zh_cn.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
🔒 如果你正在使用 Vue 2,请保持 `qrcode.vue` 的版本为 `1.x`;
66

7-
一款 Vue.js 二维码组件.
7+
一款 Vue.js 二维码组件,同时支持 Vue 2 和 Vue 3.
88

99
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/scopewu/qrcode.vue/blob/master/LICENSE)
1010

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
🔒 if you are using Vue 2.x, please keep using version `1.x`;
66

7-
A Vue.js component to generate [QRCode](https://en.wikipedia.org/wiki/QR_code).
7+
A Vue.js component to generate [QRCode](https://en.wikipedia.org/wiki/QR_code). Both support Vue 2 and Vue 3.
88

99
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/scopewu/qrcode.vue/blob/master/LICENSE)
1010

example/webpack-entry.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import { createApp, defineComponent, onMounted, ref } from 'vue'
22
import QrcodeVue from '../src'
3+
import type { Level, RenderAs } from '../src'
34

45
const App = defineComponent({
56
components: { QrcodeVue },
67
setup() {
78
const value = ref('https://example.com')
89
const size = ref(100)
9-
const level = ref<'L' | 'M' | 'Q' | 'H'>('L')
10+
const level = ref<Level>('L')
1011
const background = ref('#ffffff')
1112
const foreground = ref('#000000')
12-
const renderAs = ref<'canvas' | 'svg'>('svg')
13+
const renderAs = ref<RenderAs>('svg')
1314
const margin = ref(0)
1415

1516
const stargazersCount = ref(500)

example/webpack.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
<meta name="twitter:creator" content="@ngwwj" />
3232
<link
3333
rel="stylesheet"
34-
href="https://unpkg.com/bootstrap@5.1.3/dist/css/bootstrap.min.css"
35-
integrity="sha512-GQGU0fMMi238uA+a/bdWJfpUGKUkBdgfFdgBm72SUQ6BeyWjoY/ton0tEjH+OSH9iP4Dfh+7HM0I9f5eR0L/4w=="
34+
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css"
35+
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN"
3636
crossorigin="anonymous"
3737
referrerpolicy="no-referrer"
3838
/>

package.json

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "qrcode.vue",
33
"version": "3.4.1",
4-
"description": "A Vue.js component to generate QRCode.",
4+
"description": "A Vue.js component to generate QRCode. Both support Vue 2 and Vue 3",
55
"type": "module",
66
"main": "./dist/qrcode.vue.cjs.js",
77
"module": "./dist/qrcode.vue.esm.js",
@@ -51,15 +51,14 @@
5151
"dependencies": {},
5252
"devDependencies": {
5353
"@rollup/plugin-terser": "^0.4.4",
54-
"@vue/compiler-sfc": "^3.3.7",
55-
"@vue/server-renderer": "^3.3.7",
56-
"html-webpack-plugin": "^5.5.3",
57-
"rollup": "^4.3.0",
54+
"@vue/compiler-sfc": "^3.3.11",
55+
"@vue/server-renderer": "^3.3.11",
56+
"html-webpack-plugin": "^5.5.4",
57+
"rollup": "^4.8.0",
5858
"rollup-plugin-typescript2": "^0.36.0",
59-
"ts-loader": "^9.5.0",
60-
"typescript": "^5.2.2",
61-
"vue": "^3.3.7",
62-
"vue-loader": "^17.3.1",
59+
"ts-loader": "^9.5.1",
60+
"typescript": "^5.3.3",
61+
"vue": "^3.3.11",
6362
"webpack": "^5.89.0",
6463
"webpack-cli": "^5.1.4",
6564
"webpack-dev-server": "^4.15.1"

typings/index.d.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
declare module 'qr.js/lib/QRCode.js'
2-
declare module 'qr.js/lib/ErrorCorrectLevel.js'
31

42
// shims-vue.d.ts
53
declare module '*.vue' {

webpack.config.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import path from 'path'
2+
import { fileURLToPath } from 'url'
23
import HtmlWebpackPlugin from 'html-webpack-plugin'
3-
import { VueLoaderPlugin } from 'vue-loader'
44

5-
const dirname = new URL('.', import.meta.url).pathname
5+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
66

77
const config = (env, { mode = 'production' }) => {
88
const isProd = mode === 'production'
@@ -14,7 +14,7 @@ const config = (env, { mode = 'production' }) => {
1414
main: './example/webpack-entry.ts',
1515
},
1616
output: {
17-
path: path.resolve(dirname, './example/dist'),
17+
path: path.resolve(__dirname, './example/dist'),
1818
filename: isProd ? '[name].[contenthash].js' : '[name].js',
1919
},
2020
resolve: {
@@ -46,7 +46,6 @@ const config = (env, { mode = 'production' }) => {
4646
],
4747
},
4848
plugins: [
49-
new VueLoaderPlugin(),
5049
new HtmlWebpackPlugin({
5150
template: 'example/webpack.html',
5251
minify: {

0 commit comments

Comments
 (0)