Skip to content

Commit

Permalink
Merge pull request #946 from museui/feature-components
Browse files Browse the repository at this point in the history
Feature components
  • Loading branch information
myronliu347 authored Jun 3, 2018
2 parents 143c81c + 91aa8ce commit b145d20
Show file tree
Hide file tree
Showing 66 changed files with 2,412 additions and 538 deletions.
2 changes: 1 addition & 1 deletion docs/src/components/nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default {
}
{
!menu.children && menu.badge ? <mu-list-item-action>
<mu-badge color='secondary' content={menu.badge}/>
<mu-badge color='primary' content={menu.badge} />
</mu-list-item-action> : null
}
{
Expand Down
19 changes: 18 additions & 1 deletion docs/src/configs/nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ export default {
name: 'Grid',
path: '/grid'
}]
}, {
name: '工具',
children: [{
name: 'Transitions',
path: '/transitions'
}, {
name: 'Directives',
path: '/directives'
}, {
name: 'Ripple',
path: '/ripple'
}]
}, {
name: '组件',
icon: 'dashboard',
Expand Down Expand Up @@ -91,8 +103,13 @@ export default {
}, {
name: 'Input controls',
children: [{
name: 'Form',
path: '/form',
badge: 'news'
}, {
name: 'Date Input',
path: '/date-input'
path: '/date-input',
badge: 'updated'
}, {
name: 'Select',
path: '/select'
Expand Down
15 changes: 13 additions & 2 deletions docs/src/docs/zh-CN/changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
# 更新日志

<mu-stepper orientation="vertical" :linear="false">
<mu-step active>
<mu-step active>
<mu-step-label>
<mu-icon value="panorama_fish_eye" color="primary" slot="icon"></mu-icon>
<span class="version-title">3.0.0-beta.3</span>
</mu-step-label>
<mu-step-content >
<v3-0-0-beta3></v3-0-0-beta3>
</mu-step-content>
</mu-step>
<mu-step active>
<mu-step-label>
<mu-icon value="panorama_fish_eye" color="primary" slot="icon"></mu-icon>
<span class="version-title">3.0.0-beta.2</span>
Expand Down Expand Up @@ -30,11 +39,13 @@
<script>
import V3Beta1 from './version/3.0.0-beta.1.md';
import V3Beta2 from './version/3.0.0-beta.2.md';
import V3Beta3 from './version/3.0.0-beta.3.md';

export default {
components: {
'v3-0-0-beta1': V3Beta1,
'v3-0-0-beta2': V3Beta2
'v3-0-0-beta2': V3Beta2,
'v3-0-0-beta3': V3Beta3
}
}
</script>
Expand Down
6 changes: 4 additions & 2 deletions docs/src/docs/zh-CN/date-input.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ export default {
<mu-container>
<mu-row gutter>
<mu-col span="12" lg="4" sm="6">
<mu-date-input icon="today" v-model="value12" label="显示确定/取消按钮" actions label-float full-width></mu-date-input>
<mu-date-input icon="today" type="time" v-model="value12" label="显示确定/取消按钮" actions label-float full-width></mu-date-input>
</mu-col>
<mu-col span="12" lg="4" sm="6">
<mu-date-input icon="today" v-model="value13" label="格式化显示" format="yyyy 年 MM 月 dd" label-float full-width></mu-date-input>
<mu-date-input icon="today" v-model="value13" label="格式化显示" format="YYYY 年 MM 月 DD" label-float full-width></mu-date-input>
</mu-col>
<mu-col span="12" lg="4" sm="6">
<mu-date-input icon="today" v-model="value14" label="不展示日期" no-display label-float full-width></mu-date-input>
Expand Down Expand Up @@ -237,13 +237,15 @@ export default {
| container | 弹出方式 | String | popover/dialog/bottomSheet | popover |
| type | 选择的类型 | String | date/time/year/month/dateTime | date |
| clock-type | 时间选择器显示类型 | String | ampm/24hr | ampm |
| view-type | 时间选择模式 | String | clock/list| clock |
| format | 显示在输入框中的格式 | String || yyyy—MM-dd |
| actions | 是否显示底部的确定/取消按钮 | Boolean || false |
| ok-label | 确定按钮的文本 | String || 确定 |
| cancel-label | 取消按钮的文本 | String || 取消 |
| value | 用于 `v-model` 绑定 | Date, String |||
| value-format | 绑定值的格式。不指定则绑定值为 Date 对象 | String | - |
| color | 输入框颜色 | String |||
| display-color | 时间显示区域背景色 | String | - | - |
| icon | 输入框左边的图标 | String |||
| label | 标签文本 | String |||
| label-float | 标签是否浮动 | Boolean || false |
Expand Down
1 change: 1 addition & 0 deletions docs/src/docs/zh-CN/date-picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ export default {
| 参数 | 介绍 | 类型 | 可选值 | 默认值 |
|------|------|------|------|------|
| color | 日期选择器颜色 | String |||
| display-color | 时间显示区域背景色 | String | - | - |
| date | 选择日期,支持 `.sync` 修饰符 | Date || new Date() |
| type | 选择的类型 | String | date/year/month | date |
| date-time-format | 日期格式化对象,用于改变不同的语言环境显示 | Object |||
Expand Down
166 changes: 166 additions & 0 deletions docs/src/docs/zh-CN/directives.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
# 指令

Muse-UI 提供 `v-click-outside``v-resize``v-scroll` 三个指令。


## ClickOutside

:::demo
```html
<div class="demo-content-block" @click="message='click here....'" v-click-outside="clickoutside">{{message}}</div>
<script>
export default {
data () {
return {
message: 'click! click! click!'
};
},
methods: {
clickoutside () {
this.message = 'click outside'
}
}
}
</script>

<style>
.demo-content-block {
width: 100%;
height: 200px;
display: flex;
justify-content: center;
align-items: center;
}
</style>

```
:::

## Resize

:::demo
```html
<div class="demo-content-block" v-resize="resize">
<p style="margin-right: 16px;">Window Size:</p>
<p>width: {{width}}px height: {{height}}px</p>
</div>
<script>
export default {
data () {
return {
width: 0,
height: 0
};
},
mounted () {
this.width = window.innerWidth;
this.height = window.innerHeight;
},
methods: {
resize () {
this.width = window.innerWidth;
this.height = window.innerHeight;
}
}
}
</script>

<style>
.demo-content-block {
width: 100%;
height: 200px;
display: flex;
justify-content: center;
align-items: center;
}
</style>

```
:::

## Scroll

:::demo
```html
<div class="demo-content-block" v-scroll="scroll">
<p style="margin-right: 16px;">ScrollTop:</p>
<p>{{scrollTop}}</p>
</div>
<script>
export default {
data () {
return {
scrollTop: 0
}
},
mounted () {
this.scrollTop = window.scrollY;
}
}
</script>

<style>
.demo-content-block {
width: 100%;
height: 200px;
display: flex;
justify-content: center;
align-items: center;
}
</style>

```
:::


## 按需引入

工具类的组件在 `lib/Helpers` 目录下

```javascript
import Vue from 'vue';
import Helpers from 'muse-ui/lib/Helpers';

Vue.use(Helpers);
```

<script>
export default {
data () {
return {
message: 'click! click! click!',
width: 0,
height: 0,
scrollTop: 0
};
},
mounted () {
this.width = window.innerWidth;
this.height = window.innerHeight;
this.scrollTop = window.scrollY;
},
methods: {
clickoutside () {
this.message = 'click outside'
},
resize () {
this.width = window.innerWidth;
this.height = window.innerHeight;
},
scroll () {
this.scrollTop = window.scrollY;
}
}
}
</script>

<style>
.demo-content-block {
width: 100%;
height: 200px;
display: flex;
justify-content: center;
align-items: center;
}
</style>

Loading

0 comments on commit b145d20

Please sign in to comment.