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

Commit 1666a8b

Browse files
authored
Merge pull request #39 from john-cheesman/add-capitalize-filter
Add missing capitalize filter to Home.vue
2 parents 0a43bd8 + 25c2f55 commit 1666a8b

File tree

1 file changed

+10
-2
lines changed
  • samples/VueCliSample/ClientApp/src/views

1 file changed

+10
-2
lines changed

samples/VueCliSample/ClientApp/src/views/Home.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,15 @@ import { Component, Vue} from 'vue-property-decorator';
2626
import { IWeatherForecast } from '../models/IWeatherForecast';
2727
import axios from 'axios';
2828
29-
@Component
29+
@Component({
30+
filters: {
31+
capitalize: function(value: string) {
32+
if (!value) return ''
33+
value = value.toString()
34+
return value.charAt(0).toUpperCase() + value.slice(1)
35+
}
36+
}
37+
})
3038
export default class Home extends Vue {
3139
private forecasts: IWeatherForecast[] = [{ summary: 'No data.' } as IWeatherForecast];
3240
private forecastCols: any[] = [
@@ -44,4 +52,4 @@ export default class Home extends Vue {
4452
}
4553
}
4654
}
47-
</script>
55+
</script>

0 commit comments

Comments
 (0)