1.0.3 • Published 3 years ago

my-apptop v1.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

my-apptop

自定义 top 组件

Install

安装方法
1、npm 安装
npm install my-apptop
2、yarn 安装
yarn add my-apptop

使用方法

<template>
  <div id="app">
    <myApp
      :logoSrc="logoSrc"
      :photoImg="photoImg"
      :systemList="systemList"
      :contact="contact"
      :news="news"
      :userData="userData"
      :mtName="mtName"
      v-on:toHome="toHome"
      v-on:headMenu="head_menu"
      v-on:exitSystem="exitSystem"
    ></myApp>
  </div>
</template>

<script>
import myapp from './components/myapp.vue'

export default {
  components: {
    myApptop: myapp
  },
  data() {
    return {
      logoSrc: "",
      //默认头像
      photoImg: "",
      systemList: "",
      contact: [],
      news: [],
      mtName: "管理中心",
      topNavSelect: "我的管理", //导航选中
      userData: "",
    };
  },
 
  methods: {
    toHome() {
      window.location.href = this.$wldsIndex;
    },
    //右上角菜单
    head_menu(name) {
      if (name == "person") {
        this.$router.push({ path: "/person/information", query: {} });
      } else if (name == "back") {
        this.$router.push({ path: "/person/information", query: {} });
        this.activeNavigation = "0";
      } else if (name == "exit") {
        console.log("1");
        this.$Modal.confirm({
          title: "提示",
          content: "<p>确认退出系统</p>",
          okText: "确认",
          cancelText: "取消",
          onOk: () => {
            window.location.href = this.$getexitSysUrl;
          },
          onCancel: () => {},
        });
      } else {
        return false;
      }
    },
    // 退出系统
    exitSystem() {
      this.$Modal.confirm({
        title: "提示",
        content: "<p>确认退出系统</p>",
        okText: "确认",
        cancelText: "取消",
        onOk: () => {
          window.location.href = this.$getexitSysUrl;
        },
        onCancel: () => {},
      });
    },
  },
}
</script>

全局安装

import myApptop from 'my-apptop'
Vue.use(myApptop)