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

在组件上使用decorator装饰器报错 #9300

Closed
NextBoy opened this Issue Jan 10, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@NextBoy
Copy link

NextBoy commented Jan 10, 2019

Version

2.5.17

What is actually happening?

the code

export const withLogin = function (Component): any {
  return class ComponentWithLogin extends Component {
  }
}
<template>
  <div>123{{ login }}</div>
</template>
<script>
  import Vue from 'vue'
  import { withLogin } from '../decorator'
  @withLogin
  class Hello extends Vue {
    login = false
  }
</script>

But it went wrong

vue-router.esm.js?8c4f:1897 TypeError: Cannot set property 'render' of undefined
    at normalizeComponent (componentNormalizer.js?2877:24)
    at eval (hello.vue?0739:8)
    at Module../src/views/hello.vue (1.js:59)
    at __webpack_require__ (app.js:767)
    at fn (app.js:130)
@vue-bot

This comment has been minimized.

Copy link
Contributor

vue-bot commented Jan 10, 2019

Hello, your issue has been closed because it does not conform to our issue requirements. In order to ensure every issue provides the necessary information for us to investigate, we require the use of the Issue Helper when creating new issues. Thank you!

@vue-bot vue-bot closed this Jan 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment