Webstorm自定義新建JS文件默認填充內容

Preferences > Editor > File and Code Templates

/**
 * Created by Capricorncd.
 * https://github.com/capricorncd
 * Date: ${YEAR}-${MONTH}-${DAY} ${HOUR}:${MINUTE}
 */
import React, { Component } from 'react'
import { View, Text, StyleSheet } from 'react-native'

export default class ${NAME} extends Component {
    render () {
        return (
            <View>
                <Text></Text>
            </View>
        )
    }
}

const styles = StyleSheet.create({
    
})

${PROJECT_NAME} - the name of the current project.

${NAME} - the name of the new file which you specify in the New File dialog box during the file creation.

${USER} - the login name of the current user.

${DATE} - the current system date.

${TIME} - the current system time.

${YEAR} - the current year.

${MONTH} - the current month.

${DAY} - the current day of the month.

${HOUR} - the current hour.

${MINUTE} - the current minute.

${PRODUCT_NAME} - the name of the IDE in which the file will be created.

${MONTH_NAME_SHORT} - the first 3 letters of the month name. Example: Jan, Feb, etc.

${MONTH_NAME_FULL} - full name of a month. Example: January, February, etc.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章