代码之家  ›  专栏  ›  技术社区  ›  Flores

如何开始使用Aurelia UX

  •  2
  • Flores  · 技术社区  · 7 年前

    所以,我正在尝试让aurelia ux工作,但无法做到。

    有一个演示应用程序,但该应用程序基于0.3,而存在0.6.1。似乎有些东西变了。

    aurelia ux的最新npm包是0.3.0,所以我想这不是应该使用的。aurelia ux/components包似乎就是要使用的包。。为此,存在一个0.6.1包。

    所以我把它添加到我的包中。json:

      "dependencies": {
          "@aurelia-ux/components": "^0.6.1",
    

    还有我的奥雷莉亚。json:

          {
            "name": "aurelia-ux",
            "path": "../node_modules/@aurelia-ux/components/dist/amd",
            "main": "index",
            "resources": ["**/*.{css,html}"]
          }
    

    这在我的构建输出中提供了:

    Tracing aurelia-ux...
     ------- File not found or not accessible ------
    | Location: C:/Work/Dat/AuFront/src/@aurelia-ux/button.js|
    | Requested by: C:\Work\Dat\AuFront\node_modules\@aurelia-ux\components\dist\amd\index.js
    | Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
    

    这看起来像是某种路径引用问题?有没有人有一个有效的例子?

    1 回复  |  直到 7 年前
        1
  •  0
  •   Flores    7 年前

    因此,诀窍在于包含此npm包:

    @aurelia ux/组件

    在奥雷利亚。json添加以下内容:

         {
            "name": "@aurelia-ux/core",
            "path": "../node_modules/@aurelia-ux/core/dist/amd",
            "main": "index",
            "resources": ["**/*.{css,html}"]
          },
    

    然后 每一个 要使用的组件,如下所示:

          {
            "name": "@aurelia-ux/button",
            "path": "../node_modules/@aurelia-ux/button/dist/amd",
            "main": "index",
            "resources": ["**/*.{css,html}"]
          },
    

    然后,把它用在你的main上。ts如下所示:

        .plugin('@aurelia-ux/core')
        .plugin('@aurelia-ux/button')