2017-08-30 67 views
0

ok我得到了aurelia骨架插件hello world示例的一個克隆,並試圖讓它在使用aurelia cli工具創建的新項目中工作。獲取aurelia骨架插件與cli項目一起工作

所以我克隆了骨架插件。然後我使用cli創建了一個新項目。那麼ive npm將本地文件系統中的skeleton插件安裝到我的cli項目中。

接下來我加入了相關代碼到aurelia.json文件

"dependencies": [ 
      { 
      "name": "hello-world", 
      "path": "../node_modules/aurelia-skeleton-plugin/dist/amd", 
      "main": "hello-world" 
      },.... 

然後我加入了relavent線到main.js

.plugin('hello-world') 

當我試圖通過增加使用插件它進入app.html文件

<template> 
    <!-- <require from="hello-world"></require> --> 
    <hello-world></hello-world> 

    <h1>${message}</h1> 
</template> 

在瀏覽器中沒有錯誤,但插件不顯示年。

任何暗示我做錯了什麼?

+0

是註釋掉'<! - <=從 「你好,世界」 規定> - >'只是爲了調試的目的?我會檢查,當你取消註釋,以包含組件的視圖和視圖模型文件加載的'require'語句。你應該能夠在chrome開發工具中看到這一點。 –

+0

你正在使用什麼類型的CLI項目(ES/TS,SystemJS/Webpack/RequireJS)? ''標籤的預期輸出是什麼? –

+0

hi sean hunter - 當我取消註釋行<! - - >我在瀏覽器中看到以下錯誤'plugin.load不是函數' – user4912152

回答

0

您是否在aurelia.json中包含了資源?

{ 
    "name": "hello-world", 
    "path": "../node_modules/aurelia-skeleton-plugin/dist/amd", 
    "main": "hello-world", 
    "resources": [ 
     "**/*.{css,html}" 
    ] 
}