1、自然是引入組件
<go-add-mod-win
width="1200"
:title="winTitle"
height="550"
@close="closeWin"
@addRecordToDb="addRecordToDb"
@modRecordToDb="modRecordToDb"
loadRecordAction="UserStore.loadRecord"
:recordId="curSelRecord"
:optionType="optionType"
v-model="showWinFlag"
>
<add-user-form></add-user-form>
</go-add-mod-win>
組件的參數列表
//是否相應底部工具欄
footerBar: { type: Boolean, default: true },
// 是否需要繼續按鈕
continueBtn: { type: Boolean, default: true },
// 是否需要確定按鈕
confirmBtn: { type: Boolean, default: true },
// 窗口高度
height: { type: [String, Number], default: 400 },
// 窗口寬度
width: { type: [String, Number], default: 450 },
// 窗口標題
title: { type: String, default: "" },
value: {},
recordId: { type: String, default: "" },
loadRecordAction: { type: String, default: "" },
// 操作類型 主要是修改 、刪除2種類型
optionType: { type: String, default: "add" },
// 表格對象的名稱
gridObjName: { type: String, default: "gridObj" },
modLoadData: { type: Boolean, default: true }
2、定義必須的參數:
其實只要定義標題,其他的都組件內置了,這樣點擊添加按鈕就可以彈出窗口咯