-1
$(function(){
var app = new Vue({
      el:"#app",
      data: {
        testData: globalObj
      }
    });
});


html: 

<div id="app">
  <span v-text="globalObj.value"></span>
</div>

globalObj changes depending on options selected on a different page. The data updates correctly on initial load of the app, but when I change the options on another page (which updates globalObj) the values are not updated in the view. I was also able to get the view to update when I implicitly set/change globalObj.value in the console. Has anyone encountered this problem before?

2
  • Your braces and parenthesis don't match up Commented Apr 14, 2015 at 22:19
  • When you say "a different page" - do you mean a different HTML window? Javascript variables are not shared between windows. Commented Jun 20, 2015 at 15:46

1 Answer 1

2

A bit late to the party, but you should be referring to testData.

<span v-text="testData.value"></span>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.