Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 849 Bytes

README.md

File metadata and controls

53 lines (35 loc) · 849 Bytes

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