vue引入本地iconfont图标字体
1、下载iconfont图标至本地2、项目中新建文件夹,并把以下文件放到文件夹中3、打开app.vue页面,import引入对应的地址<template><div id="app"><router-view/></div></template&g
·
1、下载iconfont图标至本地
2、项目中新建文件夹,并把以下文件放到文件夹中
3、打开app.vue页面,import引入对应的地址
<template>
<div id="app">
<router-view/>
</div>
</template>
<script>
export default {
name: 'App'
}
</script>
<style lang="less">
@import './assets/stylesheets/reset.css';
@import './common/icon/iconfont.css';
@import './assets/stylesheets/public.less';
</style>
4、icon文件夹中文件不需要修改,若报错可尝试安装style-loader,css-loader,webpack.base.conf.js不需要修改
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: vueLoaderConfig
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
},
{
test: /\.less$/,
loader: "style-loader!css-loader!less-loader",
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
{
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('media/[name].[hash:7].[ext]')
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}
]
更多推荐
已为社区贡献8条内容
所有评论(0)