插件名称 | VueWordCloud |
---|---|
发布时间 | 2020年12月31日 |
插件作者 | SeregPie |
Vue.js Web应用程序的单词/标签云生成器。
npm install vuewordcloud
<vue-word-cloud
style="
height: 480px;
width: 640px;
"
:words="[['romance', 19], ['horror', 3], ['fantasy', 7], ['adventure', 3]]"
:color="([, weight]) => weight > 10 ? 'DeepPink' : weight > 5 ? 'RoyalBlue' : 'Indigo'"
font-family="Roboto"
/>
传递单词的自定义渲染器。
<vue-word-cloud :words="words">
<template slot-scope="{text, weight, word}">
<div :title="weight" style="cursor: pointer;" @click="onWordClick(word)">
{{ text }}
</div>
</template>
</vue-word-cloud>