Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Bruno Predot
/
tmdb_test
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Bruno Predot
2025-04-26 13:02:28 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
979b131813801cada02f178d6861a7e7e5588a93
979b1318
1 parent
352cbf3b
Ajout type.
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
components/form/MovieCommentForm.vue
pages/movies/[id]/index.vue
type/commentForm.ts
components/form/MovieCommentForm.vue
View file @
979b131
...
...
@@ -2,6 +2,7 @@
//#region --Import--.
import { useVuelidate } from "@vuelidate/core";
import { helpers, maxLength, maxValue, minLength, minValue, required } from "@vuelidate/validators";
import type { Comment } from "~/type/commentForm";
//#endregion
//#region --Emit--.
...
...
@@ -20,7 +21,7 @@ defineProps({
//#endregion
//#region --Data/ref--.
const initialState = {
const initialState
: Comment
= {
username: "",
message: "",
rating: 5,
...
...
pages/movies/[id]/index.vue
View file @
979b131
...
...
@@ -7,6 +7,7 @@ import { Movie } from "~/models/movie";
import type { MovieInterface } from "~/interfaces/movie";
import { Credit } from "~/models/credit";
import type { CreditsResponse } from "~/interfaces/credit";
import type { Comment } from "~/type/commentForm";
//#endregion
//#region --Declaration--.
...
...
@@ -103,6 +104,10 @@ async function fetchCredits(id: number | string) {
}
}
function handleSubmitEvent(event: Comment) {
console.log('submitted', event)
}
//#endregion
//#region --Global event--.
...
...
@@ -178,7 +183,7 @@ onMounted(() => {
</div>
</div>
<!-- Comments form. -->
<form-movie-comment-form @event:submit="
console.log('submitted !', $event)
" />
<form-movie-comment-form @event:submit="
handleSubmitEvent
" />
</section>
</div>
</div>
...
...
type/commentForm.ts
0 → 100644
View file @
979b131
export
type
Comment
=
{
username
:
string
message
:
string
rating
:
number
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment