8000 Support vuejs/vue-class-component · Issue #103 · vuejs/vetur · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support vuejs/vue-class-component #103

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

Closed
octref opened this issue Mar 23, 2017 · 5 comments
Closed

Support vuejs/vue-class-component #103

octref opened this issue Mar 23, 2017 · 5 comments
Milestone

Comments

@octref
Copy link
Member
octref commented Mar 23, 2017

This looks really awesome.

<template>
  <div>
    <input v-model="msg">
    <p>prop: {{propMessage}}</p>
    <p>msg: {{msg}}</p>
    <p>helloMsg: {{helloMsg}}</p>
    <p>computed msg: {{computedMsg}}</p>
    <button @click="greet">Greet</button>
  </div>
</template>

<script lang="ts">
import Vue from 'vue'
import Component from '../lib/index'
@Component({
  props: {
    propMessage: String
  }
})
export default class App extends Vue {
  propMessage: string
  // inital data
  msg: number = 123
  // use prop values for initial data
  helloMsg: string = 'Hello, ' + this.propMessage
  // lifecycle hook
  mounted () {
    this.greet()
  }
  // computed
  get computedMsg () {
    return 'computed ' + this.msg
  }
  // method
  greet () {
    alert('greeting: ' + this.msg)
  }
}
</script>
@fallenleavesguy
Copy link

But decorator in babel or typescript is not standard relatively to latest ECMAScript standard.

I think you can pending this feature until stable decorator has released.

@octref octref mentioned this issue May 8, 2017
12 tasks
@octref octref added this to the 1.0 milestone May 8, 2017
@octref
Copy link
Member Author
octref commented May 9, 2017

We have something even better for TS.

@octref octref closed this as completed May 9, 2017
@mrcrowl
Copy link
mrcrowl commented Jun 18, 2017

We have something even better for TS.

Any more details on this?

@octref
Copy link
Member Author
octref commented Jun 18, 2017

vuejs/vue#5887

@DanielRosenwasser
Copy link
Contributor

For the record, I think vue-class-component could still be supported, but I'd like to see the community response to the changes I've been working on.

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

No branches or pull requests

4 participants
0