From 4dc0f3f3babe0039b6aacc74202c1bc9bb493a00 Mon Sep 17 00:00:00 2001 From: npmrun <1549469775@qq.com> Date: Thu, 5 Aug 2021 21:16:54 +0800 Subject: [PATCH] add --- a.md | 3 ++- src/main/facilities/main/index.ts | 3 +-- src/render/views/Layout/index.module.scss | 3 +++ src/render/views/Layout/index.tsx | 45 ++++++++++++++++--------------- types/global.d.ts | 1 + 5 files changed, 30 insertions(+), 25 deletions(-) diff --git a/a.md b/a.md index 90b4af1..e8c819f 100644 --- a/a.md +++ b/a.md @@ -21,4 +21,5 @@ https://www.jianshu.com/p/4699b825d285 https://blueprintjs.com/ https://chakra-ui.com/ https://www.npmjs.com/package/node-fetch - https://developer.mozilla.org/zh-CN/docs/Web/API/Fetch_API/Using_Fetch \ No newline at end of file + https://developer.mozilla.org/zh-CN/docs/Web/API/Fetch_API/Using_Fetch + react-desktop \ No newline at end of file diff --git a/src/main/facilities/main/index.ts b/src/main/facilities/main/index.ts index 4fdf679..a29d83e 100644 --- a/src/main/facilities/main/index.ts +++ b/src/main/facilities/main/index.ts @@ -28,10 +28,9 @@ export default function showWindow(url?: string) { minWidth: 800, minHeight: 600, icon: __static + "/icon.png", - // show: false, // frame: false, // 去除原生的菜单 // transparent: true, // 背景透明 - alwaysOnTop: true, + alwaysOnTop: false, webPreferences: { nodeIntegration: true, contextIsolation: false, diff --git a/src/render/views/Layout/index.module.scss b/src/render/views/Layout/index.module.scss index c18f215..a6b2b3b 100644 --- a/src/render/views/Layout/index.module.scss +++ b/src/render/views/Layout/index.module.scss @@ -1,5 +1,8 @@ + .Layout { height: 100vh; + position: relative; + transform:scale(1,1); .left { position: fixed; left: 0; diff --git a/src/render/views/Layout/index.tsx b/src/render/views/Layout/index.tsx index 14ffc24..de62bc3 100644 --- a/src/render/views/Layout/index.tsx +++ b/src/render/views/Layout/index.tsx @@ -1,8 +1,9 @@ import { Icon, IconName } from "@blueprintjs/core" -import route, {useRoute} from "@render/route" -import React from "react" +import route, { useRoute } from "@render/route" +import React, { Fragment } from "react" import { NavLink, useLocation } from "react-router-dom" import style from "./index.module.scss" +import { TitleBar, Toolbar, Text } from "react-desktop/macOs" // interface IProps { // render(): ReactElement @@ -16,50 +17,49 @@ export default function Layout(props: any) { } interface TList { - icon: IconName; - path: string; - title: string; - text: string; + icon: IconName + path: string + title: string + text: string } - const list: TList[]= [ + const list: TList[] = [ { path: "/home", icon: "time", title: "添加闹钟", - text: "闹钟" + text: "闹钟", }, { path: "/about", icon: "mugshot", title: "添加闹钟", - text: "关于" + text: "关于", }, { path: "/float", icon: "mugshot", title: "浮动框测试", - text: "浮动" + text: "浮动", }, ] - return ( - isLayout ? ( + return isLayout ? (
- {list.map((v,i)=>( - -
- -
{v.text}
- {v.path==curRoute.path&&(
)} -
-
+ {list.map((v, i) => ( + +
+ +
{v.text}
+ {v.path == curRoute.path &&
} +
+
))}
- +
@@ -67,6 +67,7 @@ export default function Layout(props: any) {
- ) : () + ) : ( + ) } diff --git a/types/global.d.ts b/types/global.d.ts index e8c51da..d80f37e 100644 --- a/types/global.d.ts +++ b/types/global.d.ts @@ -13,3 +13,4 @@ declare const __staticVar: string; declare module "*.md" +declare module 'react-desktop/macOs';