Skip to content

Commit

Permalink
fix ts error
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiram committed May 19, 2024
1 parent d8b151c commit 54a647e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/renderer/auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ export {}
declare global {
const MessagePlugin: typeof import('tdesign-vue-next')['MessagePlugin']
const TCPlayer: typeof import('tdesign-vue-next')['CPlayer']
const TIMEOUT: typeof import('tdesign-vue-next')['IMEOUT']
}
2 changes: 2 additions & 0 deletions src/renderer/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ declare module 'vue' {
TAside: typeof import('tdesign-vue-next')['Aside']
TBackTop: typeof import('tdesign-vue-next')['BackTop']
TBadge: typeof import('tdesign-vue-next')['Badge']
TBreadcrumb: typeof import('tdesign-vue-next')['Breadcrumb']
TBreadcrumbItem: typeof import('tdesign-vue-next')['BreadcrumbItem']
TButton: typeof import('tdesign-vue-next')['Button']
TCol: typeof import('tdesign-vue-next')['Col']
TCollapse: typeof import('tdesign-vue-next')['Collapse']
Expand Down
12 changes: 6 additions & 6 deletions src/renderer/src/pages/analyze/DialogIframe.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const props = defineProps({
const formVisible = ref(false);
const platformData = ref(props.data);
const webviewRef = ref(null);
const webviewRef = ref<any>(null);
const emit = defineEmits(['update:visible', 'platformPlay']);
Expand Down Expand Up @@ -92,8 +92,8 @@ const closeEvent = () => {
// 解析播放
const analysisEvent = () => {
const webviewCurrentUrl = webviewRef.value.getURL();
const webviewCurrentTitle = webviewRef.value.getTitle();
const webviewCurrentUrl = webviewRef.value!.getURL();
const webviewCurrentTitle = webviewRef.value!.getTitle();
console.log(webviewCurrentUrl, webviewCurrentTitle);
emit('platformPlay', webviewCurrentUrl, webviewCurrentTitle);
clearIframe();
Expand All @@ -103,17 +103,17 @@ const analysisEvent = () => {
// 后退
const backEvent = () => {
if (webviewRef.value.canGoBack()) webviewRef.value.goBack();
if (webviewRef.value!.canGoBack()) webviewRef.value!.goBack();
};
// 前进
const forwardEvent = () => {
if (webviewRef.value.canGoForward()) webviewRef.value.goForward();
if (webviewRef.value!.canGoForward()) webviewRef.value!.goForward();
};
// 刷新
const refreshEvent = () => {
webviewRef.value.reload();
webviewRef.value!.reload();
};
// 设置src为空
Expand Down

0 comments on commit 54a647e

Please sign in to comment.