8000 feat: add `defineSlots` macro and `slots` option by sxzz · Pull Request #7982 · vuejs/core · GitHub
[go: up one dir, main page]

Skip to content

feat: add defineSlots macro and slots option #7982

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

Merged
merged 14 commits into from
Apr 3, 2023
Prev Previous commit
Next Next commit
refactor: skip repeat checking
  • Loading branch information
sxzz committed Mar 31, 2023
commit fe5bae9df1638eabedfca162961432cf4e2ee327
5 changes: 3 additions & 2 deletions packages/compiler-sfc/src/compileScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1347,8 +1347,9 @@ export function compileScript(
const isDefineProps =
processDefineProps(init, decl.id) ||
processWithDefaults(init, decl.id)
const isDefineEmits = processDefineEmits(init, decl.id)
processDefineSlots(init, decl.id)
const isDefineEmits =
!isDefineProps && processDefineEmits(init, decl.id)
!isDefineEmits && processDefineSlots(init, decl.id)

if (isDefineProps || isDefineEmits) {
if (left === 1) {
Expand Down
1 change: 0 additions & 1 deletion packages/dts-test/defineComponent.test-d.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
SetupContext,
h,
SlotsType,
useSlots,
Slots
} from 'vue'
import { describe, expectType, IsUnion } from './utils'
Expand Down
0