wip: render() should receive no args, expose props on renderContext as readonly

This commit is contained in:
Evan You
2019-09-03 15:27:59 -04:00
parent 9f63a54203
commit c5ec29ff9b
3 changed files with 21 additions and 29 deletions

View File

@@ -41,7 +41,8 @@ test('createComponent type inference', () => {
}
}
},
render(props) {
render() {
const props = this.$props
props.a && props.a * 2
props.b.slice()
props.bb.slice()
@@ -68,9 +69,9 @@ test('type inference w/ optional props declaration', () => {
a: 1
}
},
render(ctx) {
ctx.msg
ctx.a * 2
render() {
this.$props.msg
this.$data.a * 2
this.msg
this.a * 2
}
@@ -95,10 +96,10 @@ test('type inference w/ array props declaration', () => {
c: 1
}
},
render(ctx) {
ctx.a
ctx.b
ctx.c
render() {
this.$props.a
this.$props.b
this.$data.c
this.a
this.b
this.c