This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 <script setup>
SFCs, check out the script setup docs to learn more.
npm install
npm run dev
npm run build
npm install
npm run dev
npm run build
The following dependencies are pre-installed:
- Vue
- Vue Router
- Vue GTM (Google Tag Manager)
The following dev dependencies are pre-installed:
- Vite
- Autoprefixer
- PostCSS
- TailwindCSS
You don't have to initialize the router first, that is already done. You can just add your routes to the router. You can also add routes to the router by adding them to the routes
array in the /src/router/index.js
file. There are already 2 routes defined in the router:
- Home
- Page not found
The Home
route is the default route, it will be the first route that is loaded when the user visits the site. The Page not found
route is the route that is loaded when the user visits a route that does not exist. Because both are necessary routes, they are already created in the router.
In the src/main.js
file you will find the configuration of the GTM object. Don't forget to add your GTM ID to the GTM object and to change 'debug' to 'false' when you are ready to deploy your site.
There are some comments in the template starting with TODO:
as a simple reminder. Some of the comments include a link to a tool online to help you with the specific todo. Once your done with the task you can simple remove the comment. Search TODO:
through all files to make sure you didn't miss any of them.