<template>
    <div class="Ad">
        <h1>{{title}}</h1>
    </div>
</template>

<script>
import { mapActions } from "vuex";

export default {
    
    name: "Ad",
    props: {
        title:{default: 'default'}
    },
    data() {
        return {};
    },
    
    created() {
        console.log(this.title)
    },
    methods: {
        ...mapActions(["fetch"]),
        get() {
            this.fetch({
                api: "aaa",
                method: "GET",
                data: {},
                success: res => {
                    console.log(res);
                },
                fail: err => {
                    console.log(err);
                    if (err.errMsg) this.$message.error(err.errMsg);
                    else this.$message.error("服务器发生异常");
                }
            });
        }
    }
};
</script>
