fix: added quantity validation rules
Signed-off-by: Corentin Thomasset <corentin.thomasset74@gmail.com>
This commit is contained in:
		
							parent
							
								
									e51a37844a
								
							
						
					
					
						commit
						aa4fb5ffff
					
				| @ -3,6 +3,9 @@ All notable changes to this project will be documented in this file. | |||||||
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||||||
| and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||||||
| 
 | 
 | ||||||
|  | ## Next | ||||||
|  | - [fix] [UuidGenerator] added quantity validation rules (prevent < 0) | ||||||
|  | 
 | ||||||
| ## 1.2.0 | ## 1.2.0 | ||||||
| - [feat] [UuidGenerator] can generate multiple uuids  | - [feat] [UuidGenerator] can generate multiple uuids  | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -3,8 +3,17 @@ | |||||||
|         <v-card-title>Uuid v4 generator</v-card-title> |         <v-card-title>Uuid v4 generator</v-card-title> | ||||||
| 
 | 
 | ||||||
|         <v-card-text> |         <v-card-text> | ||||||
|             <v-text-field outlined v-model="quantity" type="number" label="Quantity" dense class="quantity"/> |             <v-text-field | ||||||
|             <v-textarea outlined v-model="token" class="centered-input" :rows="quantity <= 10 ? quantity : 10" readonly/> |                     outlined | ||||||
|  |                     v-model="quantity" | ||||||
|  |                     type="number" | ||||||
|  |                     label="Quantity" | ||||||
|  |                     dense | ||||||
|  |                     class="quantity" | ||||||
|  |                     :rules="rules.quantity" | ||||||
|  |             /> | ||||||
|  |             <v-textarea outlined v-model="token" class="centered-input" :rows="quantity <= 10 ? quantity : 10" | ||||||
|  |                         readonly/> | ||||||
| 
 | 
 | ||||||
|             <div class="text-center"> |             <div class="text-center"> | ||||||
|                 <v-btn @click="refreshBool = !refreshBool" depressed class="mr-4">Refresh</v-btn> |                 <v-btn @click="refreshBool = !refreshBool" depressed class="mr-4">Refresh</v-btn> | ||||||
| @ -26,7 +35,13 @@ | |||||||
|         name: "UuidGenerator", |         name: "UuidGenerator", | ||||||
|         data: () => ({ |         data: () => ({ | ||||||
|             refreshBool: true, |             refreshBool: true, | ||||||
|             quantity: 1 |             quantity: 1, | ||||||
|  |             rules: { | ||||||
|  |                 quantity: [ | ||||||
|  |                     v => !!v || 'Quantity is required', | ||||||
|  |                     v => v > 0 || 'Quantity should be > 0' | ||||||
|  |                 ] | ||||||
|  |             } | ||||||
|         }), |         }), | ||||||
|         methods: { |         methods: { | ||||||
|             copyToken() { |             copyToken() { | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user