Skip to content

Commit

Permalink
Merge pull request #36 from leezng/dev
Browse files Browse the repository at this point in the history
release 1.1.0
  • Loading branch information
leezng authored Feb 1, 2019
2 parents 20115b9 + 506a465 commit cdc2f6b
Show file tree
Hide file tree
Showing 16 changed files with 199 additions and 45 deletions.
16 changes: 8 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- "7"
- "10"

cache:
directories:
Expand All @@ -23,16 +23,16 @@ jobs:
- stage: gh_pages
script: npm run build
after_script:
- cd ./example-dist
- git init
- git remote add origin "https://${GH_TOKEN}@${GH_REF}"
- git checkout -b gh-pages
- git clone -b gh-pages "https://${GH_TOKEN}@${GH_REF}" gh-pages
- rm -r gh-pages/*
- cp -r example-dist/. gh-pages
- cd ./gh-pages
- git config user.name "leezng"
- git config user.email "[email protected]"
- git add .
- git commit -m "update example page"
- git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" gh-pages:gh-pages
- git commit -m "update gh-pages"
- git push --quiet "https://${GH_TOKEN}@${GH_REF}" gh-pages:gh-pages

env:
global:
- GH_REF: github.com/leezng/el-form-renderer.git
- GH_REF: github.com/leezng/element-patch.git
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# element-patch

基于 [element-ui](https://github.com/ElemeFE/element) 的扩展包。我们对一些组件,例如 Table, Menu, Form 等进行扩展,丰富其特性与功能,同时增加了一些常用组件与场景,便于进行快速的方案构建。
An [element-ui](https://github.com/ElemeFE/element) based extension package. We extend some components, such as Table, Menu, Form, etc., to enrich their features and functions, such as dynamically rendered forms and menus, draggable tables, and more. At the same time, we have added some common components and scenarios, such as tree selectors, to provide a fast solution.

From `el-form-renderer` to `element-patch`, `el-form-renderer` has become a historically independent [branch](https://github.com/leezng/element-patch/tree/el-form-renderer) that will no longer be maintained separately, and subsequent `element-patch` will provide an on-demand installation.

## Links

- [文档与例子](https://leezng.github.io/element-patch/)
- [Docs](https://leezng.github.io/element-patch/)
- [中文介绍](./README.zh-CN.md)

## Quick start

Expand All @@ -18,17 +21,16 @@ import ElementPatch from 'element-patch'
import 'element-patch/index.css'

Vue.use(ElementPatch)
</script>
```

## Features

- 通过配置数据生成的表单
- 可拖拽的表格
- 集成分页功能的表格
- 通过配置数据生成的菜单
- 支持权限控制的菜单
- 树型选择器
- 标签选择器
- Dynamically rendered Form
- Dynamically rendered Menus
- Draggable Table
- Table supporting pagination
- Menu that supports permission control
- Tree selector
- Tag selector
...

10 changes: 6 additions & 4 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# element-patch

基于 [element-ui](https://github.com/ElemeFE/element) 的扩展包。我们对一些组件,例如 Table, Menu, Form 等进行扩展,丰富其特性与功能,同时增加了一些常用组件与场景,便于进行快速的方案构建。
基于 [element-ui](https://github.com/ElemeFE/element) 的扩展包。我们对一些组件,例如 Table, Menu, Form 等进行扩展,丰富其特性与功能,例如动态渲染的表单与菜单,可拖拽的表格等。同时增加了一些常用组件与场景,例如树型选择器等,致力于提供一套快速的解决方案。

`el-form-renderer` 升级到 `element-patch``el-form-renderer` 已成为一个历史[独立分支](https://github.com/leezng/element-patch/tree/el-form-renderer),将不再进行单独维护,后续 `element-patch` 将提供按需加载方式。

## Links

- [文档与例子](https://leezng.github.io/element-patch/)
- [Introduce](./README.md)

## Quick start

Expand All @@ -18,15 +21,14 @@ import ElementPatch from 'element-patch'
import 'element-patch/index.css'

Vue.use(ElementPatch)
</script>
```

## Features

- 通过配置数据生成的表单
- 通过动态数据渲染的表单
- 可拖拽的表格
- 集成分页功能的表格
- 通过配置数据生成的菜单
- 通过动态数据渲染的菜单
- 支持权限控制的菜单
- 树型选择器
- 标签选择器
Expand Down
7 changes: 7 additions & 0 deletions build/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"tag-select": "./src/components/tag-select/index.vue",
"form-renderer": "./src/plugs/form-renderer/index.js",
"menu-renderer": "./src/plugs/menu-renderer/index.js",
"table": "./src/plugs/table/index.js",
"tree-select": "./src/plugs/tree-select/index.vue"
}
22 changes: 18 additions & 4 deletions build/webpack.prod.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ var CopyWebpackPlugin = require('copy-webpack-plugin')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
var nodeExternals = require('webpack-node-externals');
var CleanWebpackPlugin = require('clean-webpack-plugin')
var nodeExternals = require('webpack-node-externals')
var components = require('./components')

var isDist = !!process.env.DIST_ENV
var distPath = './dist'
Expand All @@ -31,16 +33,22 @@ var webpackConfig = merge(baseWebpackConfig, {
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
},
plugins: [
// http://vuejs.github.io/vue-loader/en/workflow/production.html
// clean
new CleanWebpackPlugin(distPath, {
root: process.cwd()
}),
// define variables
new webpack.DefinePlugin({
'process.env': env
}),
// uglify
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
sourceMap: config.build.productionSourceMap
}),
// copy
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../README.md'),
Expand All @@ -51,11 +59,13 @@ var webpackConfig = merge(baseWebpackConfig, {
})

if (isDist) {
// package
webpackConfig.entry = {
'element-patch': './src/index.js'
'element-patch': './src/index.js',
...components
}
webpackConfig.output = {
filename: `${distPath}/[name].js`,
filename: `${distPath}/lib/[name].js`,
library: 'ElementPatch',
libraryTarget: 'umd'
}
Expand All @@ -76,10 +86,14 @@ if (isDist) {
{
from: path.resolve(__dirname, '../package.json'),
to: distPath
}, {
from: path.resolve(__dirname, '../LICENSE'),
to: distPath
}
])
)
} else {
// example pages
webpackConfig.plugins.push(
new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].[contenthash].css')
Expand Down
31 changes: 20 additions & 11 deletions example/App.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<template>
<el-container class="container">
<el-header>
<h1>Element Patch</h1>
<h1 style="font-family: fantasy; color: #409EFF;">Element Patch</h1>
</el-header>

<el-container>
<el-aside width="200px" ref="aside" :style="asideStyle">
<el-aside width="240px" ref="aside" :style="asideStyle">
<elx-menu-renderer
:router="true"
:default-openeds="['2']"
default-active="1"
:default-openeds="['3']"
:default-active="currentAcitve"
:content="menuData">
</elx-menu-renderer>
</el-aside>
Expand All @@ -25,33 +25,37 @@
export default {
data () {
return {
currentAcitve: '1',
asideStyle: {
position: 'absolute'
},
menuData: [{
label: '开始',
route: {path: '/start'}
}, {
label: '更新日志',
route: {path: '/changelog'}
}, {
label: 'Components',
subMenu: [{
title: '元组件',
content: [{
label: '标签选择器',
label: 'TagSelect 标签选择器',
route: {path: '/tag-select'}
}]
}, {
title: '复合组件',
content: [{
label: '菜单渲染器',
label: 'MenuRenderer 菜单渲染器',
route: {path: '/menu-renderer'}
}, {
label: '表单渲染器',
label: 'FormRenderer 表单渲染器',
route: {path: '/form-renderer'}
}, {
label: '表格',
label: 'Table 表格',
route: {path: '/table'}
}, {
label: '树选择',
label: 'TreeSelect 树选择',
route: {path: '/tree-select'}
}]
}]
Expand All @@ -69,6 +73,11 @@
}
}
},
watch: {
'$route.path' (val) {
// this.currentAcitve = '2'
}
},
created () {
window.addEventListener('scroll', this.onScroll)
},
Expand All @@ -80,11 +89,11 @@

<style scoped>
.container {
width: 1140px;
width: 1190px;
padding: 0;
margin: 0 auto;
}
.el-main {
margin-left: 200px;
margin-left: 240px;
}
</style>
2 changes: 1 addition & 1 deletion example/demo-block.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
padding: 15px;
}
.title > *:first-child {
font-weight: 500;
font-weight: bold;
}
.source {
border-bottom: 1px solid #e9e9e9;
Expand Down
11 changes: 11 additions & 0 deletions example/doc/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## 更新日志

### 1.1.0

- Table 组件增加拖拽排序的位置提示线条
- 提供按需加载到使用方式


### 1.0.0

-`el-form-renderer` 升级到 `element-patch`[迁移指南](#/start)
20 changes: 18 additions & 2 deletions example/doc/start.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
## 快速开始
## 开始

基于 [element-ui](https://github.com/ElemeFE/element) 的扩展包。我们对一些组件,例如 Table, Menu, Form 等进行扩展,丰富其特性与功能,同时增加了一些常用组件与场景,便于进行快速的方案构建。
基于 vue, [element-ui](https://github.com/ElemeFE/element) 的扩展包。我们对一些组件,例如 Table, Menu, Form 等进行扩展,丰富其特性与功能,同时增加了一些常用组件与场景,便于进行快速的方案构建。

### 安装

```html
// Make sure you have properly installed element-ui and used it correctly.
yarn add element-patch
or
npm i element-patch -S
```

### 完整引入
Expand All @@ -27,3 +29,17 @@ new Vue({
render: h => h(App)
});
```

### 按需引入

```html
import ElxTable from 'element-patch/lib/table';
import ElxFormRenderer from 'element-patch/lib/form-renderer';

export default {
components: {
ElxTable,
ElxFormRenderer
}
}
```
2 changes: 1 addition & 1 deletion example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<title>el-form-renderer</title>
<title>element-patch</title>
<style>
body, html {
margin: 0;
Expand Down
4 changes: 3 additions & 1 deletion example/router-config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Start from './doc/start.md'
import Changelog from './doc/changelog.md'
import TagSelect from './doc/tag-select.md'
import MenuRenderer from './doc/menu-renderer.md'
import FormRenderer from './doc/form-renderer.md'
Expand All @@ -7,8 +8,9 @@ import TreeSelect from './doc/tree-select.md'

const routerConfig = {
routes: [
{path: '/', redirect: '/start'},
{ path: '/', redirect: '/start' },
{ path: '/start', component: Start },
{ path: '/changelog', component: Changelog },
{ path: '/tag-select', component: TagSelect },
{ path: '/menu-renderer', component: MenuRenderer },
{ path: '/form-renderer', component: FormRenderer },
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "element-patch",
"version": "1.0.0",
"version": "1.1.0",
"description": "A Vue.js project",
"author": "leezng <[email protected]>",
"main": "element-patch.js",
"main": "lib/element-patch.js",
"scripts": {
"dev": "node build/dev-server.js",
"dist": "cross-env DIST_ENV=true npm run build",
Expand Down Expand Up @@ -43,6 +43,7 @@
"babel-register": "^6.22.0",
"chalk": "^2.0.1",
"cheerio": "^0.18.0",
"clean-webpack-plugin": "^1.0.1",
"connect-history-api-fallback": "^1.3.0",
"copy-webpack-plugin": "^4.0.1",
"cross-env": "^5.1.3",
Expand Down
Loading

0 comments on commit cdc2f6b

Please sign in to comment.