//app js
export default{
  data(){
    return {
      showAction:false,
      actions:[{ name: '选项一' }, { name: '选项二' }, { name: '选项三' }]
    };
  },
  props:['tpl'],
  mounted(){
    //onez.data(this,['items']);
  },
  watch:{
    appData(){
      this.actions=this.appData.menus;
    }
  },
  methods:{
    showMenu(){
      this.showAction=true;
      console.log(this.showAction);
    },
    onSelect(o){
      onez.location(o.href);
    },
    toAdmin(){
      window.open('?admin=1','','');
    },
    toLogin(){
      onez.onEvent({
        token:'page',
        action:'/login.php?mode=login',
        option:{
          auto_resize:true,
          width:380,
          height:400,
          title:'管理员登录'
        }
      });
    },
    logout(){
      onez.confirm('您确定要退出登录吗？',()=>{
        this.post({ac:'logout'},()=>{
          location.reload();
        });
      });
    }
  }
}