1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <template>
- <div class="confirm-button">
- <a-popconfirm
- :title="title"
- :ok-text="okText"
- :cancel-text="cancelText"
- @confirm="confirm"
- @cancel="close"
- >
- <a-button v-if="buttonStatus" :type="buttonType">{{ text }}</a-button>
- <div v-else class="button_blue">{{ text }}</div>
- </a-popconfirm>
- </div>
- </template>
- <script lang="ts">
- import { defineComponent } from "vue";
- export default defineComponent({
- emits: ["confirm", "close"],
- props: {
- title: {
- type: String,
- default: "确认该操作吗?", //提示信息
- },
- okText: {
- type: String,
- default: "确认", //确认按钮
- },
- cancelText: {
- type: String,
- default: "取消", //取消按钮
- },
- text: {
- type: String,
- default: "确认", //按钮文案
- },
- buttonStatus: {
- type: Boolean,
- default: true, //按钮类型 默认为按钮
- },
- buttonType: {
- type: String,
- default: "primary", //按钮类型 默认为按钮
- },
- },
- setup() {},
- methods: {
- confirm() {
- this.$emit("confirm");
- // 确认
- },
- close() {
- this.$emit("close");
- // 取消
- },
- },
- });
- </script>
|