我用 HTML 创建了一个表单,其中包含几个描述新项目的字段,用户希望将其添加到所有项目的列表中:
<form v-on:submit.prevent="addItem" class="mt-3">
<div class="container">
<div class="input-field">
<div class="label-styling">Category</div>
<select v-model="selected" class="form-control">
<option disabled value="">Please select one</option>
<option v-for="category in categories" v-bind:value="categories">{{category}}</option>
</select>
</div>
<div class="input-field">
<div class="label-styling">Title</div>
<input type="text" v-model="title" class="form-control">
</div>
<div class="input-field">
<div class="label-styling">Description</div>
<input type="text" v-model="description" class="form-control">
</div>
<div class="input-field">
<div class="label-styling">Reference</div>
<input type="text" v-model="refNumber" class="form-control">
</div>
<div class="input-field">
<div class="label-styling">Image URL</div>
<input type="text" v-model="imageURL" class="form-control">
</div>
<div class="input-field">
<div class="label-styling">Stock</div>
<input type="text" v-model="stock" class="form-control col-lg-2">
</div>
</div>
</form>
我想在 Java 类中读取并保存从前端传递的值到后端。您能否向我推荐一篇关于该过程的好文章/视频,或者只是快速指导我完成它? 谢谢!
慕神8447489
相关分类