更新wails3版本及nuxt版本
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { ref, onMounted, onUnmounted } from 'vue'
|
||||
import {GreetService} from "../../bindings/changeme";
|
||||
import {Events} from "@wailsio/runtime";
|
||||
|
||||
@@ -19,12 +19,18 @@ const doGreet = () => {
|
||||
});
|
||||
}
|
||||
|
||||
let cancelTimeListener = null;
|
||||
|
||||
onMounted(() => {
|
||||
Events.On('time', (timeValue) => {
|
||||
cancelTimeListener = Events.On('time', (timeValue) => {
|
||||
time.value = timeValue.data;
|
||||
});
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
cancelTimeListener?.();
|
||||
})
|
||||
|
||||
defineProps({
|
||||
msg: String,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user