0👍
When creating a project with cli, an template is being initialized.
Find <div id="app>
in your index.html. This is the entry point where Vue app is being mounted to. Don’t place any vue elements inside it.
Vue application created in main.ts (if you’ve chosen TypeScript):
// main.ts
import { createApp } from "vue";
import App from "./App.vue";
const app = createApp(App);
app.mount("#app");
As you see, the app uses App.vue as a root component of the application. So, you can place your logic there. Check below simple example in composition-api syntax
// App.vue
<template>
<span>{{ message }} </span>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
const messagge = ref('');
onMounted(() => {
message.value = 'Hello World';
}
</script>
- [Vuejs]-How to close previous row after clicked view details of new row
- [Vuejs]-How get response in axios when api is steam like SSE (Server-Send Events)
Source:stackexchange.com