本文共 1006 字,大约阅读时间需要 3 分钟。
File -> Settings... -> Editor -> Code Style -> JavaScript,设置数据如下
File -> Settings... -> Editor -> File and Code Templates -> Files -> JavaScript File,设置模板内容为
import React, { PureComponent } from 'react';import { StyleSheet, View} from 'react-native';/** * @FileName: ${NAME} * @Author: ${USER} * @Date: ${DATE} * @Description: ${CONTENT} */class ${NAME} extends PureComponent { render() { return() }}/** * 样式属性 */const styles = StyleSheet.create({ container: { backgroundColor: '#DDD' }});/** * 导出当前Module */module.exports = ${NAME};
File -> Settings... -> Editor -> Live Templates -> JavaScript, 点击右侧加号,
/** * * @author mazaiting */
使用: Windows下Ctrl+J,调出快捷输入框,选择对应的即可
转载地址:http://koxyl.baihongyu.com/