<el-dialog title="新增IP类型" v-model="dialogFormVisible" width="30%">
<el-form :model="form">
<el-form-item label="类型" :label-width="formLabelWidth">
<el-input v-model="form.type"></el-input>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button type="primary" @click="addData"
>确 定</el-button
>
</span>
</template>
</el-dialog>
//新增
addData(){
this.tableData.push({
name:this.form.type
});
//tableData是表格id,from是表单id,两边的值要相对应
this.dialogFormVisible = false
}
//删除
handleDelete(index, row) {
// 二次确认删除
this.$confirm('确定要删除吗?', '提示', {
type: 'warning',
confirmButtonText: "确定",
cancelButtonText: "取消",
})
.then(() => {
this.$message.success('删除成功');
this.tableData.splice(index, 1);
})
.catch(() => {
this.$message.error('删除失败');
});
},