The 'icon' prop of q-advatar set 'none' is not work #17296
Labels
area/components
bug/1-repro-available
A reproduction is available and needs to be confirmed.
flavour/quasar-cli-vite
kind/bug 🐞
Qv2 🔝
Quasar v2 issues
What happened?
The component q-avatar has a prop 'icon', as the docs:
But in my test, the value of icon prop was set 'none'(String) is not work, the DOM was still rendered as an
<i>
tag:Instead of that, I set the icon prop as 'undefined'( javascript literal, not String, it is work!!!
CODE:
This code will render an
<i>
tag and an<img>
in the Avatar Div:<q-avatar :icon="userAvatar ? 'none' : 'add_a_photo'" cursor-pointer @click="changeAvatar" > <img v-if="userAvatar" :src="userAvatar" /> </q-avatar>
This code will render just an single
<img>
in the Avatar Div:<q-avatar :icon="userAvatar ? undefined : 'add_a_photo'" cursor-pointer @click="changeAvatar" > <img v-if="userAvatar" :src="userAvatar" /> </q-avatar>
What did you expect to happen?
In my opinion, the literal 'undefined' is not a common use, the String 'none' is better.
Reproduction URL
https://codepen.io/Summeryuan/pen/pomaZEV
How to reproduce?
Flavour
Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)
Areas
Components (quasar)
Platforms/Browsers
Microsoft Edge
Quasar info output
Relevant log output
Additional context
None
The text was updated successfully, but these errors were encountered: