Commit 8572cbe7 authored by neogcg's avatar neogcg

3/4

parent c645b2bc
<template>
<el-button :type="multipleSelection.data.length ? 'primary' : 'info'"
:disabled="!multipleSelection.data.length" @click="del()">删 除</el-button>
<el-button
:type="multipleSelection.data.length ? 'primary' : 'info'"
:disabled="!multipleSelection.data.length"
@click="del()"
>删 除</el-button
>
</template>
<script>
import {mapGetters,mapActions} from 'vuex';
import { mapGetters, mapActions } from "vuex";
import { warningAlert } from "../../utils/alert";
export default {
props: {
props: {
multipleSelection2: {
type: Array,
default: () => {}
}
default: () => {},
},
},
components: {},
data() {
return {
multipleSelection: formInit(),
};
},
components: {},
data() {
return {
multipleSelection:formInit(),
};
},
watch: {
multipleSelection2: {
immediate: true,
handler(newV) {
this.multipleSelection = !!newV
this.multipleSelection = formInit(this.multipleSelection2)
this.multipleSelection = !!newV;
this.multipleSelection = formInit(this.multipleSelection2);
},
},
},
computed: {
...mapGetters({}),
},
methods: {
...mapActions({}),
del(){
this.$confirm('继续操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$emit("del")
}).catch(() => {
warningAlert("取消删除")
computed: {
...mapGetters({}),
},
methods: {
...mapActions({}),
del() {
this.$confirm("继续操作将永久删除, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$emit("del");
})
.catch(() => {
warningAlert("取消删除");
});
},
},
mounted() {},
},
},
mounted() {},
};
function formInit(data = []) {
return {
data
}
data,
};
}
</script>
<style scoped>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment