Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

Commit

Permalink
Merge pull request #39 from john-cheesman/add-capitalize-filter
Browse files Browse the repository at this point in the history
Add missing capitalize filter to Home.vue
  • Loading branch information
EEParker authored Jan 9, 2020
2 parents 0a43bd8 + 25c2f55 commit 1666a8b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions samples/VueCliSample/ClientApp/src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@ import { Component, Vue} from 'vue-property-decorator';
import { IWeatherForecast } from '../models/IWeatherForecast';
import axios from 'axios';
@Component
@Component({
filters: {
capitalize: function(value: string) {
if (!value) return ''
value = value.toString()
return value.charAt(0).toUpperCase() + value.slice(1)
}
}
})
export default class Home extends Vue {
private forecasts: IWeatherForecast[] = [{ summary: 'No data.' } as IWeatherForecast];
private forecastCols: any[] = [
Expand All @@ -44,4 +52,4 @@ export default class Home extends Vue {
}
}
}
</script>
</script>

0 comments on commit 1666a8b

Please sign in to comment.