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

support use unReactivity data in Template #10110

Closed
zhangshichun opened this issue Jun 6, 2019 · 3 comments
Closed

support use unReactivity data in Template #10110

zhangshichun opened this issue Jun 6, 2019 · 3 comments

Comments

@zhangshichun
Copy link

What problem does this feature solve?

for example in render function:

const a = 'Hello world unReactivity'

export default {
render(c){
return c(div,[a])
}
}

here the a is not a reactivity data,but when we use template,it seems that we must make a to be a reactivity data?sometimes is not in need.

What does the proposed API look like?

<template>
<div>
{{ a }}
</div>
</template>
<script>
export default {
unReactivity:{
a: 'Hello world unReactivity'
}
}
</script>
@flyyang
Copy link
Contributor

flyyang commented Jun 6, 2019

Try this:

const a = 'Hello world unReactivity'
export default {
  data () {
     return {
        a,
     }
  }
}

@zhangshichun
Copy link
Author

Try this:

const a = 'Hello world unReactivity'
export default {
  data () {
     return {
        a,
     }
  }
}

now,the 'a' is reactivity. if 'a' is a big Object,performance overhead may be big;'computed' is a light choose,but if there are many 'a',is also a lot performance overhead.
so i wish has a method to use unReactivity data.

@Justineo
Copy link
Member

Justineo commented Jun 6, 2019

Duplicate of #2637

@Justineo Justineo marked this as a duplicate of #2637 Jun 6, 2019
@Justineo Justineo closed this as completed Jun 6, 2019
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