Skip to content
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

Fix set data reactive #540

Merged
merged 4 commits into from
Apr 19, 2021
Merged

Fix set data reactive #540

merged 4 commits into from
Apr 19, 2021

Conversation

lmiller1990
Copy link
Member

Make data via mounting option reactive.

Closes #538

{},
{},
{ field: number | null },
{ isFieldNull: any }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately the type for this is not exported. I thought we had some way to type computed properties and vm 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't use the Options API, so I don't know... Shouldn't it be boolean though?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to VS Code it should be Computed<boolean> or something like that, but it is not exported from Vue. I shouldn't actually need to specify this here, but if I don't TS complains.

I have not used TS with Options API before so I have no idea 🤷‍♂️

{},
{},
{ field: number | null },
{ isFieldNull: any }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't use the Options API, so I don't know... Shouldn't it be boolean though?

@@ -123,4 +123,45 @@ describe('setData', () => {
'Cannot add property count'
)
})

it('https://github.com/vuejs/vue-test-utils-next/issues/538', async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nit: I prefer when we have a readable test name instead of just a link to a Github issue (easier to understand when the test is failing)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll update

@cexbrayat cexbrayat merged commit 7486952 into master Apr 19, 2021
@cexbrayat cexbrayat deleted the fix-set-data-reactive branch April 19, 2021 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

setData doesn't work
2 participants