zoukankan      html  css  js  c++  java
  • el-dialog 新增与编辑同时使用

        <el-dialog :title="title"  :visible.sync="shareDialogVisible" v-if="shareDialogVisible" width="30%">
          <el-form ref="form" :model="form" :rules="rules" label-width="33%" >
            <el-form-item label="状态:" prop="ifEnabled">
              <el-col :span="22">
                <el-select class="w" v-model="form.ifEnabled" placeholder="请选择状态">
                  <el-option
                    v-for="item in optionsStatus"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-col>
            </el-form-item>
          </el-form>
          <span slot="footer" class="dialog-footer">
            <el-button class="mr10" @click="shareDialogVisible=false">取 消</el-button>
            <el-button type="primary" @click="submitForm('form')">确 定</el-button>
          </span>
        </el-dialog>
    created() {
        this.formCopy=JSON.parse(JSON.stringify(this.form))
      },
       // 新增或编辑
        async handleClick(row) {
          let that = this;
          if (row) {
            this.title = "编辑";
            console.log(row)
            this.form=row;
          } else {
            this.title = "新增";
            this.form=JSON.parse(JSON.stringify(this.formCopy))
          }
           this.shareDialogVisible = true; 
        },
  • 相关阅读:
    sendmessage参数
    combobox添加选项
    sql数据库时间转换convert
    Javascript知识四(DOM)
    Javascript知识三
    JavaScript知识(二)
    JavaScript知识(一)
    三层架构
    ADO知识的运用二(Day 28)
    SQL知识三(Day 27)
  • 原文地址:https://www.cnblogs.com/dianzan/p/13453592.html
Copyright © 2011-2022 走看看