Skip to content

fix: remove $emit $attrs $slots #13655

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports[`compile > bindings 1`] = `
"import { child as _child, toDisplayString as _toDisplayString, setText as _setText, renderEffect as _renderEffect, template as _template } from 'vue';
const t0 = _template("<div> </div>", true)

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const n0 = t0()
const x0 = _child(n0)
_renderEffect(() => _setText(x0, "count is " + _toDisplayString(_ctx.count) + "."))
Expand Down Expand Up @@ -55,7 +55,7 @@ exports[`compile > directives > custom directive > basic 1`] = `
"import { withVaporDirectives as _withVaporDirectives, template as _template } from 'vue';
const t0 = _template("<div></div>", true)

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const n0 = t0()
_withVaporDirectives(n0, [[_ctx.vExample]])
return n0
Expand All @@ -66,7 +66,7 @@ exports[`compile > directives > custom directive > binding value 1`] = `
"import { withVaporDirectives as _withVaporDirectives, template as _template } from 'vue';
const t0 = _template("<div></div>", true)

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const n0 = t0()
_withVaporDirectives(n0, [[_ctx.vExample, () => _ctx.msg]])
return n0
Expand All @@ -77,7 +77,7 @@ exports[`compile > directives > custom directive > dynamic parameters 1`] = `
"import { withVaporDirectives as _withVaporDirectives, template as _template } from 'vue';
const t0 = _template("<div></div>", true)

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const n0 = t0()
_withVaporDirectives(n0, [[_ctx.vExample, () => _ctx.msg, _ctx.foo]])
return n0
Expand All @@ -88,7 +88,7 @@ exports[`compile > directives > custom directive > modifiers 1`] = `
"import { withVaporDirectives as _withVaporDirectives, template as _template } from 'vue';
const t0 = _template("<div></div>", true)

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const n0 = t0()
_withVaporDirectives(n0, [[_ctx.vExample, () => _ctx.msg, void 0, { bar: true }]])
return n0
Expand All @@ -99,7 +99,7 @@ exports[`compile > directives > custom directive > modifiers w/o binding 1`] = `
"import { withVaporDirectives as _withVaporDirectives, template as _template } from 'vue';
const t0 = _template("<div></div>", true)

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const n0 = t0()
_withVaporDirectives(n0, [[_ctx.vExample, void 0, void 0, { "foo-bar": true }]])
return n0
Expand All @@ -110,7 +110,7 @@ exports[`compile > directives > custom directive > static parameters 1`] = `
"import { withVaporDirectives as _withVaporDirectives, template as _template } from 'vue';
const t0 = _template("<div></div>", true)

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const n0 = t0()
_withVaporDirectives(n0, [[_ctx.vExample, () => _ctx.msg, "foo"]])
return n0
Expand All @@ -121,7 +121,7 @@ exports[`compile > directives > custom directive > static parameters and modifie
"import { withVaporDirectives as _withVaporDirectives, template as _template } from 'vue';
const t0 = _template("<div></div>", true)

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const n0 = t0()
_withVaporDirectives(n0, [[_ctx.vExample, () => _ctx.msg, "foo", { bar: true }]])
return n0
Expand All @@ -142,7 +142,7 @@ exports[`compile > directives > v-pre > basic 1`] = `
"import { template as _template } from 'vue';
const t0 = _template("<div :id=\\"foo\\"><Comp></Comp>{{ bar }}</div>", true)

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const n0 = t0()
return n0
}"
Expand All @@ -153,7 +153,7 @@ exports[`compile > directives > v-pre > should not affect siblings after it 1`]
const t0 = _template("<div :id=\\"foo\\"><Comp></Comp>{{ bar }}</div>")
const t1 = _template("<div> </div>")

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const _component_Comp = _resolveComponent("Comp")
const n0 = t0()
const n3 = t1()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports[`compiler: expression > props 1`] = `
"import { toDisplayString as _toDisplayString, setText as _setText, renderEffect as _renderEffect, template as _template } from 'vue';
const t0 = _template(" ")

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const n0 = t0()
_renderEffect(() => _setText(n0, _toDisplayString($props.foo)))
return n0
Expand All @@ -26,7 +26,7 @@ exports[`compiler: expression > props aliased 1`] = `
"import { toDisplayString as _toDisplayString, setText as _setText, renderEffect as _renderEffect, template as _template } from 'vue';
const t0 = _template(" ")

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const n0 = t0()
_renderEffect(() => _setText(n0, _toDisplayString($props['bar'])))
return n0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function render(_ctx) {
exports[`compiler: element transform > component > do not resolve component from non-script-setup bindings 1`] = `
"import { resolveComponent as _resolveComponent, createComponentWithFallback as _createComponentWithFallback } from 'vue';

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const _component_Example = _resolveComponent("Example")
const n0 = _createComponentWithFallback(_component_Example, null, null, true)
return n0
Expand All @@ -28,7 +28,7 @@ exports[`compiler: element transform > component > generate multi root component
"import { createComponent as _createComponent, template as _template } from 'vue';
const t0 = _template("123")

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const n0 = _createComponent(_ctx.Comp)
const n1 = t0()
return [n0, n1]
Expand All @@ -38,7 +38,7 @@ export function render(_ctx, $props, $emit, $attrs, $slots) {
exports[`compiler: element transform > component > generate single root component 1`] = `
"import { createComponent as _createComponent } from 'vue';

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const n0 = _createComponent(_ctx.Comp, null, null, true)
return n0
}"
Expand Down Expand Up @@ -71,7 +71,7 @@ exports[`compiler: element transform > component > resolve component from setup
exports[`compiler: element transform > component > resolve component from setup bindings 1`] = `
"import { createComponent as _createComponent } from 'vue';

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const n0 = _createComponent(_ctx.Example, null, null, true)
return n0
}"
Expand All @@ -97,7 +97,7 @@ exports[`compiler: element transform > component > resolve namespaced component
exports[`compiler: element transform > component > resolve namespaced component from props bindings (non-inline) 1`] = `
"import { createComponent as _createComponent } from 'vue';

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const n0 = _createComponent(_ctx.Foo.Example, null, null, true)
return n0
}"
Expand All @@ -113,7 +113,7 @@ exports[`compiler: element transform > component > resolve namespaced component
exports[`compiler: element transform > component > resolve namespaced component from setup bindings 1`] = `
"import { createComponent as _createComponent } from 'vue';

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const n0 = _createComponent(_ctx.Foo.Example, null, null, true)
return n0
}"
Expand Down Expand Up @@ -191,7 +191,7 @@ export function render(_ctx) {
exports[`compiler: element transform > component > v-for on component should not mark as single root 1`] = `
"import { createComponent as _createComponent, createFor as _createFor } from 'vue';

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const n0 = _createFor(() => (_ctx.items), (_for_item0) => {
const n2 = _createComponent(_ctx.Comp)
return n2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ exports[`compiler v-bind > with constant value 1`] = `
"import { setProp as _setProp, template as _template } from 'vue';
const t0 = _template("<div f=\\"foo1\\" h=\\"1\\"></div>", true)

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const n0 = t0()
_setProp(n0, "a", void 0)
_setProp(n0, "b", 1 > 2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports[`v-html > should convert v-html to innerHTML 1`] = `
"import { setHtml as _setHtml, renderEffect as _renderEffect, template as _template } from 'vue';
const t0 = _template("<div></div>", true)

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const n0 = t0()
_renderEffect(() => _setHtml(n0, _ctx.code))
return n0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ exports[`compiler: vModel transform > should support member expression 1`] = `
"import { applyTextModel as _applyTextModel, template as _template } from 'vue';
const t0 = _template("<input>")

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const n0 = t0()
const n1 = t0()
const n2 = t0()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const t2 = _template("<div></div>")
const t3 = _template("<input>")
_delegateEvents("click", "contextmenu", "mouseup", "keyup")

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const n0 = t0()
const n1 = t1()
const n2 = t0()
Expand Down Expand Up @@ -143,7 +143,7 @@ exports[`v-on > expression with type 1`] = `
const t0 = _template("<div></div>", true)
_delegateEvents("click")

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const n0 = t0()
n0.$evtclick = e => _ctx.handleClick(e)
return n0
Expand Down Expand Up @@ -479,7 +479,7 @@ exports[`v-on > simple expression 1`] = `
const t0 = _template("<div></div>", true)
_delegateEvents("click")

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const n0 = t0()
n0.$evtclick = _ctx.handleClick
return n0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports[`compiler: v-once > basic 1`] = `
"import { child as _child, next as _next, toDisplayString as _toDisplayString, setText as _setText, setClass as _setClass, template as _template } from 'vue';
const t0 = _template("<div> <span></span></div>", true)

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const n2 = t0()
const n0 = _child(n2)
const n1 = _next(n0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports[`v-text > should convert v-text to setText 1`] = `
"import { child as _child, toDisplayString as _toDisplayString, setText as _setText, renderEffect as _renderEffect, template as _template } from 'vue';
const t0 = _template("<div> </div>", true)

export function render(_ctx, $props, $emit, $attrs, $slots) {
export function render(_ctx, $props) {
const n0 = t0()
const x0 = _child(n0)
_renderEffect(() => _setText(x0, _toDisplayString(_ctx.str)))
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler-vapor/src/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export function generate(
const args = ['_ctx']
if (bindingMetadata && !inline) {
// binding optimization args
args.push('$props', '$emit', '$attrs', '$slots')
args.push('$props')
}
const signature = (options.isTS ? args.map(arg => `${arg}: any`) : args).join(
', ',
Expand Down