require这个 CommandTool console.log(CommandTool)是一个空的{}为什么?



  • /**

    • Created by naxiaoguang on 11/10/14.
      */

    'use strict' ;

    var CommandID = require("./CommandID");
    var SceneManager = require("./../manager/SceneManager");

    var Handler = {

    active (commandID, data){
    
        switch (commandID) {
    
            case CommandID.ROOT_NAVIGATOR:
    
                return SceneManager.setRootNavigator(data);
    
            case CommandID.INIT_SCENE :
    
                return SceneManager.getInitActivity();
    
            case CommandID.PUSH_SCENE:
    
                return SceneManager.changToPage(data);
    
            case CommandID.PRE_SCENE:
    
                return SceneManager.changeToPrePage();
        }
    }
    

    }

    var CommandTool = {

    postCommand(commandID, data, callback){
    
        console.log("发消息啦-----:" + commandID);
    
        return Handler.active(commandID, data, callback);
    },
    

    }

    module.exports = CommandTool;


登录后回复