npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

me-admin-sdk-plus

v0.0.15

Published

一个真正开箱即用的后台管理系统模板

Downloads

9

Readme

me-admin-sdk

封装了 me-admin-template,使其真正的可开箱即用

示例:

npm 包

安装:npm install --save me-admin-sdk

项目引用

import 'element-ui/lib/theme-chalk/index.css' // element-ui样式
import 'nprogress/nprogress.css' // Progress 进度条样式
import MeAdminSdk from 'me-admin-sdk'
//注册api接口
//调用:this.$api.test.getInfo()
MeAdminSdk.registerApi('test', function(fetch) {
  return {
    getInfo(params) {
      return request({
        url: '/getinfo',
        method: 'get',
        params: params,
        data: {}
      })
    }
  }
})
//注册codes,一些通用方法
//调用:this.$codes.index_path
MeAdminSdk.registerCodes(null, function() {
  return {
    index_path: '/'
  }
})
MeAdminSdk.register(options)

vue.config.js 设置

module.exports = {
  //...
  configureWebpack: {
    resolve: {
      alias: {
        vue$: 'vue/dist/vue.esm.js'
      }
    }
  }
  //...
}

完整版

将依赖的 vue 全家桶及所有依赖的包一并打包到一个文件

相关依赖:vue,vuex,vue-router,element-ui,axios,nprogress 若不适用 this.$ui.pages.fetch 方法发送 ajax 请求则可以不引用 axios 若不需要线上顶部进度条则可以不引用 nprogress

<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<link rel="stylesheet" href="https://unpkg.com/[email protected]/nprogress.css">

// <script src="./me-admin-sdk-full.js"></script>
<script src="https://unpkg.com/me-admin-sdk/dist/me-admin-sdk-full.js"></script>
<script type="text/javascript">
      MeAdminSdk.register(options)
</script>

组件版

组件形式打包,打包时将依赖排除,使用时需要引用使用的依赖

<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<link rel="stylesheet" href="https://unpkg.com/[email protected]/nprogress.css">

<script src="https://unpkg.com/[email protected]/dist/vue.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/vuex.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/vue-router.min.js"></script>
<script src="https://unpkg.com/[email protected]/lib/index.js"></script>
<script src="https://unpkg.com/[email protected]/dist/axios.min.js"></script>
<script src="https://unpkg.com/[email protected]/nprogress.js"></script>
<script src="https://unpkg.com/me-admin-sdk/dist/me-admin-sdk.js"></script>
<script type="text/javascript">
      MeAdminSdk.register(options)
</script>

options

{
  //要绑定的节点,若需要自定义实例则传递 {el:null}
  el: '#app',//自定义 vue 实例 {el:null}
  //vue实例
  currentAppKey: '__currentApp',
  // vue路由 必须验证(authName!=null),若不验证,则需使用skipauth:true
  router:{
    routes: [],
  },
  // vuex store
  store: {
    state: {},
    getters: {},
    mutations: {},
    actions: {}
  },
  // 系统信息
  sysInfo: {
    //登录名
    authName: '超级管理员',
    //系统标题
    sysTitle: 'XXXX后台管理系统',
    //默认主题颜色
    sysTheme: '#409EFF',
    //菜单图标列表
    iconList: ['iconfont icon-system','el-icon-info'],//手动引入图标库,传入其class名
    //菜单
    menus: [{
        menuId: 'a3361b3ceada4fc8bc1a65969fb652b9',
        menuName: '控制台',
        menuIcon: 'iconfont icon-dashboard',
        menuCode: 'home',
        children: null//可多级嵌套
    }],
    //权限模块 路由name值
    modules: ['system_admin_list'],//['*'] 为超级管理员权限
    //首页访问路由
    indexPath: '/',
    //登录访问路由
    loginPath: '/login',
    //退出访问路由
    logoutPath: '/logout'
  }
},