v2.0.0
This commit is contained in:
@@ -1,26 +1,42 @@
|
||||
<template>
|
||||
<Modal :show="visible" @close="handleCancel" @after-leave="afterLeave" :closeBtn="false" :teleport="teleport">
|
||||
<main class="scroll" :class="[$style.main, { 'select': selection }]">{{message}}</main>
|
||||
<footer :class="$style.footer">
|
||||
<Btn :class="$style.btn" v-if="showCancel" @click="handleCancel">{{cancelBtnText}}</Btn>
|
||||
<Btn :class="$style.btn" @click="handleComfirm">{{confirmBtnText}}</Btn>
|
||||
</footer>
|
||||
</Modal>
|
||||
<Modal :show="visible" :close-btn="false" :teleport="teleport" @close="handleCancel" @after-leave="afterLeave">
|
||||
<main class="scroll" :class="[$style.main, { 'select': selection }]">{{ message }}</main>
|
||||
<footer :class="$style.footer">
|
||||
<Btn v-if="showCancel" :class="$style.btn" @click="handleCancel">{{ cancelBtnText }}</Btn>
|
||||
<Btn :class="$style.btn" @click="handleComfirm">{{ confirmBtnText }}</Btn>
|
||||
</footer>
|
||||
</Modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Modal from '@renderer/components/material/Modal'
|
||||
import Btn from '@renderer/components/base/Btn'
|
||||
import { useI18n } from '@renderer/plugins/i18n'
|
||||
import { computed } from '@common/utils/vueTools'
|
||||
export default {
|
||||
components: {
|
||||
Modal,
|
||||
Btn,
|
||||
},
|
||||
props: {
|
||||
afterLeave: {
|
||||
type: Function,
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
components: {
|
||||
Modal,
|
||||
Btn,
|
||||
setup() {
|
||||
const t = useI18n()
|
||||
|
||||
const defaultBtnTexts = computed(() => {
|
||||
return {
|
||||
confirm: t('confirm_button_text'),
|
||||
cancel: t('cancel_button_text'),
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
defaultBtnTexts,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -35,10 +51,10 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
cancelBtnText() {
|
||||
return this.cancelButtonText || this.$t('cancel_button_text')
|
||||
return this.cancelButtonText || this.defaultBtnTexts.cancel
|
||||
},
|
||||
confirmBtnText() {
|
||||
return this.confirmButtonText || this.$t('confirm_button_text')
|
||||
return this.confirmButtonText || this.defaultBtnTexts.confirm
|
||||
},
|
||||
},
|
||||
beforeUnmount() {
|
||||
|
||||
Reference in New Issue
Block a user