2017-03-11 6 views
0

Yeoman 생성기는 기본적으로 정의 된 모든 함수를 실행합니다. 이제 yo my_generator model username:string password:string과 함께 인수를 지정하여 모델 파일을 만드는 격리 명령으로 지정하지만 프롬프트 및 복사를 실행하지 않습니다. 템플릿yeoman 생성기에서 인수를 지정할 때 루프 대기열을 실행하지 않음

module.exports = class extends Generator { 
    constructor(args, opts) { 
    super(args, opts); 

    this.argument('model', {desc: 'model generete', required: false, type: String}) 
    } 

    prompting(){ 
    .... 
    } 

    copyTemplates(){ 
    ... 
    } 

    model(){ 
    this.log('only run when "model" argument provide') 
    } 
}; 

답변