【发布时间】:2017-02-23 04:42:00
【问题描述】:
当我们执行以下操作时,项目中实际发生了什么
ionic state 命令?
restoresaveclearreset
我们需要在什么样的情况下使用它们?
我用谷歌搜索了这个,但找不到任何合适的详细答案。
感谢您的任何帮助。
【问题讨论】:
标签: android ios ionic-framework ionic2 ionic-cli
当我们执行以下操作时,项目中实际发生了什么
ionic state 命令?
restoresaveclearreset我们需要在什么样的情况下使用它们?
我用谷歌搜索了这个,但找不到任何合适的详细答案。
感谢您的任何帮助。
【问题讨论】:
标签: android ios ionic-framework ionic2 ionic-cli
您可以随时查看他们的 Ionic CLI v1/v2
源代码save: 'Save the platforms and plugins into package.json',
restore: 'Restore the platforms and plugins from package.json',
clear: 'Clear the package.json of cordovaPlugins and cordovaPlatforms, '
'as well as clear out the platforms and plugins folders',
reset: 'Clear out the platforms and plugins directories, and reinstall plugins and platforms',
state 已从 CLI v3 中删除:插件和平台可以完全由 Cordova 管理。请从您的 package.json 文件中删除 cordovaPlatforms 和 cordovaPlugins 键。如果您使用的是 Cordova 7,请查看有关 Cordova 如何使用 config.xml 和 package.json 管理插件和平台的公告。
【讨论】:
ionic state restore
- Ionic 将添加适当的插件和平台。这对于从源代码控制存储库中检查您的 Ionic 项目的人们来说非常有用。
ionic state save
- 将当前平台和插件存储到package.json。
ionic state clear
- 删除所有内容,包括 Ionic 始终安装的默认插件。
ionic state reset
- 这将删除所有内容,然后恢复您在 package.json 文件中指定的内容。
参考。 - https://www.raymondcamden.com/2015/04/20/ionic-adds-a-new-state-feature
问候。
【讨论】: