ソースを参照

Merge branch 'master' of http://192.168.1.41:3000/outaozhen/cldV2react

outaozhen 5 年 前
コミット
b671808844
2 ファイル変更21 行追加14 行削除
  1. 17 13
      config/config.js
  2. 4 1
      src/pages/Customer/Test/index.jsx

+ 17 - 13
config/config.js

@@ -1,43 +1,47 @@
 // https://umijs.org/config/
-import { defineConfig } from 'umi';
-import defaultSettings from './defaultSettings';
-import proxy from './proxy';
-import routes from './routes';
-const { REACT_APP_ENV } = process.env;
+import { defineConfig } from 'umi'
+import defaultSettings from './defaultSettings'
+import proxy from './proxy'
+import routes from './routes'
+const { REACT_APP_ENV } = process.env
 export default defineConfig({
   hash: true,
   antd: {},
   dva: {
-    hmr: true,
+    hmr: true
   },
   history: {
-    type: 'browser',
+    type: 'browser'
   },
   locale: {
     // default zh-CN
     default: 'zh-CN',
     antd: false,
     // default true, when it is true, will use `navigator.language` overwrite default
-    baseNavigator: false,
+    baseNavigator: false
   },
   dynamicImport: {
-    loading: '@/components/PageLoading/index',
+    loading: '@/components/PageLoading/index'
   },
   targets: {
-    ie: 11,
+    ie: 11
   },
   // umi routes: https://umijs.org/docs/routing
   routes,
   // Theme for antd: https://ant.design/docs/react/customize-theme-cn
   theme: {
-    'primary-color': defaultSettings.primaryColor,
+    'primary-color': defaultSettings.primaryColor
   },
   title: false,
   ignoreMomentLocale: true,
   proxy: proxy[REACT_APP_ENV || 'dev'],
   manifest: {
-    basePath: '/',
+    basePath: '/'
   },
   exportStatic: {},
   esbuild: {},
-});
+  extraBabelPlugins: [
+    '@babel/plugin-proposal-nullish-coalescing-operator',
+    '@babel/plugin-proposal-optional-chaining'
+  ]
+})

+ 4 - 1
src/pages/Customer/Test/index.jsx

@@ -87,7 +87,10 @@ const Test = ({ natures, dispatch }) => {
   }, [])
 
   const a = useMemo(() => {
-    console.log('依赖项更新了')
+    const e = null
+    const b = 2
+    const c = e ?? b
+    console.log('c', c)
   }, [state])
   // const customOptions = useCallback(originNode => {
   //   return originNode