LucasLeandro1204 / vue-content-loading

Vue component to easily build (or use presets) SVG loading cards Facebook like.
https://lucasleandro1204.github.io/vue-content-loading/
MIT License
758 stars 75 forks source link

Added string value for prop validation #22

Closed amritk closed 5 years ago

amritk commented 5 years ago

Allow string values like '100%'

LucasLeandro1204 commented 5 years ago

Thank you @amritk I'll test it asap

amritk commented 5 years ago

Actually this shouldn't work, since width is actually setting the viewBox attribute. I thought it was setting the width attribute.

It does however work somehow, just has errors in the console:

consola.browser.js?e6e6:1 error [Vue warn]: Invalid prop: type check failed for prop "width". Expected Number with value NaN, got String with value "100%".

found in

---> <VueContentLoading>
       <VclFacebook>
         <VCard>
           <ExploreList> at src/components/explore-list.vue
             <MapList> at src/pages/explore/map-list.vue
               <Nuxt>
                 <VApp>
                   <Src/layouts/explore.vue> at src/layouts/explore.vue
                     <Root>
vue.runtime.esm.js?2b0e:6779 Error: <svg> attribute viewBox: Expected number, "0 0 100% 96".

https://stackoverflow.com/questions/50155878/svg-make-viewbox0-0-100-100-with-percentages

I might just fork it instead so it doesn't mess anything else up. You can close this pull request if you'd like