-
-
Save justinyoo/77113f9810c45caf66b28ceaa80417b9 to your computer and use it in GitHub Desktop.
Using IoC Container in Vue.js and TypeScript App
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hello.vue | |
<template> | |
<div class="hello"> | |
<h1>{{ msg }}</h1> | |
<ninja></ninja> | |
<h2>Essential Links</h2> | |
... | |
</template> | |
<script lang="ts"> | |
import Hello from "./Hello.ts"; | |
export default Hello; | |
</script> | |
// Hello.ts | |
import Vue from "vue"; | |
import Component from "vue-class-component"; | |
import Ninja from "./Ninja.vue"; | |
@Component({ | |
name: "Hello", | |
components: { | |
"ninja": Ninja | |
} | |
}) | |
export default class Hello extends Vue { | |
msg: string = "Hello World"; | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment