Answers for "main.js vuejs globale component"

7

vuejs import component

<template>
  <your-component></your-component>
</template>

<script>
  import YourComponent from '../components/YourComponent.vue'
  
  export default {
	components: {
      YourComponent // <=> YourComponent: 'YourComponent'
    }	
  };
</script>

<!-- OR -->

<script>
  export default {
	components: {
      YourComponent: () => import('your/component/path')
    }
  }
</script>
Posted by: Guest on December-21-2020
0

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);

// ...
Posted by: Guest on January-19-2021
0

VUE DECLARE COMPONENT IN MAIN.JS

Vue.component('MyComponentName', { /* ... */ })
Posted by: Guest on February-06-2021

Browse Popular Code Answers by Language