Add Vue template

This commit is contained in:
Steve Sanderson
2017-03-09 10:04:54 +00:00
parent 0a1ac6a70a
commit 360688f78b
34 changed files with 988 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
import Vue from 'vue';
import { Component, Lifecycle } from 'av-ts';
interface WeatherForecast {
dateFormatted: string;
temperatureC: number;
temperatureF: number;
summary: string;
}
@Component
export default class FetchDataComponent extends Vue {
forecasts: WeatherForecast[] = [];
@Lifecycle mounted() {
fetch('/api/SampleData/WeatherForecasts')
.then(response => response.json() as Promise<WeatherForecast[]>)
.then(data => {
this.forecasts = data;
});
}
}