demo test
swana1337 opened this issue · comments
swana1337 commented
HJ commented
this file isnt necessary to use this package, just revert this file back what it is before, if u dont hv this file originally, remove this file.
swana1337 commented
swana1337 commented
if i got the other file it works
HJ commented
i initialize a vue project with vue cli
shims-vue.d.ts orginally has these code.
Try copy these to shims-vue.d.ts?
/* eslint-disable */
declare module '*.vue' {
import type { DefineComponent } from 'vue'
const component: DefineComponent<{}, {}, any>
export default component
}
swana1337 commented
now it compiles at least, but it still doesn't work to run. Nevertheless, thank you for the help :)
HJ commented
I don't know why it doesn't work in your project.
I just create a new vue project and try to install this package
What i did,
- vue create testproject, cd ./testproject
- yarn add vue3-qr-reader
- modify App.vue
<template>
<qr-stream></qr-stream>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { QrStream } from 'vue3-qr-reader';
export default defineComponent({
name: 'App',
components: {
QrStream
}
});
</script>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
- modify shims-vue.d.ts file
/* eslint-disable */
declare module '*.vue' {
import type { DefineComponent } from 'vue'
const component: DefineComponent<{}, {}, any>
export default component
}
declare module 'vue3-qr-reader' {
export {
QrStream
}
}
- yarn serve, and it works
Looks like you gave up using this package, I will close this issue.
Open issue again if you have other question, thanks.