vue表单提交之后,清空input里的数据

this.$refs.table.resetFields();
//table是表单的名称
例子:
html
      <el-form :rules="rules" ref="formLabelAlign" :label-position="labelPosition" label-width="120px" border :model="formLabelAlign" >
                            <el-form-item prop='page_name' label="电视台名称">
                                <el-input v-model="formLabelAlign.page_name" placeholder="网页名称(必填)"></el-input>
                            </el-form-item>
                            <el-form-item  prop='game_name' label="时段名称">
                                <el-input v-model="formLabelAlign.game_name" placeholder="游戏名称(必填)"></el-input>
                            </el-form-item>
                            <el-form-item prop='game_description' label="节目名称">
                                <el-input v-model="formLabelAlign.game_description" placeholder="游戏简介(必填)"></el-input>
                            </el-form-item>
                            <el-form-item prop='game_remark' label="备注">
                                <el-input v-model="formLabelAlign.game_remark" placeholder="游戏备注(选填)"></el-input>
                            </el-form-item>
                            <el-button class="but" @click="submit">确认提交</el-button>
              </el-form>
 
    <script>
      this.$refs.formLabelAlign.resetFields();
    </script>
posted @ 2020-05-11 10:46  小那  阅读(4093)  评论(0编辑  收藏  举报