update 0.9.2
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* @Author: yehuozhili
|
||||
* @Date: 2021-07-07 11:11:52
|
||||
* @LastEditors: yehuozhili
|
||||
* @LastEditTime: 2021-07-17 10:15:46
|
||||
* @LastEditTime: 2021-09-28 21:15:36
|
||||
* @FilePath: \dooringx\packages\dooringx-example\.umirc.ts
|
||||
*/
|
||||
import { defineConfig } from 'umi';
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* @Author: yehuozhili
|
||||
* @Date: 2021-07-07 14:51:17
|
||||
* @LastEditors: yehuozhili
|
||||
* @LastEditTime: 2021-09-27 21:44:56
|
||||
* @LastEditTime: 2021-09-28 16:33:32
|
||||
* @FilePath: \dooringx\packages\dooringx-example\src\layouts\index.tsx
|
||||
*/
|
||||
import { Button } from 'antd';
|
||||
@@ -19,7 +19,7 @@ import { locale } from 'dooringx-lib';
|
||||
import { localeKey } from '../../../dooringx-lib/dist/locale';
|
||||
export const config = new UserConfig(plugin);
|
||||
export const configContext = createContext<UserConfig>(config);
|
||||
config.i18n = false;
|
||||
//config.i18n = false;
|
||||
// 自定义右键
|
||||
const contextMenuState = config.getContextMenuState();
|
||||
const unmountContextMenu = contextMenuState.unmountContextMenu;
|
||||
@@ -84,12 +84,12 @@ export const LocaleContext = createContext<LocaleContextType>({
|
||||
|
||||
export default function Layout({ children }: IRouteComponentProps) {
|
||||
const [l, setLocale] = useState<localeKey>('zh-CN');
|
||||
// return (
|
||||
// <LocaleContext.Provider value={{ change: setLocale, current: l }}>
|
||||
// <IntlProvider messages={locale.localeMap[l]} locale={l} defaultLocale={l}>
|
||||
// <configContext.Provider value={config}>{children}</configContext.Provider>
|
||||
// </IntlProvider>
|
||||
// </LocaleContext.Provider>
|
||||
// );
|
||||
return (
|
||||
<LocaleContext.Provider value={{ change: setLocale, current: l }}>
|
||||
<IntlProvider messages={locale.localeMap[l]} locale={l} defaultLocale={l}>
|
||||
<configContext.Provider value={config}>{children}</configContext.Provider>
|
||||
</IntlProvider>
|
||||
</LocaleContext.Provider>
|
||||
);
|
||||
return <configContext.Provider value={config}>{children}</configContext.Provider>;
|
||||
}
|
||||
|
19
packages/dooringx-example/src/pages/document.ejs
Normal file
19
packages/dooringx-example/src/pages/document.ejs
Normal file
@@ -0,0 +1,19 @@
|
||||
<!--
|
||||
* @Author: yehuozhili
|
||||
* @Date: 2021-09-28 21:10:15
|
||||
* @LastEditors: yehuozhili
|
||||
* @LastEditTime: 2021-09-28 21:11:22
|
||||
* @FilePath: \dooringx\packages\dooringx-example\src\pages\document.ejs
|
||||
-->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Dooringx-example</title>
|
||||
</head>
|
||||
<script src="https://unpkg.com/react@17.0.1/umd/react.production.min.js"></script>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
@@ -2,7 +2,7 @@
|
||||
* @Author: yehuozhili
|
||||
* @Date: 2021-05-15 12:49:28
|
||||
* @LastEditors: yehuozhili
|
||||
* @LastEditTime: 2021-08-27 16:24:39
|
||||
* @LastEditTime: 2021-09-28 21:58:21
|
||||
* @FilePath: \dooringx\packages\dooringx-example\src\pages\index.tsx
|
||||
*/
|
||||
import {
|
||||
@@ -15,12 +15,13 @@ import {
|
||||
Control,
|
||||
} from 'dooringx-lib';
|
||||
import { InsertRowBelowOutlined } from '@ant-design/icons';
|
||||
import { useContext } from 'react';
|
||||
import { useContext, useState } from 'react';
|
||||
import { configContext, LocaleContext } from '@/layouts';
|
||||
import { useCallback } from 'react';
|
||||
import { PREVIEWSTATE } from '@/constant';
|
||||
import { Button, Popover } from 'antd';
|
||||
import { Button, Input, Popover } from 'antd';
|
||||
import { localeKey } from '../../../dooringx-lib/dist/locale';
|
||||
import { LeftRegistComponentMapItem } from 'dooringx-lib/dist/core/crossDrag';
|
||||
|
||||
export const HeaderHeight = '40px';
|
||||
const footerConfig = function () {
|
||||
@@ -45,6 +46,9 @@ export default function IndexPage() {
|
||||
}, [config]);
|
||||
|
||||
const [state] = useStoreState(config, subscribeFn, everyFn);
|
||||
|
||||
const [value, setValue] = useState('');
|
||||
|
||||
return (
|
||||
<div {...innerContainerDragUp(config)}>
|
||||
<div style={{ height: HeaderHeight }}>
|
||||
@@ -71,6 +75,22 @@ export default function IndexPage() {
|
||||
>
|
||||
切换语言
|
||||
</Button>
|
||||
<Input
|
||||
style={{ width: 200 }}
|
||||
value={value}
|
||||
onChange={(e) => setValue(e.target.value)}
|
||||
></Input>
|
||||
<Button
|
||||
onClick={() => {
|
||||
const leftprops: Partial<LeftRegistComponentMapItem> = {
|
||||
type: 'basic',
|
||||
img: 'https://img.guguzhu.com/d/file/android/ico/2021/09/08/rytzi2w34tm.png',
|
||||
};
|
||||
config.scriptSingleLoad(value, leftprops);
|
||||
}}
|
||||
>
|
||||
远程组件
|
||||
</Button>
|
||||
</div>
|
||||
<div
|
||||
style={{
|
||||
|
Reference in New Issue
Block a user