Sending a form

In this section, we are going to complete the NewTicket component that will allow the user to send a new support ticket. We need two fields to create a new ticket--title and description:

  1. In the template of the NewTicket.vue component, we can already add a SmartForm component with the title InputForm component:
      <SmartForm
title="New ticket"
:operation="operation"
:valid="valid">
<FormInput
name="title"
v-model="title"
placeholder="Short description (max 100 chars)"
maxlength="100"
required/>
</SmartForm>
  1. We can also add the two data properties, the operation method and some input validation with the valid computed property:
      <script>
export default {
data () {
return {
title: '',
description: '',
}
},

computed: {
valid () {
return !!this.title && !!this.description
},
},

methods: {
async operation () {
// TODO
},
},
}
</script>
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.109.201