vue怎么直接嵌入svg
Vue很棒 (Vue-Awesome)
Awesome SVG icon component for Vue.js, with built-in Font Awesome icons.
Vue.js的超赞SVG图标组件,带有内置的Font Awesome图标。
Vue-Awesome an SVG icon component for Vue.js, with built-in icons courtesy of Font Awesome.
Vue-Awesome Vue.js的SVG图标组件,内置图标由Font Awesome提供。
安装 (Installation)
npm(推荐) (npm (Recommended))
$ npm install vue-awesome
凉亭 (bower)
$ bower install vue-awesome
手册 (Manual)
Just download dist/vue-awesome.js
and include it in your HTML file:
只需下载dist/vue-awesome.js
并将其包含在您HTML文件中即可:
<script src="path/to/vue-awesome/dist/vue-awesome.js"></script>
用法 (Usage)
<!-- basic -->
<v-icon name="beer"/>
<!-- with options -->
<v-icon name="sync" scale="2" spin/>
<v-icon name="comment" flip="horizontal"/>
<v-icon name="code-branch" label="Forked Repository"/>
<!-- stacked icons -->
<v-icon label="No Photos">
<v-icon name="camera"/>
<v-icon name="ban" scale="2" class="alert"/>
</v-icon>
Font Awesome 5 has separated all icons into several packs. Vue-Awesome is built upon its all free icons, which includes all free icons from 3 icon packs: regular
, solid
and brands
. Since the solid
pack has the most number of icons, we organize all Vue-Awesome icons as follows:
Font Awesome 5将所有图标分为几个包。 Vue-Awesome建立在其所有免费图标的基础上,其中包括3个图标包中的所有免费图标: regular
, solid
和brands
。 由于solid
pack的图标数量最多,因此我们按以下方式组织所有Vue-Awesome图标:
-
All icons from
solid
pack are located invue-awesome/icons
directory and have unprefixedname
prop values.solid
pack中的所有图标都位于vue-awesome/icons
目录中,并且具有未前缀的name
prop值。 -
Icons from
regular
andbrands
are located invue-awesome/icons/regular
andvue-awesome/icons/brands
, which have prefixedname
prop values likeregular/flag
orbrands/reddit
.regular
和brands
图标位于vue-awesome/icons/regular
和vue-awesome/icons/brands
,它们具有前缀name
属性值,例如regular/flag
或brands/reddit
。
You can find all available name
values from Font Awesome's website like beer
, file
and camera
.
您可以从Font Awesome网站上找到所有可用的name
值,例如beer
, file