【问题标题】:How to create a new component with aurelia cli?如何使用 aurelia cli 创建新组件?
【发布时间】:2017-07-09 01:12:50
【问题描述】:

有没有创建新组件的命令,而不是手动创建新文件?与 au new 类似,但仅适用于组件:

hello.html

<template>

  <!-- Hello template -->

</template>

hello.js

export class Hello {

  constructor() {

  }

}

【问题讨论】:

    标签: aurelia


    【解决方案1】:

    在命令行中输入 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

    【讨论】:

    • 介意用 kebab-case 命名你的新组件。
    猜你喜欢
    • 1970-01-01
    • 2017-11-22
    • 2018-05-13
    • 2017-01-13
    • 1970-01-01
    • 2017-05-18
    • 2017-04-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多