Vue-class-component: Example with imported components?

Created on 6 Apr 2017  路  6Comments  路  Source: vuejs/vue-class-component

Is there an example for including an imported Vue component?
E.g.
I'm trying to get from:

import FormSignUps from './FormSignUps.vue'
export default {
  data: () => ({
    scrollY: 0,
  }),
  components: {
    'FormSignUps': FormSignUps,
  },
}

to???

import Vue from 'vue'
import Component from 'vue-class-component'
import FormSignUps from './FormSignUps.vue'

@Component(props: {??})
export default class App extends Vue {
  scrollY = 0
  components: {
    'FormSignUps': FormSignUps,
  }
}

Most helpful comment

Ok figured it out. Could be a good idea to put this in the docs.

import Vue from 'vue'
import Component from 'vue-class-component'
import FormSignUps from './FormSignUps.vue'

@Component({
    components: {
        "FormSignUps": FormSignUps
    }
})
export default class App extends Vue {
  scrollY = 0
}

All 6 comments

Ok figured it out. Could be a good idea to put this in the docs.

import Vue from 'vue'
import Component from 'vue-class-component'
import FormSignUps from './FormSignUps.vue'

@Component({
    components: {
        "FormSignUps": FormSignUps
    }
})
export default class App extends Vue {
  scrollY = 0
}

Thanks man. This should really be in the docs.

Please put this in the docs 馃樋

oh my times, this must be in the docs.

I think it should be more explicit.

Was this page helpful?
0 / 5 - 0 ratings