2017-07-08 2 views
1

Anstatt neue Dateien manuell zu erstellen, gibt es einen Befehl zum Erstellen neuer Komponenten? Wie au new aber nur für Komponenten:Wie erstellt man eine neue Komponente mit Aurelia CLI?

hello.html

<template> 

    <!-- Hello template --> 

</template> 

hello.js

export class Hello { 

    constructor() { 

    } 

} 

Antwort

3

Typing au generate in der Befehlszeile geben Sie die folgende Liste der Optionen:

$ 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. 

Geben Sie einfach au generate X ein, wobei X eine der aufgelisteten Optionen ist. Zum Beispiel au generate component.

Verwandte Themen