What is components? Component in vue js.


Components are reusable Vue instances with custom HTML elements. Components can be reused as many times as you want or used in another component, making it a child component. Data, computed, watch, and methods can be used in a Vue component. A website page creates by using of different-2 components.

Syntax Of Components.

<template>
    <div>
        //write code here.
    </div>
</template>

<script>

export default {
    name: "Create",
    components: {

    },
    props: {},
    data() {
    return {
        empployeeCreateFormAction: `${this.$serverUrl}employee/create`,
        employee: {
            first_name: "",
            last_name: "",
            email: "",
            mobile: "",
            password: "",
        },
    };
    },
    methods: {
    submitForm: function() {
        //here you can define methods loigcs.
       
    },
    },
    beforeMount() {
    // this.empployeeCreateFormAction = `${this.$appName}`;
    },
    beforeCreate: function() {
    //console.log(this.empployeeCreateFormAction); Note Working because this funation will be intialize after mounter

    console.log(this.$appName);
    console.log(this.$serverUrl);
    },
};
</script>