-
-
Notifications
You must be signed in to change notification settings - Fork 121
feat: introduce jsx-macros #794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 22e745c The changes in this PR will be included in the next version bump. This PR includes changesets to release 34 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@vue-macros/api
@vue-macros/astro
@vue-macros/better-define
@vue-macros/boolean-prop
@vue-macros/chain-call
@vue-macros/config
@vue-macros/common
@vue-macros/define-emit
@vue-macros/define-models
unplugin-vue-define-options
@vue-macros/define-prop
@vue-macros/define-props
@vue-macros/define-props-refs
@vue-macros/define-render
@vue-macros/define-slots
@vue-macros/define-stylex
@vue-macros/devtools
@vue-macros/eslint-config
@vue-macros/export-expose
@vue-macros/export-props
@vue-macros/export-render
@vue-macros/hoist-static
@vue-macros/jsx-directive
@vue-macros/jsx-macros
vue-macros
@vue-macros/named-template
@vue-macros/nuxt
@vue-macros/reactivity-transform
@vue-macros/script-lang
@vue-macros/setup-block
@vue-macros/setup-component
@vue-macros/setup-sfc
@vue-macros/short-bind
@vue-macros/short-emits
@vue-macros/short-vmodel
@vue-macros/test-utils
@vue-macros/volar
commit: |
0ec37a2
to
b55fa5a
Compare
440a7b0
to
e9d2b1c
Compare
Description
This PR provides five macros for functional component.
defineComponent
Auto collects usage props to the props option.
Will be covert to
The destructuring-props will be auto restructure and collects to the props option.
The rest prop will be convert to
attrs
, And theinheritAttrs
option will defaults tofalse
.By the way you can define the attrs type.
Will be covert to
Support
await
expression andgetCurrentInstance()
co-usage.Support return JSX.
If the prop's default-value ends with
!
, The prop will be inferred as required.Usage
Will be convert to:
defineModel
await nextTick()
.Related issue: A defineModel property's value cannot be read correctly after modification until nextTick vuejs/core#11080
!
.Usage
defineExpose
just like in vue-setup.react
&preact
Setup
Usage
defineSlots
defineStyle
Support defining multiple style macros in a file.
Supported css pre-processors:
css
|scss
|sass
|less
|stylus
|postcss
.Support
css modules
, If the macro is an assignment expression.Support scoped mode.
false
.true
.Usage
Support CSS-variable and JS-variable binding.