如何将GeoExt3添加到Extjs 6 MVVM架构中?



我想用MVVM架构开发一个Extjs 6应用程序。在这个应用程序中,我想使用GeoExt 3。

我不知道如何将GeoExt 3库添加到应用程序中?

我该怎么做?

您必须使用GeoExt3创建一个包。有关Extjs-6中的打包,请参阅此处。

如何使用sencha命令打包GeoExt

从这里安装sencha cmd(使用版本6,现在只是预览版)。

要生成一个包,通常首先通过发出

创建一个sencha workspace

sencha -sdk/path/to/ext-n.n。N生成工作空间/path/to/workspace

在工作区内,将geoext3存储库克隆到packages子文件夹中:

$ CD/path/to/workspace/packages
$ git clone https://github.com/KaiVolland/geoext3.git GeoExt3
$ cd GeoExt3

然后可以发出

或者,如果您的源代码不在sencha工作空间中,您可以配置工作空间的路径,然后构建:

$ sencha config——prop workspace.config.dir=/path/to/workspace/。Sencha/workspace然后package build

将GeoExt添加到本地sencha存储库

初始化本地"GeoExt贡献者"存储库:

$ sencha package repo init -name "GeoExt贡献者" -email "dev@geoext.org"

将包添加到

$ sencha package add D:/xampp/htdocs/ExtProjects/GeoExt3/build/GeoExt/GeoExt. exepkg

创建你的应用如下:
要在sencha应用程序中使用这个包,只需将"GeoExt"添加到"requires"数组中在app.json中:

/**
 * The list of required packages (with optional versions; default is "latest").
 *
 * For example,
 *
 *      "requires": [
 *          "charts"
 *      ]
 */
"requires": [
    "GeoExt"
],

,并在最后构建应用程序如下:

最新更新