Open abhishekgahlot opened 5 years ago
If you use Vue.use(Cryptoicon, { size: '50', color: 'black', generic: true });
it will fallback to the generic in case of icon is missing. Also for a single icon, you can pass generic prop <cryptoicon symbol="btc" size="24" generic />
. It isn't enabled by default so that someone can know which icon is available.
Sure, Yeah that's what I saw. I have to disagree and would consider enabling it by default so that if someone is building an app he doesn't have to handle lots of image loading error.
Okay, I'll consider this and make the generic icon fallback true by default. although it will still show the error in the console.
Thanks @man15h, I pushed the code long back for generic icon here though: https://github.com/abhishekgahlot/vue-cryptoicon/commit/b66875f4dd9f5a23f649b368adab0080935c55c2
Also, one more thing I see after installing this package the folder size is really really huge. I think we should decrease the size it looks really big to me.
Generally, its a good idea if a symbol isn't present to return a generic icon. I do see you have written a code for this here:
CryptoIcon.vue
I think when someone is iterating over lots of symbols and if the symbol isn't found in this library it should return generic but as of now, I get an error in console.
Maybe we should remove that else part and return generic, If you agree I can raise a PR for that.