Base template to create new Vue component.
This template includes:
VueComponentTemplatecomponent insrc/components- API documentation in
docsusingvitepress - Cypress component testing for
VueComponentTemplatecomponent incypress/component - GitHub Actions for API documentation and Cypress component testing
- ESLint for
.jsand.vuefiles 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
VueComponentTemplatetoYourComponentName. (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 servefor development. - Run
npm run build-bundlefor production build to create bundle. - Run
npm run lintfor 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.vueandcypress/component/VueComponentTemplate.cy.jsto your new component name.
The API documentation is developed with vitepress and vuese. Documentation pages are in the docs folder.
npm run docs:watchThis 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