Vue Compiler Warnings #28
-
I wanted to reach out related to a warning that I receive in my terminal when I run [@vue/compiler-sfc] withDefaults() is unnecessary when using destructure with defineProps().
Reactive destructure will be disabled when using withDefaults().
Prefer using destructure default values, e.g. const { foo = 1 } = defineProps(...).
XXXXXX/node_modules/slidev-theme-academic/layouts/cover.vue
32 | coverAuthorUrl: coverAuthorUrlTransferred,
33 | coverBackgroundUrl,
34 | } = withDefaults(
| ^^^^^^^^^^^^
35 | defineProps<{
36 | coverAuthor?: string | string[]; I appreciate it if you could let me know if there is a way to fix the issue in the warning. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @kaanaksit, thanks for using the theme! It's just a warning but has already been fixed in version v2.0.0 and up. I assume that you're using an older version, so please upgrade if the warning bothers you. |
Beta Was this translation helpful? Give feedback.
Hi @kaanaksit, thanks for using the theme!
It's just a warning but has already been fixed in version v2.0.0 and up. I assume that you're using an older version, so please upgrade if the warning bothers you.