如何使用 Aurelia CLI 安装 Aurelia UX 0.4.0?
How to install Aurelia UX 0.4.0 with Aurelia CLI?
我已经使用 aurelia-ux 0.3.0
一段时间了,我喜欢这个概念。自从转移到 aurelia-ux 0.4.0
并转移到 monorepo 后,我对如何安装和使用库有点迷茫。
谁能提供一个关于如何使用 aurelia-cli 安装 aurelia-ux 0.4.0
(核心 + 1-2 个组件)的小例子?
注意:@aurelia-ux/core package points to the showcase application 的当前 npm 文档 - 但是这个展示仍然运行 0.3.0。
经过一些测试和研究,我已经能够安装 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')
我已经使用 aurelia-ux 0.3.0
一段时间了,我喜欢这个概念。自从转移到 aurelia-ux 0.4.0
并转移到 monorepo 后,我对如何安装和使用库有点迷茫。
谁能提供一个关于如何使用 aurelia-cli 安装 aurelia-ux 0.4.0
(核心 + 1-2 个组件)的小例子?
注意:@aurelia-ux/core package points to the showcase application 的当前 npm 文档 - 但是这个展示仍然运行 0.3.0。
经过一些测试和研究,我已经能够安装 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')