├── .babelrc
├── .editorconfig
├── .gitattributes
├── .gitignore
├── .npmignore
├── .postcssrc.js
├── LICENSE
├── README.md
├── build
├── util.js
├── webpack.base.config.js
├── webpack.extracss.config.js
└── webpack.no.extracss.config.js
├── example
└── App.vue
├── package-lock.json
├── package.json
└── src
├── components
├── col.vue
├── index.js
└── row.vue
├── index.js
└── styles
└── grid.scss
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | ["env", {
4 | "modules": false,
5 | "targets": {
6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
7 | }
8 | }],
9 | "stage-2"
10 | ],
11 | "plugins": ["transform-vue-jsx", "transform-runtime"]
12 | }
13 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.js linguist-language=vue
2 | *.css linguist-language=vue
3 | *.html linguist-language=vue
4 | *.vue linguist-language=vue
5 |
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | /dist/
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 |
8 | # Editor directories and files
9 | .idea
10 | .vscode
11 | *.suo
12 | *.ntvs*
13 | *.njsproj
14 | *.sln
15 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | build
2 | example
3 | node_modules
4 | static
5 | .babelrc
6 | .editorconfig
7 | .gitattributes
8 | .gitignore
9 | .postcssrc.js
10 | package-lock.json
11 | .idea
12 |
--------------------------------------------------------------------------------
/.postcssrc.js:
--------------------------------------------------------------------------------
1 | // https://github.com/michael-ciniawsky/postcss-load-config
2 |
3 | module.exports = {
4 | "plugins": {
5 | "postcss-import": {},
6 | "postcss-url": {},
7 | // to edit target browsers: use "browserslist" field in package.json
8 | "autoprefixer": {},
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 zhoulin
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # simple-grid
2 | > a simple grid layout(Vue Component)
3 |
4 | ## Installation
5 | use npm
6 | ```bash
7 | $ npm i simple-xgrid --save
8 | ```
9 | ```js
10 | import Grid from 'simple-xgrid'
11 | import 'simple-xgrid/dist/simple-grid.css'
12 | Vue.use(Grid)
13 |
14 | ```
15 | use script
16 | ```html
17 |
18 |
19 |
20 |
21 |
22 | ```
23 | due to conflict,use script, you need change
to 。
24 |
25 |
26 |
27 |
28 | ## Row Component
29 | ### row props
30 | | param | description | type | default |
31 | | :-: | :-: | :-: | :-: |
32 | | gutter | Grid spacing in pixels, split equally left and right | Number | 0 |
33 | | type | Layout mode. Can optionally make use of flex in a modern browser. | String | |
34 | | align | Vertical alignment of flex layout. You can choose between top, middle, bottom. | String | |
35 | | justify | Horizontal arrangement of flex layout. You can choose between start, end, center, space-around, space-between. | String | |
36 | | type | Layout mode. Can optionally make use of flex in a modern browser. | String | |
37 | ## Col Component
38 | ### col props
39 | | param | description | type | default |
40 | | :-: | :-: | :-: | :-: |
41 | | span | Column span. Value can be between 1 and 24. | Number | |
42 | | order | Grid order when using flex layout. if auto responsive, value can only 1-24. | Number | |
43 | | offset | Number of cells to the left of grid spacing. No cells can be inside the grid spacing. | Number | |
44 | | push | Number of cells to move to the right | Number | |
45 | | pull | Number of cells to move to the left | Number | |
46 | | xs | <768px can be a span value or an object containing props | Number or Object | |
47 | | sm | >768px can be a span value or an object containing props | Number or Object | |
48 | | md | ≥992px can be a span value or an object containing props | Number or Object | |
49 | | lg | ≥1200px can be a span value or an object containing props | Number or Object | |
50 | ## examples
51 | [see live demo](https://jsfiddle.net/anthinkingcoder/04phqm6L)
52 | ```html
53 |
54 |