From 5a9de291690e8a803f4390d9fc2425587068ad71 Mon Sep 17 00:00:00 2001 From: Raymonzut <40148684+Raymonzut@users.noreply.github.com> Date: Sat, 25 Apr 2020 15:44:15 +0200 Subject: [PATCH] Add validator for Post prop id --- client/src/views/Post.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/src/views/Post.vue b/client/src/views/Post.vue index 4c6e07e..3f0e939 100644 --- a/client/src/views/Post.vue +++ b/client/src/views/Post.vue @@ -14,6 +14,10 @@ export default { id: { type: String, name: "id", + validator: val => { + const reg = /([0-9]|[a-f]){24}/ + return reg.test(val) + }, } } }