Skip to content

Configurations

Plugin Options

All features are enabled by default except the following.

Disabled by Default

  • exportExpose
  • exportProps
  • exportRender
  • setupSFC
  • booleanProp
  • shortBind

Disabled by Default when Vue >= 3.3

  • defineOptions
  • defineSlots
  • hoistStatic
  • shortEmits

You can re-enable them by setting the option to true.

ts
// vue-macros.config.[js,ts,json]

import { 
defineConfig
} from 'unplugin-vue-macros'
export default
defineConfig
({
root
: '/your-project-path',
/** * Vue version, 2 or 3. * * optional, detecting automatically. */
version
: 3,
/** Defaults to true */
defineModels
: {
unified
: true,
}, // Enable features
defineOptions
: true,
// Disable features
hoistStatic
: false,
// ... more features })

Refer to the macros and features page for available options.

Contributors

The avatar of contributor named as Kevin Deng Kevin Deng
The avatar of contributor named as zhiyuanzmj zhiyuanzmj
The avatar of contributor named as gaokefei gaokefei

Changelog