【问题标题】:How can I install jquery 1.11.3 in Grails 2.4?如何在 Grails 2.4 中安装 jquery 1.11.3?
【发布时间】:2015-10-09 10:17:13
【问题描述】:

我在 BuildConfig.groovy 的插件部分中有这一行:

runtime ":jquery:1.11.1"

这是存储库中可用的最后一个版本:

https://grails.org/plugin/jquery

但我需要 1.11.3 版本,如果我尝试使用它来安装它

grails install-plugin

我收到一条警告,提示我应该使用 BuildConfig.groovy 中的插件部分来安装插件,该插件仅限于 1.11.1 版本。

如何安装?

jquery-1.11.1.min.js文件中复制粘贴jquery-1.11.3.min.js的代码会不会太笨?

【问题讨论】:

    标签: jquery grails


    【解决方案1】:

    就我而言,我不再使用 jQuery Grails 插件。我更喜欢这种方法:

    ApplicationResources.groovy

    modules = {
        jQuery1113 {
            resource "lib/jquery/jquery-1.11.3.min.js"
        }
    
        app {
            dependsOn "bootstrap3", "angularJs", "jQuery1113"
        }
    }
    

    然后在gsp中:

    <r:require module="jQuery1113"/>
    

    <r:require module="app"/>
    

    【讨论】:

      【解决方案2】:

      根据 grails jquery 插件文档,您可以在 config.groovy 中指定 jquery 版本,如下所示。

      jquery {
          sources = 'jquery' // Holds the value where to store jQuery-js files /web-app/js/
          version = '1.4.1' // The jQuery version in use
      }
      

      https://grails.org/plugin/jquery 这不适合你吗?

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2021-05-29
        • 2020-10-02
        • 1970-01-01
        • 1970-01-01
        • 2021-04-02
        • 1970-01-01
        • 2015-09-28
        相关资源
        最近更新 更多