Skip to content

Instantly share code, notes, and snippets.

@justinyoo justinyoo/parent-component.vue Secret
Created Mar 21, 2017

Embed
What would you like to do?
Using IoC Container in Vue.js and TypeScript App
// ParentComponent.vue
<template>
<child-component></child-component>
</template>
<script>
import ChildComponent from './ChildComponent'
const MyDependency = {
foo: 'bar'
}
export default {
name: 'parent',
provide: {
MyDependency
}
}
</script>
@c01nd01r

This comment has been minimized.

Copy link

commented Mar 22, 2017

You forgot add ChildComponent to components field in export default {}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.