feat(widgets/public-ip): add hideDetails option (default false)

- Add hideDetails computed property to conditionally hide geographical info
- When hideDetails=true, only display IP address
- Hide country flag, ISP name, city/region, and map link when enabled
- Maintain full backward compatibility (default: false)
- Add null-safe rendering with v-if guards for all geo fields
This commit is contained in:
Zhaoxuan Chen 2025-09-30 22:24:04 +08:00
parent 295977b389
commit 8890168e9a

View file

@ -41,7 +41,7 @@ export default {
return this.parseAsEnvVar(this.options.provider) || 'ipapi.co';
},
hideDetails() {
// Hide geographical details when hideDetails option is true
// Hide geographical details when hideDetails option is true (default: false)
return this.options.hideDetails === true;
},
},