【发布时间】:2017-07-09 01:12:50
【问题描述】:
有没有创建新组件的命令,而不是手动创建新文件?与 au new 类似,但仅适用于组件:
hello.html
<template>
<!-- Hello template -->
</template>
hello.js
export class Hello {
constructor() {
}
}
【问题讨论】:
标签: aurelia
有没有创建新组件的命令,而不是手动创建新文件?与 au new 类似,但仅适用于组件:
hello.html
<template>
<!-- Hello template -->
</template>
hello.js
export class Hello {
constructor() {
}
}
【问题讨论】:
标签: aurelia
在命令行中输入 au generate 将为您提供以下选项列表:
$ au generate
_ _ ____ _ ___
__ _ _ _ _ __ ___| (_) __ _ / ___| | |_ _|
/ _` | | | | '__/ _ \ | |/ _` | | | | | | |
| (_| | |_| | | | __/ | | (_| | | |___| |___ | |
\__,_|\__,_|_| \___|_|_|\__,_| \____|_____|___|
No Generator Specified. Available Generators:
attribute
Creates a custom attribute class and places it in the project resources.
binding-behavior
Creates a binding behavior class and places it in the project resources.
component
Creates a custom component class and template (view model and view), placing them in the project source folder (or optionally in sub folders).
element
Creates a custom element class and template, placing them in the project resources.
generator
Creates a generator class and places it in the project generators folder.
task
Creates a task and places it in the project tasks folder.
value-converter
Creates a value converter class and places it in the project resources.
只需键入 au generate X,其中 X 是列出的选项之一。例如au generate component。
【讨论】: