如果未更改,Vue Rails V模型剂量器会返回值

时间:2018-09-06 13:13:58

标签: vue.js vuejs2 axios vuex v-model

我的vue帖子中的对象值返回有问题,我在这里有字段:

<v-text-field type="string" :name="field.field_name" v-model="object[field.field_name]"  :value="object[field.field_name]"/>

字段中的逻辑

 export default {
   name: 'InputString',
   props: ['field','object'],
 }

现在我的axios.post:

axios.post('http://127.0.0.1:3001/'+this.$props.group.model+'/update_partial', {form_data: this.$store.state.group1.block_definitions, gdid: this.$props.group.uuid,  object_id: this.$route.path.split("/")[3]} ).then(response => {

在对象form_data中,我具有所有带有值的字段,在这里是对象:

isHidden:true
object:Object
address:“Münchnerstraße 44, 82131 Gauting”
comment:“fgdfg”
created_at:“2018-06-08T10:15:55.000Z”
customer_grade_id:null
employees:null
id:7
is_broke:null
name:“Orkun Günes GmbH”
turnover_pa:null
updated_at:“2018-06-08T10:15:55.000Z”

现在,当我更改字段值示例时:我在object [customername]中写入值“ Test-Kunde12321312312”

此值在我的api中的“值”字段中返回:

"field_definitions"=>[{"uuid"=>"1", "bduuid"=>"1", "name"=>"Customername", "field_type"=>"string", "field_name"=>"name", "attributes_from"=>nil, "js_function"=>nil, "controller_name"=>nil, "min"=>4, "max"=>64, "is_required"=>true, "values"=>"`Test-Kunde12321312312"`},

但其他字段没有“ values =>”

这里是一个例子:

{"uuid"=>"2", "bduuid"=>"1", "name"=>"Address", "field_type"=>"address", "field_name"=>"address", "attributes_from"=>nil, "js_function"=>nil, "controller_name"=>nil, "min"=>4, "max"=>64, "is_required"=>true},

那么,即使它们没有被更改,我如何获得所有值呢?

非常感谢

0 个答案:

没有答案