增加zan-layout

This commit is contained in:
niunai
2017-03-03 17:58:08 +08:00
parent cead595693
commit e918c52fd0
23 changed files with 337 additions and 124 deletions

View File

@@ -0,0 +1,8 @@
## 0.0.2 (2017-01-20)
* 改了bug A
* 加了功能B
## 0.0.1 (2017-01-10)
* 第一版

26
packages/row/README.md Normal file
View File

@@ -0,0 +1,26 @@
# @youzan/<%= name %>
!!! 请在此处填写你的文档最简单描述 !!!
[![version][version-image]][download-url]
[![download][download-image]][download-url]
[version-image]: http://npm.qima-inc.com/badge/v/@youzan/<%= name %>.svg?style=flat-square
[download-image]: http://npm.qima-inc.com/badge/d/@youzan/<%= name %>.svg?style=flat-square
[download-url]: http://npm.qima-inc.com/package/@youzan/<%= name %>
## Demo
## Usage
## API
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|-----------|-----------|-----------|-------------|-------------|
| className | 自定义额外类名 | string | '' | '' |
## License
[MIT](https://opensource.org/licenses/MIT)

3
packages/row/index.js Normal file
View File

@@ -0,0 +1,3 @@
import Row from './src/row';
export default Row;

10
packages/row/package.json Normal file
View File

@@ -0,0 +1,10 @@
{
"name": "<%= name %>",
"version": "<%= version %>",
"description": "<%= description %>",
"main": "./lib/index.js",
"author": "<%= author %>",
"license": "<%= license %>",
"devDependencies": {},
"dependencies": {}
}

29
packages/row/src/row.vue Normal file
View File

@@ -0,0 +1,29 @@
<template>
<div
:class="`${prefix}-row`"
:style="style">
<slot></slot>
</div>
</template>
<script>
export default {
name: 'zan-row',
props: {
prefix: {
type: String,
default: 'zan'
},
gutter: [Number, String]
},
computed: {
style() {
const gutter = Number(this.gutter);
const margin = `-${gutter / 2}px`;
return gutter ?
{ marginLeft: margin, marginRight: margin } :
{};
}
}
};
</script>