命令模式的核心在于引入了命令类,通过命令类来降低请求发送者和接收者的耦合度,请求发送者只需要指定一个命令对象,再通过命令对象来调用请求接收者的处理方法
1 |
|
1 | Command是命令接口,具有execute方法; |
运行该程序会输出以下结果:
1 | 执行具体命令1 |
缺失模块。
1、请确保node版本大于6.2
2、在博客根目录(注意不是yilia根目录)执行以下命令:
npm i hexo-generator-json-content --save
3、在根目录_config.yml里添加配置:
jsonContent: meta: false pages: false posts: title: true date: true path: true text: false raw: false content: false slug: false updated: false comments: false link: false permalink: false excerpt: false categories: false tags: true