【发布时间】:2018-04-22 20:13:38
【问题描述】:
我有一个包含许多组件的 Vue 应用程序。目前我在 index.html 文件的头部包含了 Font-Awesome,但实际上只有一个页面或组件需要它。是否可以将其移动到组件本身,以便仅在需要时加载?
移动这个
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
到这里
<template></template>
<link rel="stylesheet" href="../../static/css/font-awesome-4.7.0/css/font-awesome-min.css"></link>
<script>
export default {
name: 'SingleComponent',
data: function() {
return{}
}
}
</script>
<style scoped>
</style>
我已经尝试下载 Font-Awesome 并在上面的组件中添加一个链接标签 ^^^^ 我没有收到任何错误,但图标仍然不起作用。
【问题讨论】:
-
如何在vue中添加这个? maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/…">
标签: css vue.js font-awesome vue-component