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

twitter-bootstrap – 在grails中集成bootstrap

发布时间:2020-12-17 21:26:01 所属栏目:安全 来源:网络整理
导读:我是grails的新手,我正在尝试集成bootstrap,但我在标签r中有错误:我正在尝试找到一些很好的教程来集成bootils中的grails,但是我找不到任何东西,什么都不错解. 我在BuildConfig中添加(我可以看到bootstrap安装在我的link_to_grails_plugins中) compile ":twi
我是grails的新手,我正在尝试集成bootstrap,但我在标签r中有错误:我正在尝试找到一些很好的教程来集成bootils中的grails,但是我找不到任何东西,什么都不错解.

我在BuildConfig中添加(我可以看到bootstrap安装在我的link_to_grails_plugins中)

compile ":twitter-bootstrap:3.3.4"

我做了,这也是:

“要包含引导资源,请将以下内容添加到应用程序的css或js文件中.”

Javascript grails-app/assets/javascripts/application.js:

//= require bootstrap

console.log("My javascript goes here");
Stylesheet grails-app/assets/javascripts/application.css:

/*
*= require bootstrap
*/

还有这个….
????布局

你的grails-app / views / layouts / main.gsp:

<!DOCTYPE html>
<html>
<head>
    <title><g:layoutTitle default="Grails"/></title>
    <asset:stylesheet src="application.css"/>
    <g:layoutHead/>
</head>
<body>
    <g:layoutBody/>
    <asset:javascript src="application.js"/>
</body>
</html>

但是当我提出我的观点时:

<html>
    <head>
        <meta name="layout" content="main"/>
        <r:require modules="bootstrap"/>
    </head>
<body>
    <h1> Hello World </h1>
</body>
</html>

< r:require modules =“bootstrap”/>标记为黄色,我可以读取未知标签(r:require).

解决方法

我找到了解决方案.你必须在BuildConfig.groovy中添加:

runtime’:twitter-bootstrap:3.3.4′

我展示了你在插件中必须拥有的所有代码:

plugins {
        // plugins for the build system only
        build ":tomcat:7.0.55"

        // plugins for the compile step
        compile ":scaffolding:2.1.2"
        compile ':cache:1.1.8'
        compile ":asset-pipeline:1.9.9"
        compile ":twitter-bootstrap:3.3.4"

        // plugins needed at runtime but not for compilation
        runtime ":hibernate4:4.3.6.1" // or ":hibernate:3.6.10.18"
        runtime ":database-migration:1.4.0"
        runtime ":jquery:1.11.1"
        runtime ':twitter-bootstrap:3.3.4'

        // Uncomment these to enable additional asset-pipeline capabilities
        //compile ":sass-asset-pipeline:1.9.0"
        //compile ":less-asset-pipeline:1.10.0"
        //compile ":coffee-asset-pipeline:1.8.0"
        //compile ":handlebars-asset-pipeline:1.3.0.3"
    }

(编辑:李大同)

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

    推荐文章
      热点阅读