zserge / lorca

Build cross-platform modern desktop apps in Go + HTML5
MIT License
8.04k stars 535 forks source link

*.vue file how to use ui.Bind func #161

Closed WnagoiYy closed 2 years ago

WnagoiYy commented 3 years ago

main.go :

ui.Bind("onStart", func(dateInString string) string  {
            // perform the server side task here
            fmt.Println("app started", dateInString)
            return "return str"
        })

now, *.vue file how to use this ui.Bind "onStart" func? <img alt="Vue logo" src="./assets/logo.png" onclick="onStart"> this can't compile

gizmo-ds commented 3 years ago
<template>
  <img alt="Vue logo" src="./assets/logo.png" onclick="onStart" />
</template>

<script lang="ts" setup>
const onStart = () => {
  window.onStart();
};
</script>