mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-10 09:22:34 +00:00
Initial commit for nuxt
This commit is contained in:
parent
271fd62d8d
commit
3cb3910561
1047 changed files with 15090 additions and 175754 deletions
39
service/CarService.js
Normal file
39
service/CarService.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
export default class CarService {
|
||||
|
||||
brands = ['Vapid', 'Carson', 'Kitano', 'Dabver', 'Ibex', 'Morello', 'Akira', 'Titan', 'Dover', 'Norma'];
|
||||
|
||||
colors = ['Black', 'White', 'Red', 'Blue', 'Silver', 'Green', 'Yellow'];
|
||||
|
||||
generateCar(id) {
|
||||
return {
|
||||
id,
|
||||
vin: this.generateVin(),
|
||||
brand: this.generateBrand(),
|
||||
color: this.generateColor(),
|
||||
year: this.generateYear()
|
||||
}
|
||||
}
|
||||
|
||||
generateVin() {
|
||||
let text = "";
|
||||
let possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
|
||||
for (let i = 0; i < 5; i++) {
|
||||
text += possible.charAt(Math.floor(Math.random() * possible.length));
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
generateBrand() {
|
||||
return this.brands[Math.floor(Math.random() * Math.floor(10))];
|
||||
}
|
||||
|
||||
generateColor() {
|
||||
return this.colors[Math.floor(Math.random() * Math.floor(7))];
|
||||
}
|
||||
|
||||
generateYear() {
|
||||
return 2000 + Math.floor(Math.random() * Math.floor(19));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue