Created
July 1, 2017 13:44
-
-
Save FernandoBasso/747a6d11138b82ec6c5ade8287c79264 to your computer and use it in GitHub Desktop.
App Vue + TypeScript problem...
This file contains hidden or 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
<script lang="ts"> | |
import Vue from 'vue'; | |
import Component from 'vue-class-component'; | |
@Component({ | |
// Renders just “title: ”... | |
template: '<div>title: {{ theTitle }}</div>' | |
}) | |
export default class App extends Vue { | |
private _title: string; | |
constructor() { | |
super(); | |
this._title = 'Original Title'; | |
console.info(this._title); // 'Original Title'. | |
} | |
get theTitle (): string { | |
console.info(this._title); // undefined!!!! | |
return this._title; | |
} | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem found.
https://vuejs.org/v2/api/#Options-Data