Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

我希望不同的窗口通过URL类似值为“/login”,"/main"这样的方式区分不同的页面路由地址。 #3353

Open
lujihong opened this issue Mar 29, 2024 · 4 comments
Labels
Enhancement New feature or request

Comments

@lujihong
Copy link

Is your feature request related to a problem? Please describe.

这两个窗口的URL我希望像以下代码中的编写方式,两个窗口分别对应不同的路由地址,但是我发现这样写没效果,始终打开的是"/"根路由。

window1 := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
Name: "main",
Title: "主界面",
Width: 400,
Height: 300,
DisableResize: true,
Frameless: true,
AlwaysOnTop: false,
Hidden: true,

	DevToolsEnabled:        false,
	OpenInspectorOnStartup: false,

	DefaultContextMenuDisabled: false,
	Centered:                   true,
	ShouldClose: func(window *application.WebviewWindow) bool {
		window.Hide()
		return false
	},
	BackgroundType: application.BackgroundTypeTransparent,
	Windows: application.WindowsWindow{
		HiddenOnTaskbar:                   false,
		DisableFramelessWindowDecorations: true,
		BackdropType:                      application.None,
	},
             URL: "/main",
})

window2 = app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
	Name:          "login",
	Title:         "登录",
	Width:         480,
	Height:        480,
	DisableResize: true,
	Frameless:     true,
	AlwaysOnTop:   false,
	Hidden:        false,

	DevToolsEnabled:        false,
	OpenInspectorOnStartup: false,

	DefaultContextMenuDisabled: false,
	Centered:                   true,
	ShouldClose: func(loginWindow *application.WebviewWindow) bool {
		loginWindow.Hide()
		return false
	},
	BackgroundType: application.BackgroundTypeTranslucent,
	Windows: application.WindowsWindow{
		HiddenOnTaskbar:                   false,
		DisableFramelessWindowDecorations: false,
		BackdropType:                      application.Mica,
		CustomTheme: &application.ThemeSettings{
			DarkModeTitleBar:           windows.RGB(20, 20, 20),
			DarkModeTitleBarInactive:   windows.RGB(0, 0, 0),
			DarkModeTitleText:          windows.RGB(200, 200, 200),
			DarkModeTitleTextInactive:  windows.RGB(150, 150, 150),
			DarkModeBorder:             windows.RGB(255, 255, 255),
			DarkModeBorderInactive:     windows.RGB(225, 225, 225),
			LightModeTitleBar:          windows.RGB(200, 200, 200),
			LightModeTitleBarInactive:  windows.RGB(240, 240, 240),
			LightModeTitleText:         windows.RGB(20, 20, 20),
			LightModeTitleTextInactive: windows.RGB(50, 50, 50),
			LightModeBorder:            windows.RGB(255, 255, 255),
			LightModeBorderInactive:    windows.RGB(225, 225, 225),
		},
	},
	BackgroundColour: application.NewRGB(255, 255, 255),
             URL: "/login",
})

Describe the solution you'd like

我希望不同的窗口通过URL类似值为“/login”,"/main"这样的方式进行区分不同的路由地址。

Describe alternatives you've considered

No response

Additional context

No response

@lujihong lujihong added the Enhancement New feature or request label Mar 29, 2024
@leaanthony
Copy link
Member

请按照此处的 Wails 3 反馈指南进行操作:https://v3alpha.wails.io/getting-started/feedback/

@lujihong
Copy link
Author

在这里反馈? https://discord.gg/3mgVyGua 这个地址邀请失效?

@leaanthony
Copy link
Member

leaanthony commented Apr 2, 2024

I have fixed the link now 👍
我现在已经修复了链接 👍
https://discord.gg/Vgff2p8gsy

@lujihong
Copy link
Author

lujihong commented Apr 4, 2024

我成功接受了邀请,但是没有发帖的权限

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants