经过一些测试和研究,我已经能够安装auralia-ux 0.4.0+
首先需要安装核心和组件
npm install @aurelia-ux/core
然后您可以单独或一起安装每个组件
npm install @aurelia-ux/button
npm install @aurelia-ux/input
npm install @aurelia-ux/...
# or
npm install @aurelia-ux/components
然后在aurelia_project/aurelia.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}"
]
},
{
"name": "@aurelia-ux/input",
"path": "../node_modules/@aurelia-ux/input/dist/amd",
"main": "index",
"resources": [
"**/*.{css,html}"
]
},
或者如果您更喜欢components 变体(警告:我没有测试过这个变体):
{
"name": "@aurelia-ux/core",
"path": "../node_modules/@aurelia-ux/core/dist/amd",
"main": "index",
"resources": [
"**/*.{css,html}"
]
},
{
"name": "@aurelia-ux/components",
"path": "../node_modules/@aurelia-ux/components/dist/amd",
"main": "index",
"resources": [
"**/*.{css,html}"
]
}
最后你必须在你的 main.js 中注册插件
aurelia.use
.plugin('@aurelia-ux/core')
.plugin('@aurelia-ux/button')
.plugin('@aurelia-ux/input')
或使用组件变体(未测试)
aurelia.use
.plugin('@aurelia-ux/core')
.plugin('@aurelia-ux/components')