vue-qrcode
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -7,6 +7,6 @@ import type { QRCodeErrorCorrectionLevel, QRCodeMaskPattern, QRCodeSegment, QRCodeToDataURLOptions, QRCodeToDataURLOptionsJpegWebp, QRCodeToSJISFunc } from 'qrcode'; | ||
export { QRCodeSegment } from 'qrcode'; | ||
export declare type QRCodeValue = QRCodeSegment[] | string; | ||
export type QRCodeValue = QRCodeSegment[] | string; | ||
export declare const TYPES: readonly ["image/png", "image/jpeg", "image/webp"]; | ||
export declare type QRCodeProps = Omit<QRCodeToDataURLOptions, 'renderOptions'> & QRCodeToDataURLOptionsJpegWebp['rendererOpts'] & { | ||
value: QRCodeSegment[] | string; | ||
export type QRCodeProps = Omit<QRCodeToDataURLOptions, 'renderOptions'> & QRCodeToDataURLOptionsJpegWebp['rendererOpts'] & { | ||
value: QRCodeValue; | ||
}; | ||
@@ -46,9 +46,9 @@ declare const _default: import("vue").DefineComponent<{ | ||
value: { | ||
type: PropType<string | QRCodeSegment[]>; | ||
type: PropType<QRCodeValue>; | ||
required: true; | ||
validator(value: QRCodeSegment[] | string): boolean; | ||
validator(value: QRCodeValue): boolean; | ||
}; | ||
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, { | ||
[key: string]: any; | ||
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{ | ||
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{ | ||
version: { | ||
@@ -86,7 +86,7 @@ type: NumberConstructor; | ||
value: { | ||
type: PropType<string | QRCodeSegment[]>; | ||
type: PropType<QRCodeValue>; | ||
required: true; | ||
validator(value: QRCodeSegment[] | string): boolean; | ||
validator(value: QRCodeValue): boolean; | ||
}; | ||
}>>, {}>; | ||
}>>, {}, {}>; | ||
export default _default; |
@@ -1,2 +0,1 @@ | ||
import { __rest } from "tslib"; | ||
import QRCode from 'qrcode'; | ||
@@ -64,2 +63,3 @@ import { defineComponent, h, ref, watch } from 'vue'; | ||
'mode' in it && | ||
it.mode && | ||
MODES.includes(it.mode)); | ||
@@ -72,3 +72,3 @@ }, | ||
const toDataURL = () => { | ||
const { quality, value } = props, rest = __rest(props, ["quality", "value"]); | ||
const { quality, value, ...rest } = props; | ||
QRCode.toDataURL(value, Object.assign(rest, quality == null || { renderOptions: { quality } })) | ||
@@ -82,5 +82,8 @@ .then(dataUrl => { | ||
watch(props, toDataURL, { immediate: true }); | ||
return () => h('img', Object.assign(Object.assign({}, attrs), { src: dataUrlRef.value })); | ||
return () => h('img', { | ||
...attrs, | ||
src: dataUrlRef.value, | ||
}); | ||
}, | ||
}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "vue-qrcode", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"type": "module", | ||
@@ -14,5 +14,9 @@ "description": "🤳 A Vue component for QR code generation with `qrcode`", | ||
"exports": { | ||
"types": "./lib/index.d.ts", | ||
"import": "./lib/index.js", | ||
"require": "./lib/index.cjs" | ||
".": { | ||
"types": "./lib/index.d.ts", | ||
"import": "./lib/index.esm.mjs", | ||
"require": "./lib/index.cjs", | ||
"default": "./lib/index.js" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
@@ -30,7 +34,7 @@ "types": "./lib/index.d.ts", | ||
"peerDependencies": { | ||
"qrcode": "^1.5.0", | ||
"qrcode": "^1.0.0", | ||
"vue": "^2.7.0 || ^3.0.0" | ||
}, | ||
"dependencies": { | ||
"tslib": "^2.4.0" | ||
"tslib": "^2.6.2" | ||
}, | ||
@@ -37,0 +41,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23052
7
413
Updatedtslib@^2.6.2