{ "函数组件模板": { "prefix": "tsx", "body": [ "// $CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE - by dev", "\n", "import { } from 'react'", "import { connect, ConnectProps } from 'umi'", "import {} from 'antd-mobile'", "import styles from './index.less'", "\n", "interface I$1 extends ConnectProps {", "}", "\n", "export default connect(({}: {}) => ({", "}))((props: I$1) => {", " return (", "
$1
", " )", "})", ], "description": "umi 函数组件模板" }, "model模板": { "prefix": "mts", "body": [ "import { ImmerReducer, Effect } from 'umi';", "import { SubscriptionsMapObject } from 'dva';", "import { } from './serve';", "\n", "export interface $1ModelState {", "}", "\n", "export interface $1ModelType {", " namespace: '$1';", " state: $1ModelState;", " effects: {", " };", " reducers: {", " save: ImmerReducer<$1ModelState>;", " reset: ImmerReducer<$1ModelState>;", " };", " subscriptions: SubscriptionsMapObject;", "}", "\n", "const initialState: $1ModelState = {", "}", "\n", "const $1Model: $1ModelType = {", " namespace: '$1',", " state: initialState,", " effects: {", " // *getFormList({ payload }, { call, put }) {", " // const response = yield call(getCaseForm, payload);", " // yield put({", " // type: 'save',", " // payload: response,", " // });", " //},", " },", " reducers: {", " save(state, { payload }: any) {", " return { ...state, ...payload }", " },", " reset(state, { payload }: any) {", " return { ...initialState }", " }", " },", " subscriptions: {}", "};", "\n", "export default $1Model;" ] } }