//app js
export default{
  data(){
    return {
       title:''
      ,aside:{}
      ,menus:{}
      ,user:{}
    };
  },
  props:['tpl'],
  mounted(){
    onez.data(this,['@title','@aside','@menus','@user']);
  },
  updated(){
    this.$nextTick(()=>{
      var bodyClass=$('body').attr('class').split(' ');
      var newClass=[];
      var classname='skin-green';
      if(this.$root.action.indexOf('/onez/')!=-1){
        classname='skin-purple';
      }else if(this.$root.action.indexOf('/design/')!=-1){
        classname='skin-yellow';
      }
      if(!$('body').hasClass(classname)){
        
        $('body').removeClass(function(index,className){
          return (className.match (/(^|\s)skin-\S+/g)||[]).join(' ');
        });
        $('body').addClass(classname);
      }
      $(window).trigger('resize');
    });
  },
  methods:{
    logout(){
      layer.confirm('您确定要退出当前账号吗？',function(index){
        layer.close(index);
        $.post(window.location.href,{action:'logout'},function(){
          location.reload();
        });
      });
    }
  }
}
