我已经使用aurelia-ux 0.3.0
一段时间了,并且喜欢这个概念。自从转移到aurelia-ux 0.4.0
并转移到monorepo后,我对如何安装和使用该库感到有点迷失。
有人可以提供一些关于如何使用aurelia-cli安装aurelia-ux 0.4.0
(核心+ 1-2个组件)的例子吗?
注意:@aurelia-ux/core包的当前npm文档指向showcase application - 但是此展示仍然运行0.3.0。
答案 0 :(得分:1)
经过一些测试和研究,我已经能够安装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')