diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 3ed94df..0000000 --- a/.babelrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "presets": [ - ["env", { "modules": false }] - ] -} diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index c361757..0000000 --- a/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -**/*.js linguist-language=Vue -**/*.less linguist-language=Vue -**/*.css linguist-language=Vue -**/*.html linguist-language=Vue \ No newline at end of file diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 71df9b4..0000000 --- a/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -.DS_Store -node_modules -.idea -example/dist -gh-pages \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 363331a..0000000 --- a/LICENSE +++ /dev/null @@ -1,43 +0,0 @@ -MIT License - -Copyright (c) 2017 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -The MIT License (MIT) - -Copyright (c) 2016 ElemeFE - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 366573a..0000000 --- a/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# grid - -> [Element](https://github.com/ElemeFE/element) Grid clone, and did just a little change. If you have a better idea of this component improvement, please share it and I will update it immediately. - -## Install - -```bash -npm install vue-multiple-grid -S -``` - -## Quick Start - -```bash -import vue from 'vue' -import {Row, Col} from 'vue-multiple-grid' -import 'vue-multiple-grid/lib/grid.css' - -Vue.component(Row.name, Row) -Vue.component(Col.name, Col) -``` - -## Build Setup - -``` bash -# install dependencies -npm install - -# serve with hot reload at localhost:8080 -npm run demo:dev - -# build for demo with minification -npm run demo:build - -# build for gh-pages with minification -npm run demo:prepublish - -# build for production with minification -npm run build - -# generate gh-pages -npm run deploy -``` - -## LICENSE - -[MIT](http://opensource.org/licenses/MIT) \ No newline at end of file diff --git a/build/gh-pages.sh b/build/gh-pages.sh deleted file mode 100644 index 8cfcbbc..0000000 --- a/build/gh-pages.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash -npm run demo:prepublish -cd gh-pages -git init -git add -A -git commit -m 'update gh-pages' -git push -f git@github.com:vue-multiple/grid.git master:gh-pages \ No newline at end of file diff --git a/build/webpack.config.js b/build/webpack.config.js deleted file mode 100644 index 45002cc..0000000 --- a/build/webpack.config.js +++ /dev/null @@ -1,91 +0,0 @@ -var path = require('path') -var webpack = require('webpack') -var ExtractTextPlugin = require('extract-text-webpack-plugin') - -module.exports = { - entry: './src/index.js', - output: { - path: path.resolve(__dirname, '..', './lib'), - filename: 'grid.js', - library: 'grid', - libraryTarget: 'umd' - }, - externals: { - vue: { - root: 'Vue', - commonjs: 'vue', - commonjs2: 'vue', - amd: 'vue' - } - }, - module: { - rules: [ - { - test: /\.vue$/, - loader: 'vue-loader', - options: { - loaders: { - css: ExtractTextPlugin.extract({ - use: 'css-loader', - fallback: 'vue-style-loader' - }), - less: ExtractTextPlugin.extract({ - fallback: 'vue-style-loader', - use: ['css-loader', 'less-loader'] - }) - } - // other vue-loader options go here - } - }, - { - test: /\.css$/, - loader: ExtractTextPlugin.extract({ - use: "css-loader", - fallback: "style-loader" - }) - }, - { - test: /\.less$/, - loader: ExtractTextPlugin.extract({ - fallback: 'style-loader', - use: ['css-loader', 'less-loader'] - }) - }, - { - test: /\.js$/, - loader: 'babel-loader', - exclude: /node_modules/ - }, - { - test: /\.(png|jpg|gif|svg)$/, - loader: 'file-loader', - options: { - name: '[name].[ext]?[hash]' - } - }, - { - test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, - loader: 'url-loader', - query: { - limit: 10000, - name: path.posix.join('static', 'fonts/[name].[hash:7].[ext]') - } - } - ] - }, - resolve: { - extensions: ['.js', '.vue', '.json'] - }, - plugins: [ - new webpack.optimize.UglifyJsPlugin({ - sourceMap: true, - compress: { - warnings: false - } - }), - new ExtractTextPlugin({ - filename: '../lib/grid.css', - allChunks: true - }) - ] -} \ No newline at end of file diff --git a/build/webpack.example.base.conf.js b/build/webpack.example.base.conf.js deleted file mode 100644 index 5a2ae25..0000000 --- a/build/webpack.example.base.conf.js +++ /dev/null @@ -1,55 +0,0 @@ -var path = require('path') -var ExtractTextPlugin = require('extract-text-webpack-plugin') -var isProduction = process.env.NODE_ENV === 'production' - -module.exports = { - entry: { - app: './example/src/main.js' - }, - output: { - path: '/example', - filename: '[name].js', - publicPath: '/' - }, - module: { - rules: [ - { - test: /\.vue$/, - loader: 'vue-loader', - options: { - // other vue-loader options go here - loaders: { - css: isProduction ? ExtractTextPlugin.extract({ - use: 'css-loader', - fallback: 'vue-style-loader' - }) : 'vue-style-loader!css-loader', - less: isProduction ? ExtractTextPlugin.extract({ - fallback: 'vue-style-loader', - use: ['css-loader', 'less-loader'] - }) : 'vue-style-loader!css-loader!less-loader' - } - } - }, - { - test: /\.js$/, - loader: 'babel-loader', - exclude: /node_modules/ - }, - { - test: /\.(png|jpg|gif|svg)$/, - loader: 'file-loader', - options: { - name: '[name].[ext]?[hash]' - } - }, - { - test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, - loader: 'url-loader', - query: { - limit: 10000, - name: path.posix.join('static', 'fonts/[name].[hash:7].[ext]') - } - } - ] - } -} \ No newline at end of file diff --git a/build/webpack.example.dev.conf.js b/build/webpack.example.dev.conf.js deleted file mode 100644 index 61bc308..0000000 --- a/build/webpack.example.dev.conf.js +++ /dev/null @@ -1,36 +0,0 @@ -var webpack = require('webpack') -var merge = require('webpack-merge') -var baseWebpackConfig = require('./webpack.example.base.conf') -var HtmlWebpackPlugin = require('html-webpack-plugin') -var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') - -module.exports = merge(baseWebpackConfig, { - module: { - rules: [ - { - test: /\.css$/, - loader: 'vue-style-loader!css-loader' - }, - { - test: /\.less$/, - loader: 'vue-style-loader!css-loader!less-loader' - } - ] - }, - // cheap-module-eval-source-map is faster for development - devtool: '#cheap-module-eval-source-map', - plugins: [ - new webpack.DefinePlugin({ - 'process.env': { - NODE_ENV: '"development"' - } - }), - new webpack.NoEmitOnErrorsPlugin(), - new HtmlWebpackPlugin({ - filename: 'index.html', - template: 'example/index.html', - inject: true - }), - new FriendlyErrorsPlugin() - ] -}) \ No newline at end of file diff --git a/build/webpack.example.prod.conf.js b/build/webpack.example.prod.conf.js deleted file mode 100644 index 9240897..0000000 --- a/build/webpack.example.prod.conf.js +++ /dev/null @@ -1,65 +0,0 @@ -var path = require('path') -var webpack = require('webpack') -var merge = require('webpack-merge') -var baseWebpackConfig = require('./webpack.example.base.conf') -var HtmlWebpackPlugin = require('html-webpack-plugin') -var ExtractTextPlugin = require('extract-text-webpack-plugin') -var isProduction = process.env.NODE_ENV === 'production' - -module.exports = merge(baseWebpackConfig, { - module: { - rules: [ - { - test: /\.css$/, - loader: ExtractTextPlugin.extract({ - use: "css-loader", - fallback: "style-loader" - }) - }, - { - test: /\.less/, - loader: ExtractTextPlugin.extract({ - fallback: "vue-style-loader", - use: ["css-loader", "less-loader"] - }) - } - ] - }, - devtool: '#source-map', - output: { - path: path.resolve(__dirname, '..', `${isProduction ? './example/dist' : './gh-pages'}`), - publicPath: isProduction ? '/' : '/grid', - filename: 'js/[name].[chunkhash].js' - }, - plugins: [ - new webpack.DefinePlugin({ - 'process.env': { - NODE_ENV: '"production"' - } - }), - new webpack.optimize.UglifyJsPlugin({ - sourceMap: true, - compress: { - warnings: false - } - }), - new ExtractTextPlugin({ - filename: 'css/[name].[contenthash].css', - allChunks: true - }), - new HtmlWebpackPlugin({ - filename: 'index.html', - template: 'example/index.html', - inject: true, - minify: { - removeComments: true, - collapseWhitespace: true, - removeAttributeQuotes: true - // more options: - // https://github.com/kangax/html-minifier#options-quick-reference - }, - // necessary to consistently work with multiple chunks via CommonsChunkPlugin - chunksSortMode: 'dependency' - }) - ] -}) diff --git a/lib/grid.css b/css/app.2cfa35a3bd58ee1a5e69e4d4f92eb7e2.css similarity index 99% rename from lib/grid.css rename to css/app.2cfa35a3bd58ee1a5e69e4d4f92eb7e2.css index e792198..30132f8 100644 --- a/lib/grid.css +++ b/css/app.2cfa35a3bd58ee1a5e69e4d4f92eb7e2.css @@ -2111,3 +2111,5 @@ order: 0; } } + +/*# sourceMappingURL=app.2cfa35a3bd58ee1a5e69e4d4f92eb7e2.css.map*/ \ No newline at end of file diff --git a/css/app.2cfa35a3bd58ee1a5e69e4d4f92eb7e2.css.map b/css/app.2cfa35a3bd58ee1a5e69e4d4f92eb7e2.css.map new file mode 100644 index 0000000..98788a3 --- /dev/null +++ b/css/app.2cfa35a3bd58ee1a5e69e4d4f92eb7e2.css.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"css/app.2cfa35a3bd58ee1a5e69e4d4f92eb7e2.css","sourceRoot":""} \ No newline at end of file diff --git a/example/index.html b/example/index.html deleted file mode 100644 index b89915d..0000000 --- a/example/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - -
- - - -row
和 col
组件,并通过 col
组件的 span
属性我们就可以自由地组合布局。
-
- Row
组件 提供 gutter
属性来指定每一栏之间的间隔,默认间隔为 0。
-
- col
组件的 offset
属性可以指定分栏偏移的栏数。
-
- flex
布局来对分栏进行灵活的对齐。
-
-
- type
属性赋值为 'flex',可以启用flex 布局,并通过 justify
属性来指定 start, center, end, space-between,
- space-around 其中的值来定义子元素的排版方式。
-
- flex
布局来对分栏进行灵活的对齐。
-
-
- type
属性赋值为 'flex',可以启用flex 布局,并通过 align
属性来指定 top, middle, center, baseline,
- stretch 其中的值来定义子元素在交叉轴上的对齐方式。
-
- flex
布局来对分栏进行灵活的排列。
-
-
- type
属性赋值为 'flex',可以启用flex 布局,并通过 direction
属性来指定 row, row-reverse, column,
- column-reverse 其中的值来定义子元素的排列方式。
-
- flex
布局来对分栏进行灵活的单行或多行显示。
-
-
- type
属性赋值为 'flex',可以启用flex 布局,并通过 wrap
属性来指定 nowrap, wrap, wrap-reverse
- 其中的值来定义子元素的单行或多行显示方式并允许你控制行的堆叠方向。
-
- flex
布局来对分栏进行灵活的对齐。
-
-
- type
属性赋值为 'flex',可以启用flex 布局,并通过 content
属性来指定 start, center, end, space-around,
- space-between, stretch 其中的值来定义子元素的多轴对齐方式。
-
- flex
布局来对分栏进行灵活的排序。
-
-
- type
属性赋值为 'flex',可以启用flex 布局,并通过 order
属性来指定 子元素的排列顺序,数值越小,排列越靠前,默认为0。
-
- xs
、sm
、md
和 lg
。
-
-
- xs
,sm
,md
,lg
,属性值为 object
或
- number
类型的任意组合。
-
- 参数 | -说明 | -类型 | -可选值 | -默认值 | - - -
---|---|---|---|---|
gutter | -栅格间隔 | -number | -— | -0 | -
type | -布局模式,可选 flex,现代浏览器下有效 | -string | -— | -— | -
justify | -flex 布局下的水平排列方式 | -string | -start/end/center/space-around/space-between | -start | -
align | -flex 布局下的垂直排列方式 | -string | -top/middle/bottom/baseline (新增)/stretch (新增) | -top | -
direction (新增) | -flex 布局下的排列方向 | -string | -row/row-reverse/column/column-reverse | -row | -
wrap (新增) | -flex 布局下的单行或多行显示方式 | -string | -nowrap/wrap/wrap-reverse | -wrap | -
content (新增) | -flex 布局下的多轴排列方式 | -string | -start/center/end/space-between/space-around/stretch | -start | -
tag | -自定义元素标签 | -string | -* | -div | -
参数 | -说明 | -类型 | -可选值 | -默认值 | -
---|---|---|---|---|
span | -栅格占据的列数 | -number | -— | -— | -
order (新增) | -flex 布局下的栅格排列顺序 | -number | -— | -— | -
offset | -栅格左侧的间隔格数 | -number | -— | -0 | -
push | -栅格向右移动格数 | -number | -— | -0 | -
pull | -栅格向左移动格数 | -number | -— | -0 | -
xs | -<768px 响应式栅格数或者栅格属性对象 |
- number/object (例如: {span: 4, offset: 4}) | -— | -— | -
sm | -≥768px 响应式栅格数或者栅格属性对象 |
- number/object (例如: {span: 4, offset: 4}) | -— | -— | -
md | -≥992 响应式栅格数或者栅格属性对象 |
- number/object (例如: {span: 4, offset: 4}) | -— | -— | -
lg | -≥1200 响应式栅格数或者栅格属性对象 |
- number/object (例如: {span: 4, offset: 4}) | -— | -— | -
tag | -自定义元素标签 | -string | -* | -div | -