使用Dart和Bootstrap

IAm*_*aja 9 project-structure twitter-bootstrap dart

我正在尝试使用Dart,现在我正在尝试使用Bootstrap作为其CSS框架.当我下载最新版本的Bootstrap(目前为3.0.3)时,它具有以下文件结构:

??? css
?   ??? bootstrap.css
?   ??? bootstrap.min.css
?   ??? bootstrap-theme.css
?   ??? bootstrap-theme.min.css
??? fonts
?   ??? glyphicons-halflings-regular.eot
?   ??? glyphicons-halflings-regular.svg
?   ??? glyphicons-halflings-regular.ttf
?   ??? glyphicons-halflings-regular.woff
??? js
    ??? bootstrap.js
    ??? bootstrap.min.js
Run Code Online (Sandbox Code Playgroud)

(1)我在哪里放置所有这些文件,以及如何从我的Dart源和HTML文件中访问它们?例如,假设我想从Dart文件中动态更改DOM,并将一个Bootstrap类添加到元素中 - 这会是什么样的?如果我只是想给一个HTML元素一个Bootstrap类(在.html文件中),那会是什么样子?

认为我可能需要使用的封装结构的飞镖项目的东西是这样的:

MyDartApp/
    web/
        myapp.dart
    asset/
        bootstrap/
            css/
                bootstrap.css
                bootstrap.min.css
                bootstrap-theme.css
                bootstrap-them.min.css
            fonts/
                glyphicons-halflings-regular.eot
                glyphicons-halflings-regular.svg
                glyphicons-halflings-regular.ttf
                glyphicons-halflings-regular.woff
            js/
                bootstrap.js
                bootstrap.min.js
Run Code Online (Sandbox Code Playgroud)

但是对于Dart和Bootstrap都有这么少的经验,不确定我是否遗漏了大量的东西.显然,我需要打包Bootstrap文件,使得asset/我的Dart/HTML文件中的URL可以在运行之前/之后访问它们pub build.

(2)另外,我可以只使用min每个CSS/JS文件的-version(bootstrap.min.js而不是bootstrap.js等)吗?

Ale*_*uin 7

  1. 您可以使用该asset/文件夹来放置这些文件.但是,编辑器中的内置服务器暂时不支持资产,您必须使用pub serve.要访问它们,请使用/assets/<pkg_name>/<path>(请参阅如何引用资产).或者你可以把根据这些文件/lib/,并访问它们packages/<pkg_name>/<path>.
  2. 你可以使用缩小版本.