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 accessCache proto #2416

Merged
merged 1 commit into from
Oct 19, 2020
Merged

fix accessCache proto #2416

merged 1 commit into from
Oct 19, 2020

Conversation

LongTengDao
Copy link
Contributor

@LongTengDao LongTengDao commented Oct 18, 2020

fix problems

Vue.createApp({
  template: `<div>{{ hasOwnProperty }}</div>`,
  data () {
    return {
      hasOwnProperty: 3,
    };
  },
}).mount('body');

production mode: Can't find prop hasOwnProperty on instance.ctx while renderring, which should on instance.data in fact, but skipped by switch(n) check. See PublicInstanceProxyHandlers.get.


development mode: Seems right on UI, but in fact, it's readed from instance.ctx copy, not instance.data, so when the prop value is Vue.ref(3), there will be { "_rawValue": 3, "_shallow": false, "__v_isRef": true, "_value": 3 } but not 3 on the UI.

Vue.createApp({
  template: `<div>{{ hasOwnProperty }}</div>`,
  data () {
    return {
      hasOwnProperty: Vue.ref(3),
    };
  },
}).mount('body');

@yyx990803 yyx990803 merged commit ba881f9 into vuejs:master Oct 19, 2020
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.

None yet

2 participants