为什么Vue ElementUI Select组件发送文本而不是值?

时间:2017-11-20 09:14:01

标签: vue.js

当我通过单击提交按钮提交表单时,在选择ElementUI的组件中选择了一些选项,我收到了此选项的文本。有可能发送价值吗?我可以从Vue app看到价值,但不能在服务器端看到。

<div id="app">
    <el-form :inline="true" :model="formInline">
        <el-form-item>
        <el-select
                label="clients"
                name = "client_id"
                v-model="formInline.client_id"
                filterable
                remote
                placeholder="Client"
                :remote-method="getClient"
                :loading="loading">
            <el-option
                    v-for="item in clients"
                    :key="item.id"
                    :label="item.name"
                    :value="item.id">
            </el-option>
        </el-select>
        </el-form-item>
        <el-form-item>
            <el-date-picker
                    name = "date"
                    v-model="formInline.date"
                    type="month"
                    placeholder="Month">
            </el-date-picker>
        </el-form-item>
        <el-form-item>
            <el-button type="primary" @click="onSubmit" native-type="submit">Ok</el-button>
        </el-form-item>
    </el-form>
</div>

https://jsfiddle.net/6gqc5dj1/1/

0 个答案:

没有答案