Git Product home page Git Product logo

element-seed's Introduction

element-seed

一个基于Es6 class 写法的element-ui种子项目

项目构建

# 安装依赖
npm install
# 或者使用淘宝镜像安装依赖(**地区),请勿使用cnpm安装相关依赖,可能会产生一些未知问题
npm i --registry=https://registry.npm.taobao.org

# 启动测试服务器
npm run dev

# 构建项目
npm run build

项目使用vue-cli构建,但cli生成的项目不支持webpack4,因此在项目中使用mini-css-extract-plugin替换掉了extract-text-webpack-plugin

项目中引入了vue-property-decoratorvuex-class,可用使用一系列的Decorator来构建Component以及使用decorator处理vuex的库
引入了element-datatables一个简洁的,服务器表格组件,通过一定的契约和简单的配置即可实现服务端数据展示的表格组件。
element组件信息请参见element

特点

  • 基于es6 class的写法,符合面向对象的编程**
  • 基于业务模块的代码拆分,将每个业务模块独立为插件,在项目中挂载插件即可实现增加业务模块的功能,适合团队开发
  • 动态主题和布局切换

关于模拟数据。

默认支持两种方式的模拟数据

  1. 可以修改 build/webpack.dev.conf.js中的devServer相关配置
const mockServer = require('./mock-server')
devServer: {
  ...
  before: mockServer //启用改配置
}

mock-server.js导出的是一个function,具体的请参考webpack说明
2. 修改data/index.js
这里使用mockjs生成测试数据,具体文档请参考mockjs文档

mockjs是一个纯前端的ajax拦截组件,如果使用mockjs,在浏览器测试时不会看到任何请求。
而使用mock-server是使用devServer处理请求,在浏览器端是完整的请求逻辑。

element-seed's People

Contributors

ldwqh0 avatar

Watchers

 avatar

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.