Sunday, 1 July 2018

Vue 3 : How to start making components

1. create component.vue and add this code structure inside it


<template>
<div>


</div>
</template>

<script>

export default {
data(){
return{
}
},
}
</script>


2. Looking add main.js and declare for the existence of the component


import Vue from 'vue'
import App from './App.vue'
import component from './components/component.vue'


Vue.component('component', component);

Vue.config.productionTip = false

new Vue({
render: h => h(App)
}).$mount('#app')



3. Looking for app.vue and add component selector and done!


<template>
<div">

<component></component>

</div>
<waddup></waddup>
</div>
</template>

<script>


export default {
data(){
return{
}
},
}
</script>

<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>

email mailto: pretext

 <a href="mailto:designoutsourced.com+info@gmail.com?subject=Maklumat%20lanjut%20pakej&body=Hai,%20saya%20berminat%20tahu%20lebi...