Commit be3c6c2 CIN
authored
File tree 16 files changed +742
-667
lines changed
16 files changed +742
-667
lines changed Original file line number Diff line number Diff line change 1
1
## 步骤一
2
2
3
- 请您按照规范确认这个PR的类型:<!-- 在相对应类型的 [] 输入 x,此PR能且仅能属于以下种类中的一种。输入x时,请确保[]内只有x字母,没有任何空格字节 -->
3
+ 请您按照规范确认这个PR的类型:
4
4
5
- <!-- 确保源分支基于 develop 分支创建,并向develop 分支提起PR请求(本项目 90% 的PR属于此类型)-->
6
- - [ ] feature/fix/docs PR
7
- <!-- 确保源分支基于 master 分支创建,并向 master 分支提PR,以及向develop分支提PR(只有绝少数PR属于此类型)-->
8
- - [ ] hotfix PR
9
- <!-- 确保源分支基于 develop 分支创建,并向 master 分支提PR,以及向develop分支提PR(只有绝少数PR属于此类型)-->
10
- - [ ] release PR
5
+ - [ ] feature
11
6
12
- ## 步骤二
7
+ - [ ] fix
13
8
14
- 完成以下内容的填写,您就可以顺利提交 Pull Request:
9
+ - [ ] test
10
+
11
+ - [ ] hotfix
12
+
13
+ - [ ] optimize/refactor
14
+
15
+ - [ ] document/example
15
16
16
- ** 1. 填写Pull Reqeust主要针对的类型于下一行,选项有:bug/feature(特性)/enhancement(增强)/docs(文档) **
17
+ - [ ] build
17
18
19
+ - [ ] release
18
20
19
- ** 2. Pull Request的简要介绍(请填于下一行)**
21
+ - [ ] other
22
+
23
+
24
+ ## 步骤二
25
+
26
+ 完成以下内容的填写,您就可以顺利提交 Pull Request:
20
27
28
+ ** 1. Pull Request 内容和 Issue 链接**
21
29
22
- ** 3. Pull Request针对问题的重现方式(没有请在下一行填“无”)**
23
30
31
+ ** 2. Pull Request 针对问题的重现方式**
24
32
25
- ** 4. Pull Request可能涉及到的组件范围(没有请在下一行填“无”)**
26
33
34
+ ** 3. Pull Request 可能涉及到的组件范围**
27
35
28
- <!-- 如果您是本项目Maintainer的话,请务必在该PR右边的Label栏目中,添加相应的label标签-->
Original file line number Diff line number Diff line change
1
+ <a name =" 1.0.6 " ></a >
2
+ # 1.0.6 (2018-08-09)
3
+
4
+
5
+ ## Bug Fixes
6
+
7
+ - *** :** 组件支持自定义文案
8
+ ([ 942e5763] ( https://github.com/DaoCloud/dao-style-vue/commit/942e5763d94f67cd65c8a5a6decb3f7309ae32c0 ) )
9
+ - ** input:**
10
+ - 调整 numeric-input 判断逻辑
11
+ ([ 7491d02f] ( https://github.com/DaoCloud/dao-style-vue/commit/7491d02fded7cd16c8a540c81a4eea88031b2026 ) )
12
+ - numeric input v-model 为 null 时会报错
13
+ ([ d714d021] ( https://github.com/DaoCloud/dao-style-vue/commit/d714d0210992f6694cd6d22d82695a4fecd7b8d4 ) )
14
+ - numeric input 重置没有生效
15
+ ([ e93cab1b] ( https://github.com/DaoCloud/dao-style-vue/commit/e93cab1bcc50e6d4a2e2d07a88a647ab26f57fd0 ) )
16
+
17
+
18
+ ## Features
19
+
20
+ - *** :** 简化 pr 格式
21
+ ([ 60a793bf] ( https://github.com/DaoCloud/dao-style-vue/commit/60a793bfbd13b2d6789600f2258bc6f8f5286f0f ) )
22
+
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -64,3 +64,6 @@ Clipboard 组件用于实现复制到粘贴板的功能。代码请参照目录
64
64
| 参数名| 类型| 说明| 默认值| 是否必填|
65
65
| -----| ---| ----| ----| ---|
66
66
| with-btn | Boolean | 是否需要复制按钮,如果传入的是 false,则没有复制按钮,且点击文字可以全选并复制文本 | -| 否|
67
+ | copy-text | String | 复制提示文本 | 点击复制 | 否|
68
+ | copied-text | String | 复制成功提示文本 | 复制成功 | 否|
69
+ | copy-failed-text | String | 复制失败提示文本 | 复制失败 | 否|
Original file line number Diff line number Diff line change @@ -91,6 +91,8 @@ export default {
91
91
| ------- | ------ | ---------------------------------- | ---- | ---- |
92
92
| config | Object | 配置对象。具体内容见 [ config 对象] ( #config-对象 ) | - | 是 |
93
93
| v-model | Object | 数据绑定的对象 | - | 是 |
94
+ | operation-text | String | 操作的头部文字 | 编辑 | 否 |
95
+ | add-text | String | 添加文字 | 添加 | 否 |
94
96
95
97
### 组件的事件
96
98
| 事件名称 | 说明 | 回调参数 |
Original file line number Diff line number Diff line change @@ -155,8 +155,8 @@ Editable Input 是一个可以编辑的 Disabled Input。当我们不希望用
155
155
| required | Boolean | 必填 | false | 否 |
156
156
| no-border | Boolean | input 是否没有边框 | false | 否 |
157
157
| show-tooltip-only-hover | Boolean | 只有在鼠标 hover 到 icon 上时才会出现 tooltip | true | 否 |
158
- | helperText | String | input 中辅助提示 | 按回车键搜索 | 否 |
159
- | showHelperText | Boolean | input 是否辅助提示 | false | 否 |
158
+ | helper-text | String | input 中辅助提示 | 按回车键搜索 | 否 |
159
+ | show-helper-text | Boolean | input 是否辅助提示 | false | 否 |
160
160
| placeholder | String | 输入框占位文本 | - | 否 |
161
161
| readonly | Boolean | 原生属性,是否只读 | false | 否 |
162
162
| autofocus | Boolean | 原生属性,自动获得焦点 | false | 否 |
@@ -192,7 +192,10 @@ Editable Input 是一个可以编辑的 Disabled Input。当我们不希望用
192
192
193
193
| 参数名 | 类型 | 说明 | 默认值 | 是否必填 |
194
194
| :--------------: | :------: | :----------------------------: | :---: | :--: |
195
- | save-btn-content | String | 保存按钮中显示的内容 | 保存 | 否 |
195
+ | save-btn-text | String | 保存按钮中显示的文字 | 保存 | 否 |
196
+ | edit-btn-text | String | 更改按钮中显示的内容 | 更改 | 否 |
197
+ | cancel-btn-text | String | 取消按钮中显示的内容 | 取消 | 否 |
196
198
| edit-state | Boolean | 初始编辑状态 | false | 否 |
197
199
| on-check | Function | 检查输入的函数,符合要求返回 true,否则返回 false | - | 否 |
198
200
| on-success | Function | 如果检查符合输入,进行的处理 | - | 否 |
201
+
Original file line number Diff line number Diff line change @@ -201,6 +201,7 @@ Radio 是一个单选框组件。代码请参照目录:[src/components/dao-rad
201
201
| -----| ------| -----| -------| ---------|
202
202
| headline | string | 指定 radio-plus 中的标题 | - | 否 |
203
203
| select-title | string | radio-plus 中 select 的默认显示 | - | 否 |
204
+ | no-data-text | string | radio-plus 中 select 的 no-data-text 的默认显示 | 暂无结果 | 否 |
204
205
| options | object | radio-plus 中 select 的选项数据 | - | 否 |
205
206
| async | function | radio-plus 中获取 select 中数据的函数,当你传入了此参数时,该 function 会在 radio 被 check 或点击 radio 中的 select 时触发。另外值得注意的是,这个 async 方法必须返回一个 Promise,当这个 Promise 成功 resolve 之后就不在调用这个 function | - | 否 |
206
207
Original file line number Diff line number Diff line change 9
9
:on-error =" copyError"
10
10
:content =" content"
11
11
v-if =" withBtn" >
12
- <tooltip content =" 复制成功 " v-if =" success" >
12
+ <tooltip : content =" copiedText " v-if =" success" >
13
13
<svg >
14
14
<use xlink:href =" #icon_clipboard-success" ></use >
15
15
</svg >
16
16
</tooltip >
17
- <tooltip content =" 复制失败 " v-if =" fail" >
17
+ <tooltip : content =" copyFailedText " v-if =" fail" >
18
18
<svg >
19
19
<use xlink:href =" #icon_clipboard" ></use >
20
20
</svg >
21
21
</tooltip >
22
- <tooltip content =" 点击复制 " v-if =" !success && !fail" >
22
+ <tooltip : content =" copyText " v-if =" !success && !fail" >
23
23
<svg >
24
24
<use xlink:href =" #icon_clipboard" ></use >
25
25
</svg >
41
41
type: Boolean ,
42
42
default: true ,
43
43
},
44
+ copyText: {
45
+ type: String ,
46
+ default: ' 点击复制' ,
47
+ },
48
+ copiedText: {
49
+ type: String ,
50
+ default: ' 复制成功' ,
51
+ },
52
+ copyFailedText: {
53
+ type: String ,
54
+ default: ' 复制失败' ,
55
+ },
44
56
},
45
57
// 原本简单的用 computed 无法及时的获取到已修改的内容
46
58
// 改成当组件挂载和更新之后赋值,可以及时获取
Original file line number Diff line number Diff line change 3
3
< thead >
4
4
< tr >
5
5
< th v-for ="th in header "> {{ th.text }}</ th >
6
- < th class ="det-edit-col "> 编辑 </ th >
6
+ < th class ="det-edit-col "> {{ operationText }} </ th >
7
7
</ tr >
8
8
</ thead >
9
9
< tbody >
50
50
</ table >
51
51
< div class ="det-add " @click ="addRow ">
52
52
< svg class ="det-add-btn "> < use xlink:href ="#icon_plus-circled "> </ use > </ svg >
53
- < span class ="det-add-span "> 添加 </ span >
53
+ < span class ="det-add-span "> {{ addText }} </ span >
54
54
</ div >
55
55
</ div >
Original file line number Diff line number Diff line change @@ -15,7 +15,18 @@ export default {
15
15
components : {
16
16
daoDrop,
17
17
} ,
18
- props : [ 'config' , 'value' ] ,
18
+ props : {
19
+ config : { } ,
20
+ value : { } ,
21
+ operationText : {
22
+ type : String ,
23
+ default : '编辑' ,
24
+ } ,
25
+ addText : {
26
+ type : String ,
27
+ default : '添加' ,
28
+ } ,
29
+ } ,
19
30
data ( ) {
20
31
return {
21
32
activatedRow : null ,
Original file line number Diff line number Diff line change 15
15
<template v-if =" ! $slots .prepend && ! $slots .append " slot="button">
16
16
<div class =" edit-op" >
17
17
<div class =" edit-op-toggle" v-show =" !isEdit" @click =" edit" >
18
- <svg ><use xlink:href =" #icon_pencil" ></use ></svg ><span class =" text" >更改 </span >
18
+ <svg ><use xlink:href =" #icon_pencil" ></use ></svg ><span class =" text" >{{ editBtnText }} </span >
19
19
</div >
20
20
<div class =" edit-op-btn" v-show =" isEdit" >
21
- <button class =" dao-btn blue" @click =" save" >{{ saveBtnContent }}</button >
22
- <button class =" dao-btn ghost" @click =" cancel" >取消 </button >
21
+ <button class =" dao-btn blue" @click =" save" >{{ saveBtnText }}</button >
22
+ <button class =" dao-btn ghost" @click =" cancel" >{{ cancelBtnText }} </button >
23
23
</div >
24
24
</div >
25
25
</template >
26
26
</dao-input >
27
27
<div v-if =" $slots.prepend || $slots.append" class =" edit-op" >
28
28
<div class =" edit-op-toggle" v-show =" !isEdit" @click =" edit" >
29
- <svg ><use xlink:href =" #icon_pencil" ></use ></svg ><span class =" text" >更改 </span >
29
+ <svg ><use xlink:href =" #icon_pencil" ></use ></svg ><span class =" text" >{{ editBtnText }} </span >
30
30
</div >
31
31
<div class =" edit-op-btn" v-show =" isEdit" >
32
- <button class =" dao-btn blue" @click =" save" >{{ saveBtnContent }}</button >
33
- <button class =" dao-btn ghost" @click =" cancel" >取消 </button >
32
+ <button class =" dao-btn blue" @click =" save" >{{ saveBtnText }}</button >
33
+ <button class =" dao-btn ghost" @click =" cancel" >{{ cancelBtnText }} </button >
34
34
</div >
35
35
</div >
36
36
</div >
52
52
},
53
53
props: {
54
54
value: [String , Number ],
55
- saveBtnContent : {
55
+ saveBtnText : {
56
56
type: String ,
57
57
default: ' 保存' ,
58
58
},
59
+ editBtnText: {
60
+ type: String ,
61
+ default: ' 更改' ,
62
+ },
63
+ cancelBtnText: {
64
+ type: String ,
65
+ default: ' 取消' ,
66
+ },
59
67
editState: Boolean ,
60
68
onCheck: {
61
69
type: Function ,
Original file line number Diff line number Diff line change 19
19
<script >
20
20
21
21
import DaoTriangle from ' ./dao-triangle/dao-triangle.vue' ;
22
+ import { _toString } from ' ../../utils/assist' ;
22
23
23
24
function isInt (num ) {
24
25
if (num === undefined ) return false ;
25
- return / ^ (0| [1-9 ][0-9 ] * )$ / .test (num >= 0 ? num : num . toString ( ).slice (1 ));
26
+ return / ^ (0| [1-9 ][0-9 ] * )$ / .test (num >= 0 ? num : _toString (num ).slice (1 ));
26
27
}
27
28
28
29
function isFloat (num ) {
29
30
return / ^ (-? \d + )(\. \d + )? $ / .test (num);
30
31
}
31
32
32
33
function isEndWithDot (num ) {
33
- const arr = num . toString ( ).split (' .' );
34
+ const arr = _toString (num ).split (' .' );
34
35
if (arr .length === 2 && isInt (arr[0 ]) && arr[1 ] === ' ' ) {
35
36
return true ;
36
37
}
117
118
onBlur () {
118
119
this .dirty = true ;
119
120
if (this .type === ' float' && isEndWithDot (this .num )) {
120
- this .preCheck (this .num . toString ( ).split (' .' ).shift ());
121
+ this .preCheck (_toString ( this .num ).split (' .' ).shift ());
121
122
}
122
123
},
123
124
preCheck (num ) {
124
125
this .num = num;
125
126
// not required
126
- if (num === ' ' && ! this .required ) {
127
+ if (( ! num && num !== 0 ) && ! this .required ) {
127
128
this .updateModel ();
128
129
return ;
129
130
}
Original file line number Diff line number Diff line change 9
9
</div >
10
10
<div class =" radio-select" >
11
11
<dao-select ref =" select" :async =" async" :disabled =" disabled" v-model =" select" :placeholder =" selectTitle" :loading =" loading" @change =" handleSelectChange" >
12
- <dao-option-group no-data-text =" 暂无结果 " >
12
+ <dao-option-group : no-data-text =" noDataText " >
13
13
<dao-option v-for =" option in options" :key =" option.value" :value =" option.value" :label =" option.label" ></dao-option >
14
14
</dao-option-group >
15
15
</dao-select >
51
51
default: false ,
52
52
},
53
53
radioValue: {},
54
+ noDataText: {
55
+ type: String ,
56
+ default: ' 暂无结果' ,
57
+ },
54
58
},
55
59
mounted () {
56
60
// 挂载时,如果被选中,则执行
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ export { default as _chunk } from 'lodash/chunk';
17
17
export { default as _get } from 'lodash/get' ;
18
18
export { default as _flatten } from 'lodash/flatten' ;
19
19
export { default as _toNumber } from 'lodash/toNumber' ;
20
+ export { default as _toString } from 'lodash/toString' ;
20
21
export { default as _findIndex } from 'lodash/findIndex' ;
21
22
export { default as _merge } from 'lodash/merge' ;
22
23
export { default as _uniqBy } from 'lodash/uniqBy' ;
Original file line number Diff line number Diff line change 1
1
/* eslint-disable */
2
2
// this version shows current version of project
3
- var VERSION = '1.0.5 ' ;
3
+ var VERSION = '1.0.6 ' ;
4
4
module . exports = { VERSION : VERSION } ;
5
5
// ’make release‘ 依赖 console.log 把打印到标准输出, 不可删除
6
6
console . log ( VERSION ) ;
You can’t perform that action at this time.
0 commit comments