在 Aurelia 中包含 bootstrap css [英] Including bootstrap css in Aurelia

查看:25
本文介绍了在 Aurelia 中包含 bootstrap css的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Aurelia 的新手,在第一个障碍时就摔倒了.我使用 aurelia cli 创建了一个新项目,并选择减少使用.

I am new to Aurelia and falling at the first hurdle. I have created a new project using the aurelia cli and have selected to use less.

这很好用,直到我尝试使用引导程序.我已经安装了带有 npm 的引导程序,它出现在 node_modules/bootstrap/

This works fine until I try to use bootstrap. I have installed bootstrap with npm which appears in node_modules/bootstrap/

这是目录结构

dist fonts grunt Gruntfile.js js less LICENSE package.json README.md

dist fonts grunt Gruntfile.js js less LICENSE package.json README.md

dist目录下有css文件.

There are css files in the dist directory.

在我的模板中我这样做

我得到的错误是未处理的拒绝错误:加载所需的 CSS 文件失败:bootstrap/css/bootstrap.css

The error I get is Unhandled rejection Error: Failed loading required CSS file: bootstrap/css/bootstrap.css

我如何告诉 Aurelia 引导 css 文件在哪里以及如何使用它们?

How do I tell Aurelia where the bootstrap css files are and how to use them ?

谢谢

推荐答案

我们仍在研究 CLI 将库导入项目并正确配置它们以进行捆绑的能力.请记住,它是一个 alpha.未来我们将对此进行重大改进.同时,请记住,如果您不确定该怎么做,您始终可以使用传统技术来包含库.所以,我只会在你的 html 页面中包含 style 标签和一个脚本标签,只是指向包文件夹中文件的位置.

We are still working on the CLI's ability to import libraries into a project and configure them correctly for bundling. Remember, it is an alpha. We will have major improvements coming for this in the future. In the mean time, remember that you can always use traditional techniques for including libraries if you aren't sure what to do. So, I would just include the style tag in your html page and a script tag as well, just pointing at the location for the files in your packages folder.

这对我们来说是一个主要用例,我们只是还没有研究出所有的库导入功能.我们很快就会解决这个问题.

This is a major use case for us, we just haven't worked out all the library import capabilities yet. We will address this soon.

这篇关于在 Aurelia 中包含 bootstrap css的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆