[v2] There was a problem with creating a new Window on the front end #9381
-
<script setup lang="ts">
// This starter template is using Vue 3 <script setup> SFCs
// Check out https://vuejs.org/api/sfc-script-setup.html#script-setup
import Greet from "./components/Greet.vue";
import { Window } from '@tauri-apps/api/window';
const createWin = () => {
return new Window('home');
}
</script>
<template>
<div data-tauri-drag-region class="container">
<h1>Welcome to Tauri!</h1>
<div class="row">
<a href="https://vitejs.dev" target="_blank">
<img src="/vite.svg" class="logo vite" alt="Vite logo" />
</a>
<a href="https://tauri.app" target="_blank">
<img src="/tauri.svg" class="logo tauri" alt="Tauri logo" />
</a>
<a href="https://vuejs.org/" target="_blank">
<img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
</a>
</div>
<button @click="createWin">create window</button>
<Greet />
</div>
</template>
<style scoped>
.logo.vite:hover {
filter: drop-shadow(0 0 2em #747bff);
}
.logo.vue:hover {
filter: drop-shadow(0 0 2em #249b73);
}
</style>
When I click Create, the console gives me the following error: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
tauri info [✔] Environment [-] Packages [-] App |
Beta Was this translation helpful? Give feedback.
-
Did you try using WebviewWindow instead of Window? If that also doesn't work, please share your capability file. |
Beta Was this translation helpful? Give feedback.
Did you try using WebviewWindow instead of Window? If that also doesn't work, please share your capability file.