File tree Expand file tree Collapse file tree 2 files changed +26
-6
lines changed
src/components/Panels/Shared Expand file tree Collapse file tree 2 files changed +26
-6
lines changed Original file line number Diff line number Diff line change 99 " core:default" ,
1010 " fs:default" ,
1111 " http:default" ,
12+ " core:webview:allow-create-webview-window" ,
1213 {
1314 "identifier" : " http:allow-fetch" ,
1415 "allow" : [
Original file line number Diff line number Diff line change 22 <p v-if =" helplink" class =" btn-parent" >
33 <button
44 id =" HelpButton"
5- class =" btn btn-primary btn-xs" type =" button"
5+ class =" btn btn-primary btn-xs"
6+ type =" button"
67 @click =" helpButtonClick"
78 >
8- ⓘ Help
9+ ⓘ ; Help
910 </button >
1011 </p >
1112</template >
1213
1314<script lang="ts" setup>
15+ import { isTauri } from ' @tauri-apps/api/core'
16+ import { WebviewWindow } from ' @tauri-apps/api/webviewWindow'
17+ import { computed } from ' vue'
18+
1419const props = defineProps ({
15- obj: { type: Object, default: undefined },
20+ obj: { type: Object , default: undefined },
1621})
17- const helplink = props.obj ?. helplink
18- function helpButtonClick() {
19- window.open(helplink)
22+
23+ const helplink = computed (() => props .obj ?.helplink )
24+
25+ async function helpButtonClick() {
26+ const link = helplink .value
27+ if (! link ) return
28+
29+ if (await isTauri ()) {
30+ new WebviewWindow (` help-${Date .now ()} ` , {
31+ url: link ,
32+ title: ' Help - CircuitVerse' ,
33+ width: 1000 ,
34+ height: 700
35+ })
36+ } else {
37+ window .open (link , ' _blank' )
38+ }
2039}
2140 </script >
You can’t perform that action at this time.
0 commit comments