Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

<a-textarea :rows="4"  v-decorator="['desc',  {rules:  [{required:  true}}]"></a-textarea>
edit  (record)  {

    console.log('record is', record)

    this.visible  =  true

    const  { form:  { setFieldsValue }  }  =  this

    this.$nextTick(()  =>  {

        setFieldsValue(pick(record,  []))

    })

},

比如在这里拿到record数据, 然后把record.content回填到textarea中, 该怎么回填


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.7k views
Welcome To Ask or Share your Answers For Others

1 Answer

一:
你可以把desc改成content,然后这样赋值
<a-textarea :rows="4" v-decorator="['content', {rules: [{required: true}}]"></a-textarea>

this.setFieldsValue(pick(record, 'content'))

二:
不使用pick

this.setFieldsValue({desc: record.content})

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...