【发布时间】:2019-04-25 16:30:21
【问题描述】:
我找到了一个在线引导模板,我正在尝试将其改编为 nuxt 项目的一部分。我已将所有引导文件放在静态文件夹中。
在 nuxt.config.js 文件中:
module.exports = {
/*
** Headers of the page
*/
head: {
title: ' Bootstrap Responsive Website Template | Home :: w3layouts',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: 'Nuxt.js project' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{ rel: 'stylesheet', type: 'text/css', href: '/static/css/style.css' },
{ rel: 'stylesheet', type: 'text/css', href: '/static/css/flexslider.css' },
{ rel: 'stylesheet', type: 'text/css', href: '/static/css/easy-responsive-tabs.css' },
{ rel: 'stylesheet', type: 'text/css', href: '/static/css/chocolat.css' },
{ rel: 'stylesheet', type: 'text/css', href: '/static/css/bootstrap.min.css' },
{ rel: 'stylesheet', type: 'text/css', href: '/static/css/font-awesome.min.css' },
]
},
但是路径错误并且 css 无法正常工作。我怎样才能让它工作?
【问题讨论】:
-
您应该删除“静态”。
href: '/css/style.css' -
你的方法奏效了!
标签: javascript vue.js nuxt.js