diff options
Diffstat (limited to '')
-rw-r--r-- | CHANGELOG.md | 3 | ||||
-rw-r--r-- | src/routes/tools/UuidGenerator.vue | 25 |
2 files changed, 23 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d99842..81698d5 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 c4b3f1b..16df536 100644 --- a/src/routes/tools/UuidGenerator.vue +++ b/src/routes/tools/UuidGenerator.vue @@ -3,8 +3,17 @@ <v-card-title>Uuid v4 generator</v-card-title> <v-card-text> - <v-text-field outlined v-model="quantity" type="number" label="Quantity" dense class="quantity"/> - <v-textarea outlined v-model="token" class="centered-input" :rows="quantity <= 10 ? quantity : 10" readonly/> + <v-text-field + 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"> <v-btn @click="refreshBool = !refreshBool" depressed class="mr-4">Refresh</v-btn> @@ -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 @@ </script> <style scoped lang="less"> - .quantity{ + .quantity { width: 100px; margin: auto; text-align: center; - ::v-deep input{ + ::v-deep input { text-align: center; } } |