Skip to content

Another style of writing Vue components.

License

Notifications You must be signed in to change notification settings

yuxi-ovo/vue-vine

 
 

Repository files navigation

Vue Vine

Another style of writing Vue components.

  • NPM version:   NPM Version
  • VSCode extension:   VSCode ext version
  • Open VSX extension:   Open VSX ext version
  • Check more details in Vue Vine docs:   Netlify Status
Why this ?

There are many discussions in community that hopes for a solution that supports writing multiple Vue components in a single file. That's why Vue Vine was born.

Vue Vine was designed to provide more flexibility of managing Vue components. It is a parallel style to SFC.

Take a quick view:

Quick view

Try the demo

Use interactive commands(create-vue-vine) to create your first project. Look here: Project starter template

Or you can try it online: Vue Vine Playground

Relavant packages

Category Package Version Description
core @vue-vine/compiler NPM Version Compiler
core @vue-vine/language-server NPM Version Language Server
core @vue-vine/language-service NPM Version Language Service
core @vue-vine/vite-plugin NPM Version Vite Plugin
eslint @vue-vine/eslint-parser NPM Version ESLint Parser
eslint @vue-vine/eslint-plugin NPM Version ESLint Plugin
eslint @vue-vine/eslint-config NPM Version ESLint Config
nuxt @vue-vine/nuxt NPM Version Nuxt Module
tsc vue-vine-tsc NPM Version TypeScript CLI checker
CLI create-vue-vine NPM Version Project starter CLI

Install

# If you didn't install `@antfu/ni` yet, I highly recommend you to install it.
ni -D vue-vine

Use the plugin in vite.config.ts:

import { VineVitePlugin } from 'vue-vine/vite'

export default defineConfig({
  plugins: [
    // ...Other plugins
    VineVitePlugin()
  ],
})

Then add macro's type definition in tsconfig.json:

{
  "compilerOptions": {
    "types": ["vue-vine/macros"]
  }
}

For ESLint, install our custom ESLint config:

ni -D @vue-vine/eslint-config

You need to load the config into your flat configs.

import antfu from '@antfu/eslint-config'

// `VueVine()` returns a ESLint flat config
import VueVine from '@vue-vine/eslint-config'

export default antfu(
  {
    // First option is not Linter.FlatConfig,
    // it's a setting for antfu's config itself
  },
  ...VueVine(),
)

Finally, install the VSCode extension, search Vue Vine in the marketplace.

image

About

Another style of writing Vue components.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 97.7%
  • JavaScript 1.3%
  • Other 1.0%