加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

twitter-bootstrap – 如何使用Twitter Bootstrap 2与播放框架2.

发布时间:2020-12-18 00:06:43 所属栏目:安全 来源:网络整理
导读:我知道当前玩!分发有一个帮助Bootstrap 1.4。如果我想使用当前版本的Bootstrap,该怎么办? 解决方法 我使用2.0.1 twitter bootstrap与Play 2.0。您可以在这里下载特定版本: https://github.com/twitter/bootstrap/tags。一旦你下载twitter启动,你有两个
我知道当前玩!分发有一个帮助Bootstrap 1.4。如果我想使用当前版本的Bootstrap,该怎么办?

解决方法

我使用2.0.1 twitter bootstrap与Play 2.0。您可以在这里下载特定版本: https://github.com/twitter/bootstrap/tags。一旦你下载twitter启动,你有两个选择:

>你可以选择只使用bootstrap.min.css(和bootstrap-responsive.css)和bootstrap.min.js,所有这些文件都可以放在public文件夹中。
>或者你可以使用较少的文件为CSS。如果你想使用较少的文件,你做以下包(在你的应用程序文件夹的根):

assets.stylesheets.bootstrap

在你构建scala,你定义这些.less文件应该编译:

// Only compile the bootstrap bootstrap.less file and any other *.less file in the stylesheets directory 
def customLessEntryPoints(base: File): PathFinder = ( 
    (base / "app" / "assets" / "stylesheets" / "bootstrap" * "bootstrap.less") +++
    (base / "app" / "assets" / "stylesheets" / "bootstrap" * "responsive.less") +++ 
    (base / "app" / "assets" / "stylesheets" * "*.less")
)

val main = PlayProject(appName,appVersion,appDependencies,mainLang = JAVA).settings(
  // Add your own project settings here
    lessEntryPoints <<= baseDirectory(customLessEntryPoints)
)

然后你可以将它包含在你的模板:

<link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/bootstrap/bootstrap.min.css")" />
<link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/bootstrap/responsive.min.css")" />

编辑:2012-09-17:
如果您计划从源代码构建Play,请按照本教程的Play Wiki页面:https://github.com/playframework/Play20/wiki/Tips

编辑:2012-09-21:
当使用引导程序时,您总是必须做出选择,无论是更改文件夹图像还是向引导程序使用的两个静态图像添加路由:

编辑:2013-03-11:
当xref指向,我犯了一个错误:img必须是图像:

GET     /assets/img/glyphicons-halflings-white.png      controllers.Assets.at(path="/public",file="/images/glyphicons-halflings-white.png")
GET     /assets/img/glyphicons-halflings.png            controllers.Assets.at(path="/public",file="/images/glyphicons-halflings.png")

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读