SeregPie / VueWordCloud

Generates a cloud out of the words.
https://seregpie.github.io/VueWordCloud/
MIT License
387 stars 60 forks source link

Doesn't work for vue files #18

Closed manumora closed 6 years ago

manumora commented 7 years ago

I have added the following code into vue file but it doesn't draw anything. Console is clean of errors. Thank youuu

<template>
  <div>
        <vue-word-cloud
          :words="[['romance', 19], ['horror', 3], ['fantasy', 7], ['adventure', 3]]"
          :color="([, weight]) => weight > 10 ? 'DeepPink' : weight > 5 ? 'RoyalBlue' : 'Indigo'"
          font-family="Lora"
        ></vue-word-cloud>
  </div>
</template>
<script>
import VueWordcloud from 'vuewordcloud'
export default {
  components: {
    VueWordcloud
  },
}
</script>
SeregPie commented 7 years ago

Hello. Can it be that there is a typo? VueWordCloud and not VueWordcloud. Because VueWordCloud gets to <vue-word-cloud> inside HTML and VueWordcloud gets to <vue-wordcloud>.

maggiew61 commented 6 years ago

add style="position:absolute" to the vue-word-cloud component for example: <vue-word-cloud style="position:absolute"
:words="[['romance', 19], ['horror', 3], ['fantasy', 7], ['adventure', 3]]" :color="([, weight]) => weight > 10 ? 'DeepPink' : weight > 5 ? 'RoyalBlue' : 'Indigo'" font-family="Roboto"