Base template to create new Vue component.
This template includes:
VueComponentTemplate
component insrc/components
- API documentation in
docs
usingvitepress
- Cypress component testing for
VueComponentTemplate
component incypress/component
- GitHub Actions for API documentation and Cypress component testing
- ESLint for
.js
and.vue
files insrc
- Create a new repository using this template (choose repository template when creating a new repo on GitHub and select this template).
- Update component name
VueComponentTemplate
toYourComponentName
. (See Updating Component Names for details). - Configure GitHub page for API documentation (Settings > GitHub Pages > Build and deployment > Change "Deploy from a branch" to "GitHub Actions").
- Run
npm install
. - Run
npm run serve
for development. - Run
npm run build-bundle
for production build to create bundle. - Run
npm run lint
for ESLint.
-
If you are using VSCode,
[Ctrl + Shift + F]
or[Cmd + Shift + F]
from the root directory, search for "vue-component-template" and replace it with your new component name. -
Do the same way for "VueComponentTemplate".
-
Rename
src/components/VueComponentTemplate.vue
andcypress/component/VueComponentTemplate.cy.js
to your new component name.
The API documentation is developed with vitepress
and vuese
. Documentation pages are in the docs
folder.
npm run docs:watch
This will start the documentation server with vitepress
on port :5173
and watch the components' changes.
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.
- VS Code + Vue - Official (previously Volar) and disable Vetur