Lin*_*inx 4 css font-awesome vue.js vue-component
我有一个包含许多组件的 Vue 应用程序。目前,我在 index.html 文件的头部包含了 Font-Awesome,但实际上只有一个页面或组件需要它。是否可以将其移动到组件本身,以便仅在需要时加载?
移动这个
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
Run Code Online (Sandbox Code Playgroud)
对此
<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>
Run Code Online (Sandbox Code Playgroud)
我试过下载 Font-Awesome 并在上面的组件中添加一个链接标签 ^^^^ 我没有收到任何错误,但图标仍然不起作用。
Vin*_*ran 10
在 App.js 的 style 标签中导入 css 文件
<style>
@import './static/css/style.css';
</style>
Run Code Online (Sandbox Code Playgroud)