×

puremvc 框架 javas

puremvc(如何使用javascript的PureMVC框架)

admin admin 发表于2023-09-26 00:57:06 浏览29 评论0

抢沙发发表评论

本文目录

如何使用javascript的PureMVC框架

Controller保存所有Command的映射。Command类是无状态的,只在需要时才被创建。Command是负责处理复杂的数据逻辑的地方,它的使用归纳起来有两种1. 通过发送Notification 来触发Command2. addSubCommand() 来启动口水不要太多,我们马上进入正题在demo文件夹下建立文件夹controller ,然后在controller夹下建立一个叫StartupCommand.js的js文件,输入以下内容 this.addSubCommand( PrepViewCommand ); 这样就可以调用到PrepViewCommand.js文件的execut()方法了!