vue import component
// With Vue 3.2
<script setup>
import Btn from './components/Btn'
</script>
<template>
<Btn />
</template>
vue import component
// With Vue 3.2
<script setup>
import Btn from './components/Btn'
</script>
<template>
<Btn />
</template>
vue 3 create component
//-------------------- This is your main vue file
<template>
<h1>Your File Name Title</h1>
<p>Random text</p>
// now import your component here --- see below comments to find the component code
<ComponentName />
</template>
<script>
import ComponentName from '/componentlocation'
export default{
name: 'MainFile',
components: {
ComponentName
}}
</script>
//------------ This is the component code in a different file
<template>
<h1>This is the component</h1>
</template>
<script>
export default{
name: 'ComponentName'
}
</script>
vue js app component
// main.js
import { createApp } from 'vue'
import App from './App.vue'
import 'YourComponent' from 'YourFileOrLibrary';
const app = createApp(App);
app.component('yourComponent', YourFileOrLibrary);
// ...
vue create component
// Create Vue application
const app = Vue.createApp(...)
// Define a new component called todo-item
app.component('todo-item', {
template: `<li>This is a todo</li>`
})
// Mount Vue application
app.mount(...)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us