【问题标题】:How to import Gwt-Bootstrap?如何导入 Gwt-Bootstrap?
【发布时间】:2020-12-21 10:27:49
【问题描述】:

我将在我的 UiBinder 文件中使用 Gwt-Bootstrap。我导入了这个

xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">

到我的 UIBinder 文件和这个

<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<link rel="stylesheet" href="{your module name}/css/font-awesome-ie7.css">

到我的 Html 文件。但它不起作用。错误是

Package com.github.gwtbootstrap.client.ui cannot be 
 resolved

【问题讨论】:

    标签: twitter-bootstrap bootstrap-4 gwt uibinder


    【解决方案1】:

    GWT-Bootstrap 必须添加到 GWT 项目中。如果您使用的是 Maven,请添加相应的依赖项:

    <dependency>
      <groupId>com.github.gwtbootstrap</groupId>
      <artifactId>gwt-bootstrap</artifactId>
      <version>2.3.2.1-SNAPSHOT</version>
    </dependency>
    

    然后,继承你的GWT模块(.gwt.xml)中的GWT-Bootstrap模块:

    <module>
        <inherits name='com.github.gwtbootstrap.Bootstrap' />
        ...
    </module>
    

    但是,请注意 GWT-Bootstrap 已过时且不再维护。我在许多项目中使用 Bootstrap 和 GWT,我相信结合使用它的最佳方式是使用 HTML 和 Bootstrap 标准,并将 HTML 元素与 Elemental2 绑定到 GWT。效果很好,没有任何限制,而且面向未来。

    【讨论】:

    • 它不起作用。但是你如何使用 bootstrap、html 和 gwt?你能解释一下吗?
    • 您是否忘记将 GWT-Bootstrap 添加到您的项目中?我已经编辑了我的答案。如果它回答了您的问题,请接受此答案。
    • 你应该试试 Domino-UI:github.com/DominoKit/domino-ui
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-11
    • 1970-01-01
    • 2012-08-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多