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

Component doesn't change because reactive data doesn't update #1229

Closed
rob-digital opened this issue Jul 16, 2020 · 3 comments
Closed

Component doesn't change because reactive data doesn't update #1229

rob-digital opened this issue Jul 16, 2020 · 3 comments

Comments

@rob-digital
Copy link

What problem does this feature solve?

Hi folks.
I came across an issue in which a component is depending on the reactive data but it doesn't change because the reactive data is not refreshing. I have a navigation drawer which should highlight an active element depending on scroll to this element. The reactive data doesn't want to update and also the active item doesn't change. It's seems to work only when I click the component in the vue-devtool panel. Any ideas why is that? Is it going to work in the production mode?

Specifically, the "model" data property doesn't change unless I click the component name in the dev tools panel.

Thanks for the interest

What does the proposed API look like?

data: () => ({
     drawer: null,
     model: {
       type: Number,
       require: false
     },


computed: {

if (this.currentScroll >= this.currentPositions[0].top ) {
              for(let i = 0; i < this.currentPositions.length; i  ) {

               if (this.currentScroll >= this.currentPositions[i].top && this.currentScroll <= this.currentPositions[i].bottom) {
                 return   this.model = i
                 }
           }
       } else {
          return this.model = -1
       }
   },
}```

<!-- generated by vue-issues. DO NOT REMOVE -->
@rob-digital
Copy link
Author

It was created by the issue helper...

@AtofStryker
Copy link

I am also running into this. Looks like reactivity breaks sometimes when vue dev tools is turned on. If I close the console and refresh the browser it fixes the issue

@Akryum
Copy link
Member

Akryum commented Jul 21, 2020

It was created by the issue helper...

Please use the bug reporting part of the issue helper:

image

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

No branches or pull requests

3 participants