vite-plugin-vue-setup-extend

Extending the vue script setup syntactic sugar
564,863 158
Install
npm install vite-plugin-vue-setup-extend
Latest Version:0.4.0
License:MIT
Last Updated:Apr 18, 2022
Links: GitHub  ·  npm
Maintainer: vvben

vite-plugin-vue-setup-name-support

Make the vue script setup syntax support the name attribute

Install (yarn or npm)

node version: >=12.0.0

vite version: >=2.0.0

yarn add vite-plugin-vue-setup-extend -D

or

npm i vite-plugin-vue-setup-extend -D

Usage

  • Config plugin in vite.config.ts. In this way, the required functions can be introduced as needed
import { defineConfig, Plugin } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueSetupExtend from 'vite-plugin-vue-setup-extend'

export default defineConfig({
  plugins: [vue(), vueSetupExtend()],
})
  • SFC
<template>
  <div>hello world {{ a }}</div>
</template>

<script lang="ts" setup name="App">
  const a = 1
</script>

Sample project

Vben Admin

License

MIT

Related Packages

@vitejs/plugin-vue

The official plugin for Vue SFC support in Vite.

333,357,380 686
vite-plugin-checker

Vite plugin that runs TypeScript type checker on a separate process.

133,975,562 1,242
@vitejs/plugin-vue-jsx

Provides Vue 3 JSX & TSX support with HMR.

93,663,827 686
vite-plugin-ssr

Like Next.js/Nuxt but as do-one-thing-do-it-well Vite plugin.

550,634 18
vite-plugin-md

Markdown for Vite

496,869 640

Version History

Version Released License
0.4.0 MIT
0.3.0 MIT
0.1.0 MIT