Giter Site home page Giter Site logo

vue-role's Introduction

介绍

  • 项目使用了vue-admin-template的layout布局文件
  • axios 进行了api模块化,增加多个请求接口
  • 路由动态化进行权限验证,目前有三种角色,可在mete中定义访问权限, 详见router文件夹
  • store也分了模块化,利于管理和按需引入
  • 新加数据字典
   export default {
   	install: Vue => {
   		//加载数据字典
   		axios.get("https://mock.yonyoucloud.com/mock/10610/MGT/System/DataDictionary/GetDataDictionaryList.ashx").then(res => {
   			if (res.res == 0) {
   				Vue.prototype.$D = new xDictionary(res.data);
   			}
   		})
   		//挂载xStorage
   		Vue.prototype.$xStorage = xStorage
   		//$emit提交 $on 处理 事件总线
   		Vue.prototype.$E = new Vue(); 
   		//---------全局方法 ---------------//
   		String.prototype.timeFormat = Date.prototype.timeFormat = function(format) {
   			let time = this;
   			let o = {
   				"M+": time.getMonth() + 1,
   				"d+": time.getDate(),
   				"H+": time.getHours(),
   				"m+": time.getMinutes(),
   				"s+": time.getSeconds(),
   				"q+": Math.floor((time.getMonth() + 3) / 3), //季度
   				"f+": time.getMilliseconds() //毫秒
   			};
   			if (/(y+)/.test(format))
   				format = format
   				.replace(RegExp.$1, time.getFullYear() + "")
   				.substr(4 - RegExp.$1.length);
   			for (let k in o) {
   				if (new RegExp("(" + k + ")").test(format))
   					format = format.replace(
   						RegExp.$1,
   						RegExp.$1.length == 1 ?
   						o[k] :
   						("00" + o[k]).substr(("" + o[k]).length)
   					);
   			}
   			return format;
   		};
   	}
   }

Getting started

# clone the project
git clone https://github.com/Yun-G/vue-role.git

# enter the project directory
cd vue-role

# install dependency
yarn install or yarn

# develop
yarn serve

This will automatically open http://localhost:8080

关于作者

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.