import { mapState,mapGetters } from 'vuex'
export default {
    data(){
        return {
            menuObj:{
				title:'',
				titleChild:'请选择门店',
				list: []
			},
			shopId:0
        }
    },
    computed:{
		...mapState({
			userShopAll:state=>state.user.userShopAll
        }),
        ...mapGetters({ 
            loginInfo: "getLoginInfo",
            userInfo: 'getUser'
    })
    },
  mounted () {
        this.menuObj.list = this.userShopAll.map(i=>({
            ...i,
            name:i.shopName
        }));
    },
	watch:{
    userShopAll (val) {
			if(!this.$util.isEmpty(val)) {
				this.menuObj.list = val.map(i=>({
					...i,
					name:i.shopName
				}));
			}
		}
	}
}