mirror of
https://gitee.com/vuejs/vue.git
synced 2024-12-03 12:38:24 +08:00
add computed property ssr test case
This commit is contained in:
parent
e6871a33c1
commit
6f7ec7f04d
@ -173,6 +173,29 @@ describe('SSR: renderToString', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('computed properties', done => {
|
||||
renderVmWithOptions({
|
||||
template: '<div>{{ b }}</div>',
|
||||
data: {
|
||||
a: {
|
||||
b: 1
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
b () {
|
||||
return this.a.b + 1
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.a.b = 2
|
||||
expect(this.b).toBe(3)
|
||||
}
|
||||
}, result => {
|
||||
expect(result).toContain('<div server-rendered="true">3</div>')
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
it('renders asynchronous component', done => {
|
||||
renderVmWithOptions({
|
||||
template: `
|
||||
|
Loading…
Reference in New Issue
Block a user