在做React Native开发时,最常用的开发工具有 webStorm ,sublime ,appcode等,很多人都希望开发工具有智能提醒功能,然而我们使用上述开发工具进行React Native开发时并没有较好的提示功能。今天给大家介绍一款插件Webstrom live template 使webStrom支持React Native开发智能提醒。
插件下载地址
https://github.com/virtoolswebplayer/ReactNative-LiveTemplate
下载方法:
使用git下载 ,在终端输入git clone https://github.com/virtoolswebplayer/ReactNative-LiveTemplate
安装说明:
### 方法一
在终端中输入
file -> import settings -> ReactNative.jar
### 方法二
Mac下安装
> 提示: 如果没有`templates` 文件夹,你可以手动创建一个
#### webstorm11安装路径
将`ReactNative.xml`复制到 `~/Library/Preferences/WebStorm11/templates`
#### webstorm2016.2安装路径
将`ReactNative.xml`复制到 `~/Library/Preferences/WebStorm2016.2/templates`
重启 WebStrom
使用方法:
### 通用方法
直接输入`组件` 或 `Api` 名称的`首字母`, 比如想要 `View` ,只要输入 `V`自动提示代码里就会看到 `View`
### StyleSheet属性提示
首先 按下 `command + J` , 然后输入属性名的 `首字母`
如: 输入 `f` ,会自动提示 fontSize,fontFamily,fontStyle...等等