Skip to content

Instantly share code, notes, and snippets.

@vahidhedayati
Created October 16, 2020 18:51
Show Gist options
  • Save vahidhedayati/45bd1895dc2e9a976c7ab8e7f2ebe2f0 to your computer and use it in GitHub Desktop.
Save vahidhedayati/45bd1895dc2e9a976c7ab8e7f2ebe2f0 to your computer and use it in GitHub Desktop.
HelloWorld.vue
import { Options, Vue } from 'vue-class-component'
import useProducts from '../composables/products'
@Options({
props: {
msg: String
}
})
export default class HelloWorld extends Vue {
msg!: string
// Class properties will be component data
count = 0
products=this.setup()
p={}
// Methods will be component methods
increment () {
this.count++
}
decrement () {
this.count--
}
async setup () {
console.log('awaiting')
return await useProducts()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment