代碼塊

{
    // Place your 全局 snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and 
    // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope 
    // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is 
    // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: 
    // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. 
    // Placeholders with the same ids are connected.
    // Example:
    "log快捷鍵": {
        "scope": "",
        "prefix": "log",
        "body": [
            "console.log('start======================');",
            "console.log('$1');",
            "console.log('end========================');",
        ],
        "description": "log快捷鍵"
    },
    "const func快捷鍵": {
        "scope": "",
        "prefix": "func",
        "body": [
            "const ${1:func} = (${2:params}) => {\n\t$3\n}"
        ],
        "description": "const func快捷鍵"
    },
    "useEffect 快捷鍵": {
        "scope": "",
        "prefix": "effect",
        "body": [
            "useEffect(() => {\n\t$2\n}, [$1])",
        ],
        "description": "快速創(chuàng)建 useEffect"
    },
    "useState 快捷鍵": {
        "scope": "",
        "prefix": "state",
        "body": [
            "const [$2, set$3] = useState($1)",
        ],
        "description": "快速創(chuàng)建 useState"
    },
    "匿名方法 快捷鍵": {
        "scope": "",
        "prefix": "func",
        "body": [
            "() => {\n\t$1\n}",
        ],
        "description": "快速創(chuàng)建 useState"
    },
    "字體屬性 快捷鍵": {
        "scope": "",
        "prefix": "font",
        "body": [
            "fontWeight: '400',",
            "fontSize: sp(13),",
            "lineHeight: sp(17),",
            "color: Color.black",
        ],
        "description": "快速創(chuàng)建 font屬性"
    },
    "字高屬性 快捷鍵": {
        "scope": "",
        "prefix": "line",
        "body": [
            "lineHeight: sp(17),",
        ],
        "description": "快速創(chuàng)建 lineHeight屬性"
    },
    "style 快捷鍵": {
        "scope": "",
        "prefix": "st",
        "body": [
            "style={styles.$1}",
        ],
        "description": "快速創(chuàng)建 font屬性"
    },
    "style屬性 快捷鍵": {
        "scope": "",
        "prefix": "sts",
        "body": [
            "${1:name}: {",
            "\t$2",
            "},",
        ],
        "description": "快速創(chuàng)建 font屬性"
    },
    "height屬性 快捷鍵": {
        "scope": "",
        "prefix": "he",
        "body": [
            "height: dpw($1),\n",
        ],
        "description": "快速創(chuàng)建 height屬性"
    },
    "width屬性 快捷鍵": {
        "scope": "",
        "prefix": "wi",
        "body": [
            "width: dpw($1),\n",
        ],
        "description": "快速創(chuàng)建 width屬性"
    },
    "backgroundColor屬性 快捷鍵": {
        "scope": "",
        "prefix": "bg",
        "body": [
            "backgroundColor: '${1:gray}',\n",
        ],
        "description": "快速創(chuàng)建 backgroundColor屬性"
    },
    "borderRadius 快捷鍵": {
        "scope": "",
        "prefix": "br",
        "body": [
            "borderRadius: dpw(${1:12}),\n",
        ],
        "description": "快速創(chuàng)建 borderRadius屬性"
    },
    "paddingHorizontal 快捷鍵": {
        "scope": "",
        "prefix": "ph",
        "body": [
            "paddingHorizontal: dpw(${1:12}),\n",
        ],
        "description": "快速創(chuàng)建 paddingHorizontal屬性"
    },
    "fontSize 快捷鍵": {
        "scope": "",
        "prefix": "fs",
        "body": [
            "fontSize: sp(${1:12}),\n",
        ],
        "description": "快速創(chuàng)建 fontSize屬性"
    },
    "justifyContent 快捷鍵": {
        "scope": "",
        "prefix": "just",
        "body": [
            "justifyContent: '${1:center}',\n",
        ],
        "description": "快速創(chuàng)建 justifyContent屬性"
    },
    "textAlign 快捷鍵": {
        "scope": "",
        "prefix": "textAlign",
        "body": [
            "textAlign: 'center',\n",
        ],
        "description": "快速創(chuàng)建 textAlign"
    },
    "alignItems 快捷鍵": {
        "scope": "",
        "prefix": "align",
        "body": [
            "alignItems: '${1:center}',\n",
        ],
        "description": "快速創(chuàng)建 alignItems屬性"
    },
    "marginTop 快捷鍵": {
        "scope": "",
        "prefix": "mt",
        "body": [
            "marginTop: dpw(${1:12}),\n",
        ],
        "description": "快速創(chuàng)建 marginTop屬性"
    },
    "marginVertical 快捷鍵": {
        "scope": "",
        "prefix": "mv",
        "body": [
            "marginVertical:dpw(${1:12}),\n",
        ],
        "description": "快速創(chuàng)建 marginVertical屬性"
    },
    "absolute 快捷鍵": {
        "scope": "",
        "prefix": "ab",
        "body": [
            "position:'${1:absolute'},\n",
        ],
        "description": "快速創(chuàng)建 absolute屬性"
    },
    "require 快捷鍵": {
        "scope": "",
        "prefix": "so",
        "body": [
            "source={require('@assets/images/home/${1:name}.png')}",
        ],
        "description": "快速創(chuàng)建 require屬性"
    },
    "right 快捷鍵": {
        "scope": "",
        "prefix": "ri",
        "body": [
            "right: dpw(${1:10}),\n",
        ],
        "description": "快速創(chuàng)建 right屬性"
    },
    "left 快捷鍵": {
        "scope": "",
        "prefix": "le",
        "body": [
            "left: dpw(${1:10}),\n",
        ],
        "description": "快速創(chuàng)建 left屬性"
    },
    "top 快捷鍵": {
        "scope": "",
        "prefix": "to",
        "body": [
            "top: dpw(${1:10}),\n",
        ],
        "description": "快速創(chuàng)建 top屬性"
    },
    "bottom 快捷鍵": {
        "scope": "",
        "prefix": "bo",
        "body": [
            "bottom: dpw(${1:10}),\n",
        ],
        "description": "快速創(chuàng)建 bottom屬性"
    },
    "marginBottom 快捷鍵": {
        "scope": "",
        "prefix": "mb",
        "body": [
            "marginBottom: dpw(${1:10}),\n",
        ],
        "description": "快速創(chuàng)建 marginBottom屬性"
    },
    "marginHorizontal 快捷鍵": {
        "scope": "",
        "prefix": "mh",
        "body": [
            "marginHorizontal: dpw(${1:10}),\n",
        ],
        "description": "快速創(chuàng)建 marginHorizontal屬性"
    },
    "flexRow 快捷鍵": {
        "scope": "",
        "prefix": "flexrow",
        "body": [
            "flexDirection: 'row',\n",
        ],
        "description": "快速創(chuàng)建 flexRow 屬性"
    },
    "flexColumn 快捷鍵": {
        "scope": "",
        "prefix": "flexcolumn",
        "body": [
            "flexDirection: 'column',\n",
        ],
        "description": "快速創(chuàng)建 flexColumn 屬性"
    },
    "borderWidth 快捷鍵": {
        "scope": "",
        "prefix": "bw",
        "body": [
            "borderWidth:dpw(${1:1}),\n",
        ],
        "description": "快速創(chuàng)建 borderWidth 屬性"
    },
    "borderColor 快捷鍵": {
        "scope": "",
        "prefix": "bc",
        "body": [
            "borderColor:'${1:rgba(0, 0, 0, 1)}',\n",
        ],
        "description": "快速創(chuàng)建 borderColor 屬性"
    },
    "marginRight 快捷鍵": {
        "scope": "",
        "prefix": "mr",
        "body": [
            "marginRight:dpw(${1:10}),\n",
        ],
        "description": "快速創(chuàng)建 marginRight 屬性"
    },
    "marginLeft 快捷鍵": {
        "scope": "",
        "prefix": "ml",
        "body": [
            "marginLeft:dpw(${1:10}),\n",
        ],
        "description": "快速創(chuàng)建 marginLeft 屬性"
    },
    "device 快捷鍵": {
        "scope": "",
        "prefix": "de",
        "body": [
            "useEffect(() => {",
            "const remove = DeviceEventEmitter.addListener(notificationKey.${1:go_to_music_detail}, (${2:songImage})=>{\n",
            "})",
            "return ()=>{",
            "remove.remove()",
            "}",
            "}, [])",
        ],
        "description": "快速創(chuàng)建 device 屬性"
    },
    "eventEmitter 監(jiān)聽事件快捷鍵": {
        "scope": "",
        "prefix": "emit",
        "body": [
            "useEffect(() => {",
            "const listener = () => {",
            "${0}",
            "};",
            "eventEmitter.on(notificationKey.${1:refresh_weight_chart}, listener);",
            "return () => {",
            "eventEmitter.removeListener(",
            "notificationKey.${1:refresh_weight_chart},",
            "listener,",
            ");",
            "};",
            "}, [])",
        ],
        "description": "快速創(chuàng)建 emiter 屬性"
    },
    "effectReturn 快捷鍵": {
        "scope": "",
        "prefix": "effectReturn",
        "body": [
            "useEffect(() => {",
            "return () => {",
            "${1:DeviceEventEmitter.emit(notificationKey.float_music_panel, true);}",
            "};",
            "}, []);",
        ],
        "description": "快速創(chuàng)建 effectReturn 屬性"
    },
    "navigationType 快捷鍵": {
        "scope": "",
        "prefix": "navigationType",
        "body": [
            "export type ${1:RecordVoice}RouteParams = {",
            "${2:defaultCount}: ${3:number};",
            "};",
        ],
        "description": "快速創(chuàng)建 navigationType 屬性"
    },
    "StyleSheet 快捷鍵": {
        "scope": "",
        "prefix": "styleshe",
        "body": [
            "const styles = StyleSheet.create({",
            "$1\n",
            "})",
        ],
        "description": "StyleSheet 屬性"
    },
    "navigation 快捷鍵": {
        "scope": "",
        "prefix": "navi",
        "body": [
            "const { navigate, goBack, dispatch } = useNavigation<NavigationType>();",
        ],
        "description": "快速獲取navigation"
    },
    "inset 快捷鍵": {
        "scope": "",
        "prefix": "inset",
        "body": [
            "  const inset = useSafeAreaInsets()",
        ],
        "description": "快速獲取inset"
    },
    "useSelector 快捷鍵": {
        "scope": "",
        "prefix": "selector",
        "body": [
            "const ${1:aiLoanAccountInfo} = useAppSelector((state: RootState)=> state.xLendAccount.${2:aiLoanAccountInfo} );",
        ],
        "description": "快速獲取useSelector"
    },
    "useDispatch 快捷鍵": {
        "scope": "",
        "prefix": "dispatch",
        "body": [
            "const dispatch = useAppDispatch()",
        ],
        "description": "快速獲取useDispatch"
    },
    "dispatch 快捷鍵": {
        "scope": "",
        "prefix": "dispatchSet",
        "body": [
            "const data = ${1:value};",
            "dispatch(setCache(data));",
        ],
        "description": "快速set dispatch"
    },
    "emit 快捷鍵": {
        "scope": "",
        "prefix": "emit",
        "body": [
            "DeviceEventEmitter.emit(notificationKey.${1:have_update})",
        ],
        "description": "快速創(chuàng)建emit"
    },
    "eventEmitter 發(fā)送事件快捷鍵": {
        "scope": "",
        "prefix": "emit",
        "body": [
            "eventEmitter.emit(notificationKey.${1:have_update})",
        ],
        "description": "快速創(chuàng)建emit"
    },
    "await 快捷鍵": {
        "scope": "",
        "prefix": "await",
        "body": [
            "try {",
            "const res = await ${1:referAPI.getCredits();}",
            "\n",
            "}catch (error) {",
            "\n",
            "}",
        ],
        "description": "快速創(chuàng)建await"
    },
    "color 快捷鍵": {
        "scope": "",
        "prefix": "co",
        "body": [
            "color:'${1:rgba(0, 0, 0, 1)}',\n",
        ],
        "description": "快速創(chuàng)建 color"
    },
    "paddingVertical 快捷鍵": {
        "scope": "",
        "prefix": "pv",
        "body": [
            "paddingVertical:dpw(${1:12}),\n",
        ],
        "description": "快速創(chuàng)建 paddingVertical"
    },
    "paddingTop 快捷鍵": {
        "scope": "",
        "prefix": "pt",
        "body": [
            "paddingTop:dpw(${1:12}),\n",
        ],
        "description": "快速創(chuàng)建 paddingTop"
    },
    "paddingLeft 快捷鍵": {
        "scope": "",
        "prefix": "pl",
        "body": [
            "paddingLeft:dpw(${1:12}),\n",
        ],
        "description": "快速創(chuàng)建 paddingLeft"
    },
    "paddingRight 快捷鍵": {
        "scope": "",
        "prefix": "pr",
        "body": [
            "paddingRight:dpw(${1:12}),\n",
        ],
        "description": "快速創(chuàng)建 paddingRight"
    },
    "paddingBottom 快捷鍵": {
        "scope": "",
        "prefix": "pb",
        "body": [
            "paddingBottom:dpw(${1:12}),\n",
        ],
        "description": "快速創(chuàng)建 paddingBottom"
    },
    "hitSlop 快捷鍵": {
        "scope": "",
        "prefix": "hit",
        "body": [
            "hitSlop={{top: 10, bottom: 10, left: 10, right: 10}}\n",
        ],
        "description": "快速創(chuàng)建 hitSlop"
    },
    "IProps 快捷鍵": {
        "scope": "",
        "prefix": "iprops",
        "body": [
            "interface IProps {",
            "${1}",
            "}\n",
        ],
        "description": "快速創(chuàng)建 IProps"
    },
    "focus 快捷鍵": {
        "scope": "",
        "prefix": "focus",
        "body": [
            "http:// 進(jìn)入頁面",
            "const unsubscribe = navigation.addListener('focus', () => {${1}});",
            "return unsubscribe;",
        ],
        "description": "focus 快捷鍵"
    },
    "white 快捷鍵": {
        "scope": "",
        "prefix": "white",
        "body": [
            "'rgba(255, 255, 255, ${1:1})'",
        ],
        "description": "white 快捷鍵"
    },
    "black 快捷鍵": {
        "scope": "",
        "prefix": "black",
        "body": [
            "'rgba(0, 0, 0, ${1:1})'",
        ],
        "description": "black 快捷鍵"
    },
    "export 快捷鍵": {
        "scope": "",
        "prefix": "export",
        "body": [
            "const ${1:GestureRootView} = () => {",
            "return <View></View>;",
            "};",
            "export default ${1:GestureRootView}",
        ],
        "description": "export 快捷鍵"
    },
    "export use 快捷鍵": {
        "scope": "",
        "prefix": "export use",
        "body": [
            "const ${1:GestureRootView} = () => {",
            "${2}",
            "};",
            "export default ${1:GestureRootView}",
        ],
        "description": "export use 快捷鍵"
    },
    "goBack 快捷鍵": {
        "scope": "",
        "prefix": "goBack",
        "body": [
            "navigation.canGoBack() && navigation.goBack();",
        ],
        "description": "goBack 快捷鍵"
    },
    "popup 快捷鍵": {
        "scope": "",
        "prefix": "popup",
        "body": [
            "logEventBySensors('EntryPopUp', {",
            "e_popup_page: ${1:pageName},",
            "})",
        ],
        "description": "popup 快捷鍵"
    },
    "popupClick 快捷鍵": {
        "scope": "",
        "prefix": "popupclick",
        "body": [
            "logEventBySensors('ClickPopUpButton', {",
            "e_popup_page: ${1:pageName},",
            "e_operation_click: ${2:clickName}",
            "})",
        ],
        "description": "popupClick 快捷鍵"
    },
    "isZh 快捷鍵": {
        "scope": "",
        "prefix": "isZh",
        "body": [
            "const { i18n } = useTranslation();",
            "const isZh = i18n.language === 'zh';",
        ],
        "description": "isZh 快捷鍵"
    },
    "isEn 快捷鍵": {
        "scope": "",
        "prefix": "isEn",
        "body": [
            "const isEn = i18n.language === 'en';",
        ],
        "description": "isEn 快捷鍵"
    },
    "route 快捷鍵": {
        "scope": "",
        "prefix": "route",
        "body": [
            "const route = useRoute<RouteType<'AIReLoan_ManualApproval'>>();",
        ],
        "description": "route 快捷鍵"
    },
    "shadow 快捷鍵": {
        "scope": "",
        "prefix": "shadow",
        "body": [
            "shadowColor: 'rgba(0, 0, 0, 0.3)',",
            "shadowOffset: {",
            "width: 1,",
            "height: dpw(2),",
            "},",
            "shadowRadius: dpw(3),",
            "shadowOpacity: 0.3,",
            "backgroundColor: 'white',",
            "borderRadius: dpw(20),",
        ],
        "description": "shadow 快捷鍵"
    },
}
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容