feat(XWebview): 添加当前 url 跳转功能
- 在 XWebview 组件中实现了当前 url 跳转的功能 - 通过 GlobalContext 获取全局上下文,调用 openLink 方法进行跳转 - 优化了用户体验,增加了页面跳转的灵活性
这个提交包含在:
父节点
e756dd4319
当前提交
049d2601f9
@ -12,6 +12,7 @@ import { SZYXLocalStorageHelper } from '../utils/SZYXLocalStorageHelper';
|
|||||||
import { SZYXLocalStorageKeys } from '../utils/SZYXLocalStorageKeys';
|
import { SZYXLocalStorageKeys } from '../utils/SZYXLocalStorageKeys';
|
||||||
import { XWebManager } from '../utils/XWebManager';
|
import { XWebManager } from '../utils/XWebManager';
|
||||||
import { TitleBarBtn } from '../view/SafeView';
|
import { TitleBarBtn } from '../view/SafeView';
|
||||||
|
import { GlobalContext } from '../ContextConfig';
|
||||||
|
|
||||||
@Entry({ routeName: 'XWebview' })
|
@Entry({ routeName: 'XWebview' })
|
||||||
@Component
|
@Component
|
||||||
@ -378,7 +379,7 @@ export struct XWebview {
|
|||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
this.controller.refresh()
|
this.controller.refresh()
|
||||||
} else if (index === 1) {
|
} else if (index === 1) {
|
||||||
|
GlobalContext.getContext().openLink(this.controller.getUrl())
|
||||||
} else {
|
} else {
|
||||||
pasteboard.getSystemPasteboard()
|
pasteboard.getSystemPasteboard()
|
||||||
.setData(pasteboard.createData(pasteboard.MIMETYPE_TEXT_PLAIN, this.controller.getUrl()), () => {
|
.setData(pasteboard.createData(pasteboard.MIMETYPE_TEXT_PLAIN, this.controller.getUrl()), () => {
|
||||||
|
|||||||
正在加载...
在新工单中引用
屏蔽一个用户