Skip to content

Commit

Permalink
build: build 2.0.0-alpha.4
Browse files Browse the repository at this point in the history
  • Loading branch information
chuanshuoye committed Dec 29, 2018
1 parent 48a59c8 commit eec2243
Show file tree
Hide file tree
Showing 10 changed files with 83 additions and 150 deletions.
12 changes: 3 additions & 9 deletions docs/2.0.0/progress.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@
@ok='handleWeight'
/>
</za-cell>
<za-cell title='修改类名前缀'>
<za-input type="text" placeholder="请输入修改类名前缀" v-model='prefixCls'></za-input>
</za-cell>
```
:::

Expand All @@ -72,11 +69,9 @@ export default {
theme: 'primary',
shape: 'round',
weight: 'normal',
prefixCls: 'za-progress',
dataSource:[
{ value: 'default', label: 'default' },
{ value: 'primary', label: 'primary' },
{ value: 'info', label: 'info' },
{ value: 'success', label: 'success' },
{ value: 'warning', label: 'warning' },
{ value: 'error', label: 'error' },
],
Expand All @@ -87,7 +82,6 @@ export default {
weightSource:[
{ value: 'normal', label: 'normal' },
{ value: 'thin', label: 'thin' },
{ value: 12, label: '12' },
],
}
},
Expand Down Expand Up @@ -115,8 +109,8 @@ export default {
| 属性 | 类型 | 默认值 | 可选值/参数 | 说明 |
| :--- | :--- | :--- | :--- | :--- |
| prefixCls | string | za-progress | | 类名前缀 |
| theme | string | 'primary' | 'default', 'primary', 'info', 'success', 'warning', 'error' | 主题 |
| theme | string | 'primary' | 'primary', 'success', 'warning', 'error' | 主题 |
| percent | number | 0 | | 进度百分比(范围:0~100) |
| shape | string | 'rect' | 'rect', 'round' | 线条形状 |
| weight | string or number | 'normal' | 'normal', 'thin' , 线条粗细(px) | 线条粗细 |
| weight | string or number | 'normal' | 'normal', 'thin' | 线条粗细 |
| type | string | 'line' | 'line', 'circle' , 'semi-circle' | 类型 |
35 changes: 13 additions & 22 deletions docs/2.0.0/stepper.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,39 @@

:::demo 基本
```html
<za-cell title="普通">
<za-stepper slot='description' v-model='stepper1'></za-stepper>
<za-cell title="默认">
<za-stepper slot='description' v-model='stepper6' ></za-stepper>
</za-cell>
<za-cell title="小号">
<za-stepper slot='description' v-model='stepper1' size="sm"></za-stepper>
</za-cell>
<za-cell title="设置默认值">
<za-stepper slot='description' v-model='stepper2'></za-stepper>
<za-stepper slot='description' v-model='stepper2' size="sm"></za-stepper>
</za-cell>
<za-cell title="设置上下限">
<za-stepper slot='description' v-model='stepper3' :min='-3' :max='3'></za-stepper>
<za-stepper slot='description' v-model='stepper3' :min='-3' :max='3' size="sm"></za-stepper>
</za-cell>
<za-cell title="设置步长">
<za-stepper slot='description' v-model='stepper4' :step='0.5'></za-stepper>
<za-stepper slot='description' v-model='stepper4' :step='0.5' size="sm"></za-stepper>
</za-cell>
<za-cell title="禁用状态">
<za-stepper slot='description' v-model='stepper5' disabled></za-stepper>
<za-stepper slot='description' v-model='stepper5' disabled size="sm"></za-stepper>
</za-cell>
```
:::

:::demo 多形状
```html
<za-cell title="默认">
<za-stepper slot='description' v-model='stepper6' theme="default"></za-stepper>
</za-cell>

<za-cell title="圆角">
<za-stepper slot='description' v-model='stepper7' shape="radius"></za-stepper>
<za-stepper slot='description' v-model='stepper7' shape="radius" size="sm"></za-stepper>
</za-cell>
<za-cell title="圆型">
<za-stepper slot='description' v-model='stepper8' shape="circle"></za-stepper>
<za-stepper slot='description' v-model='stepper8' shape="circle" size="sm"></za-stepper>
</za-cell>
```
:::

:::demo 回调事件
```html
<za-cell title="获取evnet事件">
<za-stepper slot='description' v-model='stepper9' @change='handleChange'></za-stepper>
</za-cell>
<za-cell title="获取变化的值">
<za-stepper slot='description' v-model='stepper10' @inputChange='handleInputChange'></za-stepper>
</za-cell>
```
:::

### Vue Script
```javascript
Expand Down Expand Up @@ -84,7 +75,7 @@ export default {
| 属性 | 类型 | 默认值 | 可选值/参数 | 说明 |
| :--- | :--- | :--- | :--- | :--- |
| prefixCls | string | za-stepper | | 类名前缀,自定义组件样式 |
| theme | string | 'primary' | 'default', 'primary', 'info', 'success', 'warning', 'error' | 主题 |
| size | string | 'md' | 'md', 'sm' | 主题 |
| shape | string | | 'radius', 'circle' | 形状 |
| v-model | number | | | 绑定值 |
| disabled | bool | false | | 是否禁用 |
Expand Down
27 changes: 0 additions & 27 deletions docs/2.0.0/tabs.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,6 @@
```
:::

:::demo 联动
```html
<za-tabs v-model="activeName6" @change="handleClick2">
<za-tab-pane label='用户管理' name='first'>
<div class='content'>用户管理</div>
</za-tab-pane>
<za-tab-pane label='配置管理' name='second'>
<div class='content'>配置管理</div>
</za-tab-pane>
<za-tab-pane label='角色管理' name='third'>
<div class='content'>角色管理</div>
</za-tab-pane>
</za-tabs>
<za-tabs v-model="activeName7" @change="handleClick">
<za-tab-pane label='用户管理' name='first'>
<div class='content'>用户管理</div>
</za-tab-pane>
<za-tab-pane label='配置管理' name='second'>
<div class='content'>配置管理</div>
</za-tab-pane>
<za-tab-pane label='角色管理' name='third'>
<div class='content'>角色管理</div>
</za-tab-pane>
</za-tabs>
```
:::

:::demo 指定默认选项
```html
<za-tabs v-model="activeName8" @change="handleClick">
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zarm-vue",
"version": "2.0.0-alpha.3",
"version": "2.0.0-alpha.4",
"description": "zarm in vue",
"tags": [
"zarm",
Expand Down
4 changes: 2 additions & 2 deletions site/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const store = new Vuex.Store({
path: 'https://chuanshuoye.github.io/zarm-vue-doc/#/zh-CN'
},{
value: '2.0.0',
label: '2.0.0-alpha.3',
path: '#/documents/quick-start?v=2.0.0'
label: '2.0.0-alpha.4',
path: '#/documents/quick-start'
}]
},
actions: {
Expand Down
4 changes: 2 additions & 2 deletions src/progress/style/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ $prefixCls: za-progress;
@include progress-theme($theme-primary);
}

&.theme-info {
@include progress-theme($theme-info);
&.theme-success {
@include progress-theme($theme-success);
}

&.theme-warning {
Expand Down
39 changes: 17 additions & 22 deletions src/stepper/src/stepper.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template lang="html">
<span :class='{
[`${prefixCls}`]: true,
[`theme-${theme}`]: !!theme,
// [`theme-${theme}`]: !!theme,
[`size-${size}`]: !!size,
[`shape-${shape}`]: !!shape,
disabled,
Expand All @@ -28,7 +28,7 @@
</template>

<script>
import { defaultThemeValidator, enumGenerator } from '@/utils/validator';
import { enumGenerator } from '@/utils/validator';
import zaIcon from '../../icon';
export default {
Expand All @@ -41,15 +41,10 @@ export default {
type: String,
default: 'za-stepper',
},
theme: {
type: String,
validator: defaultThemeValidator,
default: 'primary',
},
size: {
type: String,
validator: enumGenerator(['xl', 'lg', 'sm', 'xs']),
default: null,
validator: enumGenerator(['md', 'sm']),
default: 'md',
},
shape: {
type: String,
Expand Down Expand Up @@ -98,7 +93,7 @@ export default {
};
},
methods: {
handleSubClick(event) {
handleSubClick() {
if (this.subDisabled) return;
const value = this.currentValue - this.step;
if (this.min !== null && value < this.min) {
Expand All @@ -107,11 +102,10 @@ export default {
this.currentValue = value;
}
this.lastValue = this.currentValue;
this.$emit('inputChange', Number(this.currentValue));
this.$emit('change', event);
this.handleInputChange();
this.handleAutoWidth(value);
},
handlePlusClick(event) {
handlePlusClick() {
if (this.plusDisabled) return;
const value = this.currentValue + this.step;
if (this.max !== null && value > this.max) {
Expand All @@ -120,15 +114,14 @@ export default {
this.currentValue = value;
}
this.lastValue = this.currentValue;
this.$emit('inputChange', Number(this.currentValue));
this.$emit('change', event);
this.handleInputChange();
this.handleAutoWidth(value);
},
handleInput(event) {
const value = Number(event.target.value);
this.handleValue(value, event);
},
handleValue(value, event) {
handleValue(value) {
if (Number.isNaN(value)) {
if (value === '-') {
this.currentValue = '-';
Expand All @@ -143,25 +136,27 @@ export default {
this.$nextTick(() => {
this.currentValue = this.min;
this.lastValue = this.currentValue;
this.$emit('inputChange', Number(this.currentValue));
this.$emit('change', event);
this.handleInputChange();
});
} else if (this.max !== null && value > this.max) {
this.currentValue = value;
this.$nextTick(() => {
this.currentValue = this.max;
this.lastValue = this.currentValue;
this.$emit('inputChange', Number(this.currentValue));
this.$emit('change', event);
this.handleInputChange();
});
} else {
this.currentValue = value;
this.lastValue = this.currentValue;
this.$emit('inputChange', Number(this.currentValue));
this.$emit('change', event);
this.handleInputChange();
}
this.handleAutoWidth(value);
},
handleInputChange() {
this.$emit('inputChange', Number(this.currentValue));
this.$emit('input', Number(this.currentValue));
this.$emit('change', Number(this.currentValue));
},
handleAutoWidth(val) {
const numLen = Number(val.toString().length);
const nowLen = (numLen * 10) + 20;
Expand Down
Loading

0 comments on commit eec2243

Please sign in to comment.