Skip to content

Commit

Permalink
feat: add qr code component
Browse files Browse the repository at this point in the history
  • Loading branch information
openscript committed Jan 15, 2024
1 parent fcaf436 commit 3a67b52
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 43 deletions.
20 changes: 20 additions & 0 deletions components/QRCode.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<script setup lang="ts">
import VueQrcode from '@chenfengyuan/vue-qrcode'
defineProps({
value: {
required: true,
type: String
}
})
</script>

<style lang="scss">
svg path:nth-child(2) {
stroke: var(--slidev-theme-primary);
}
</style>

<template>
<vue-qrcode :value="value" tag="svg"></vue-qrcode>
</template>
9 changes: 9 additions & 0 deletions example.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ function updateUser(id: number, update: Partial<User>) {
saveUser(id, newUser)
}
```
---

# QR-Code

```html
<QRCode value="https://openscript.ch" style="width: 200px" />
```

<QRCode value="https://openscript.ch" style="width: 200px" />

---
layout: center
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"release:create-github-release": "conventional-github-releaser -p angular"
},
"dependencies": {
"@chenfengyuan/vue-qrcode": "^2.0.0",
"@fontsource/fira-code": "^5.0.16",
"@fontsource/pt-sans": "^5.0.8",
"@slidev/types": "^0.46.1",
Expand Down
Loading

0 comments on commit 3a67b52

Please sign in to comment.