From aa4fb5ffffd21df4be5cb0382198323c616b54f4 Mon Sep 17 00:00:00 2001 From: Corentin Thomasset Date: Mon, 8 Jun 2020 20:03:15 +0200 Subject: [PATCH] fix: added quantity validation rules Signed-off-by: Corentin Thomasset --- CHANGELOG.md | 3 +++ src/routes/tools/UuidGenerator.vue | 25 ++++++++++++++++++++----- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d998429..81698d54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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/), 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 - [feat] [UuidGenerator] can generate multiple uuids diff --git a/src/routes/tools/UuidGenerator.vue b/src/routes/tools/UuidGenerator.vue index c4b3f1b0..16df536e 100644 --- a/src/routes/tools/UuidGenerator.vue +++ b/src/routes/tools/UuidGenerator.vue @@ -3,8 +3,17 @@ Uuid v4 generator - - + +
Refresh @@ -26,7 +35,13 @@ name: "UuidGenerator", data: () => ({ refreshBool: true, - quantity: 1 + quantity: 1, + rules: { + quantity: [ + v => !!v || 'Quantity is required', + v => v > 0 || 'Quantity should be > 0' + ] + } }), methods: { copyToken() { @@ -45,12 +60,12 @@