Hello developers in this tutorial we will discuss about how to create components and pass data and functions
S.no | Contents-topics |
---|---|
1 | What are components |
2 | Setup new Vue js project |
3 | Create new components(parent and child) |
4 | Router file |
5 | Run the Code |
Components are piece of code that we can reuse means we can call components in any parent component or its child component
For setting up new vue js project pls consider link given below
Create a parent component view file src/views/Parent.vue
code for Parent.vue : Copy
Create a child component src/components/Child.vue
code for Child.vue : Copy
If your project don't have default router file consider below post for how to create custom route file in vue js
code for route.js :Copy
To check and run the project simply hit npm run dev on the cmd
0 Comments (Please let us know your query)