dialog.vue

<style lang="less" scoped>
</style>
<template>
    <div style="height:100%;" v-loading="loading" loading-text="加载中..." loading-text-size="15"
        loading-type="1" :loading-size="160">
        <div>
            <Button @click="dialogAlert">Dialog.alert</Button>
            <Button @click="dialogAlert">Dialog.info</Button>
            <Button @click="dialogSuccess">Dialog.success</Button>
            <Button @click="dialogWarning">Dialog.warning</Button>
            <Button @click="dialogError">Dialog.error</Button>
            <Button @click="dialogConfirm">Dialog.confirm</Button>
            <Button @click="dialogInput">Dialog.input</Button>
            <Button @click="dialogTextarea">Dialog.textarea</Button>
        </div>
    </div>
</template>
<script type="text/javascript">
import { Vuex } from 'dai-vue';
export default {
    props: {},
    data() {
        return {
            loading: false
        };
    },
    components: {},
    methods: {
        async dialogAlert() {
            await this.$dialog.alert({ title: '提示', content: '内容已经删除!' });
        },
        async dialogSuccess() {
            await this.$dialog.success({ title: '成功', content: '成功' });
        },
        async dialogWarning() {
            await this.$dialog.warning({ title: '警告', content: '警告' });
        },
        async dialogError() {
            await this.$dialog.error({ title: '错误', content: '错误' });
        },
        async dialogConfirm() {
            let b = await this.$dialog.confirm({ title: '提示', content: '是否删除?' });
            await this.$dialog.alert({ title: '提示', content: b });
        },
        async dialogInput() {
            let text = await this.$dialog.input({ value: '123' });
            console.log('输入的内容', text);
        },
        async dialogTextarea() {
            let text = await this.$dialog.input({
                title: '请输入',
                value: '123',
                type: 'textarea',
                rules: [{ required: true, message: '此项为必填', trigger: 'blur,change' }]
            });
            console.log('输入的内容', text);
        }
    },
    watch: {},
    created() {},
    mounted() {},
    //计算属性
    computed: {
        ...Vuex.mapGetters(['vx_userInfo'])
    },
    destroyed() {}
};
</script>