Comments (4)
我的代码
<script setup lang="ts">
import OpencvQr from "opencv-qr";
import { onMounted } from 'vue'
// // 加载模型文件,模型文件请自行保存在静态目录
// let cvQr = new OpencvQr({
// dw: "http://localhost:5173/opencv-qr/models/detect.caffemodel",
// sw: "http://localhost:5173//opencv-qr/models/sr.caffemodel",
// });
onMounted(() => {
console.log(`the component is now mounted.`)
let cvQr = new OpencvQr({
dw: "https://leidenglai.github.io/opencv-js-qrcode/models/detect.caffemodel",
sw: "https://leidenglai.github.io/opencv-js-qrcode/models/sr.caffemodel",
});
console.log(0)
})
</script>
我收到的错误
[Vue Router warn]: Unexpected error when starting the router: ReferenceError: Module is not defined
at Object.<anonymous> (opencv-qr.js?v=7dc591e2:3109:71)
at 424 (opencv-qr.js?v=7dc591e2:3111:12)
at g (opencv-qr.js?v=7dc591e2:3118:22)
at opencv-qr.js?v=7dc591e2:3153:20
at opencv-qr.js?v=7dc591e2:3238:9
at opencv-qr.js?v=7dc591e2:3239:7
at opencv-qr.js?v=7dc591e2:9:82
at node_modules/opencv-qr/dist/OpencvQr.js (opencv-qr.js?v=7dc591e2:10:6)
at __require (chunk-Y2F7D3TJ.js?v=7dc591e2:3:50)
at opencv-qr.js?v=7dc591e2:3242:16
告诉我Module 没有定义但是我并不知道为什么没定义
from opencv-js-qrcode.
因为只打包了umd模式,vite需要转换一下
from opencv-js-qrcode.
好的 谢谢 我明天研究研究看看
from opencv-js-qrcode.
v0.6.0 已解决vite加载问题
from opencv-js-qrcode.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opencv-js-qrcode.