【发布时间】:2021-10-23 15:28:49
【问题描述】:
我是 Vue 的新手,我需要一些帮助来从输入字段中获取值:
在我的表格中,我有:
<input type="hidden" id="groupId" value="1">
如果我使用 jQuery,我会这样做:
var group_id = $('#groupId').val();
但是,在 Vue 中我不知道如何绑定隐藏字段:
<div id="app">
<input type="text" v-model="groupId"> //Where do I put the value?
</div>
new Vue({
el: '#app',
data: {
groupId: //What do I put here to get the field's value?
}
我怎样才能做到这一点?
【问题讨论】:
标签: javascript vue.js