Giter Club home page Giter Club logo

ultimate-vue-template's Introduction

Ultimate Vue Template (very opinionated)

One template to rule them all (not really :P) Powered by a bunch of awesome plugins, tailored to make creating your next server-side generated Vue 3 app a breeze

This project template includes following features:

โœˆ๏ธ Vue 3 and Vite 2 - Allowing you to develop at speed of light

๐Ÿ—‚๏ธ File based routing - follow best practices and keep everything organized

๐Ÿ“ฆ Components auto importing - Remove unnecessary boilerplate

๐Ÿ“‘ Layout system - Style parts of your app differently

๐ŸŽจ Windi CSS - Utility-first CSS framework for making UIs fast

Inspirations for this repo

Recommended IDE Setup

VSCode(IDE) + Vetur(Extension) Make sure to enable vetur.experimental.templateInterpolationService in settings!

Type Support For .vue Imports in TS

Vetur has a good support for .vue components as of recently, if they are imported directly in <script> tag. However, since components in this setup are auto-imported, If you want to have support for auto-imported components, Volar will recognize components.d.ts file generated at the root of the project which will provide type definitions (I chose to opt-out that file from version control, but you can make that decision for yourself)

To Properly Configure TS version

  1. Open src/main.ts in VSCode
  2. Open the VSCode command palette
  3. Search and run "Select TypeScript version" -> "Use workspace version"

How to use this repo

File based routing, auto-importing components & layout

File based routing & auto-importing of components are very similar to the way Framework Nuxt.js handles them, that I'll link it's documentation, and just explain differences:

Differences:

  • Dynamic routes are written like [id].vue instead of _id.vue(feature for support of underscore is still experimental in one of the plugins)
  • Components are also auto imported in other components, not just the pages
  • You can override route object with custom <route> block inside pages, and one of it's properties layout will wrap the page with the component of the same name, as the value of that property that's found in layouts folder

NPM commands

  • Spin up development server npm run dev
  • Bundle app for production npm run build which will generate dist folder
  • Preview generated production-ready app npm run preview
Contributions are welcome!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.