Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ You can create a poll by using the [QRCode component](#QRCode).
```xml
<QRCode
value="https://github.com/k2tzumi/slidev-addon-qrcode"
width="180"
height="180"
:width="180"
:height="180"
color="4329B9"
image="83095831.png"
/>
Expand Down
22 changes: 14 additions & 8 deletions components/QRCode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@ import { watch, computed, onMounted, ref } from 'vue';

const qrCodeRef: any = ref(null);

const props = defineProps({
value: String,
color: String,
width: String,
height: String,
image: String,
export interface Props {
value: string,
color: string,
width: number,
height: number,
image: string,
}

const props = withDefaults(defineProps<Props>(), {
width: 200,
height: 200,
color: "000000",
});

const offsetColor = computed<string>(() => {
Expand Down Expand Up @@ -83,9 +89,9 @@ onMounted(async () => {
});

watch(
() => props.data,
() => props.value,
(newValue) => {
qrCode.update({ ...options, value: newValue });
qrCode.update({ ...options, data: newValue });
},
);

Expand Down
Binary file modified example-export/001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion example.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ layout: cover

# Example slides

<QRCode width="180" height="180" value="https://github.com/k2tzumi/slidev-addon-qrcode" color="4329B9" image="83095831.png" />
<QRCode :width=180 :height=180 value="https://github.com/k2tzumi/slidev-addon-qrcode" color="4329B9" image="83095831.png" />