delete.vue
1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<template>
<el-dialog :visible.sync="dialog.isDeleVisible" :show-close="false" class="deleteBox">
<div>确认删除“{{ deleData.name }}”?</div>
<div class="subBox">
<el-button @click="handleClose"> 取 消 </el-button>
<el-button type="primary" @click="handleSubmit"> 确 定 </el-button>
</div>
</el-dialog>
</template>
<script lang="ts">
import { Component, Vue, Prop, Watch } from 'vue-property-decorator'
@Component({
name: 'deleteDialog'
})
export default class extends Vue {
@Prop() private dialog!: {
isDeleVisible:boolean
}
@Prop() private userData!: {}
@Prop() private deleData!: {}
// 解决异步数据子组件获取不到数据
@Watch('userData')
getUserInfo(value: any) {
this.userData = value
}
// 功能函数
// 表单提交
private handleSubmit() {
this.$emit('delete')
this.handleClose()
}
// ui
// 表单取消
private handleClose() {
this.dialog.isDeleVisible = false
}
}
</script>
<style lang="scss">
</style>