google-adsense
google-adsense copied to clipboard
refactor(props): remove unnecessary withDefaults()
Replaced withDefaults() in Adsbygoogle.vue with destructured default values for props to align with Vue's best practices and suppress compiler warnings.
๐ Linked issue
Resolves #207 also #205
โ Type of change
- [ ] ๐ Documentation (updates to the documentation or readme)
- [ ] ๐ Bug fix (a non-breaking change that fixes an issue)
- [ ] ๐ Enhancement (improving an existing functionality)
- [ ] โจ New feature (a non-breaking change that adds functionality)
- [x] ๐งน Chore (updates to the build process or auxiliary tools and libraries)
- [ ] โ ๏ธ Breaking change (fix or feature that would cause existing functionality to change)
๐ Description
This pull request replaces the use of withDefaults()
in Adsbygoogle.vue
with destructured default values for props.
Why this change?
- Aligns with Vue 3's best practices for handling props.
- Resolves the compiler warning:
WARN [@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(...).
What problem does this solve?
It improves maintainability and readability of the code by eliminating unnecessary usage of withDefaults()
, ensuring adherence to modern Vue conventions.