Skip to content

Commit e5a5891

Browse files
author
levy
committed
Merge branch 'dev'
2 parents 8c9469b + f980a19 commit e5a5891

File tree

7 files changed

+61
-12
lines changed

7 files changed

+61
-12
lines changed

docs/basic.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,14 @@ export default {
6161
label: 'type',
6262
default: [],
6363
options: [{
64-
label: 'typeA'
64+
label: 'typeA',
65+
value: 'A'
6566
}, {
66-
label: 'typeB'
67+
label: 'typeB',
68+
value:'B'
6769
}, {
68-
label: 'typeC'
70+
label: 'typeC',
71+
value: 'C'
6972
}],
7073
rules: [
7174
{ type: 'array', required: true, message: 'miss type', trigger: 'change' }

docs/slot-label.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@
88
<script>
99
export default {
1010
data () {
11-
const h = this.$createElement
11+
/**
12+
* 如果 babel-plugins-transform-vue-jsx 版本低于 3.4.0,jsx 作用域中需要如下定义 h
13+
* 下面的代码可确保在 CI 环境不报错!
14+
* @see: https://cn.vuejs.org/v2/guide/render-function.html#JSX
15+
*/
16+
if (typeof h === 'undefined') {
17+
h = this.$createElement
18+
}
1219
return {
1320
content: [
1421
{

netlify.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
echo "is netlify: $NETLIFY"
3+
echo "in branch: $BRANCH"
4+
echo "head: $HEAD"
5+
6+
if [ "$NETLIFY" != "true" ]
7+
then
8+
echo "this script only runs in netlify, bye"
9+
exit 1
10+
fi
11+
12+
if [ "$BRANCH" != "dev" ] && [ "$HEAD" != "dev" ]
13+
then
14+
yarn doc
15+
else
16+
echo "this script only runs in targeting dev's PR deploy preview, bye"
17+
fi

notify.sh

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,32 @@
11
#!/bin/sh
2+
# https://stackoverflow.com/questions/13872048/bash-script-what-does-bin-bash-mean
3+
echo "1/5: checking TRAVIS_TEST_RESULT"
24
if [ "$TRAVIS_TEST_RESULT" != "0" ]
35
then
46
echo "build not success, bye"
57
exit 1
68
fi
79

8-
git remote add github https://$GITHUB_TOKEN@github.com/FEMessage/el-form-renderer.git > /dev/null 2>&1
10+
ORG_NAME=$(echo "$TRAVIS_REPO_SLUG" | cut -d '/' -f 1)
11+
REPO_NAME=$(echo "$TRAVIS_REPO_SLUG" | cut -d '/' -f 2)
12+
13+
echo "2/5: pushing commit and tag to github"
14+
# 该命令很可能报错,但不影响实际进行,因而不能简单地在脚本开头 set -e
15+
git remote add github https://$GITHUB_TOKEN@github.com/$TRAVIS_REPO_SLUG.git > /dev/null 2>&1
916
git push github HEAD:master --follow-tags
1017

18+
echo "3/5: generating github release notes"
1119
GREN_GITHUB_TOKEN=$GITHUB_TOKEN yarn release
1220

13-
url=https://api.github.com/repos/FEMessage/el-form-renderer/releases/latest
21+
# 避免发送错误信息
22+
if [ $? -ne 0 ]
23+
then
24+
echo "gren fails, bye"
25+
exit 1
26+
fi
27+
28+
echo "4/5: downloading github release info"
29+
url=https://api.github.com/repos/$TRAVIS_REPO_SLUG/releases/latest
1430
resp_tmp_file=resp.tmp
1531

1632
curl -H "Authorization: token $GITHUB_TOKEN" $url > $resp_tmp_file
@@ -19,8 +35,11 @@ html_url=$(sed -n 5p $resp_tmp_file | sed 's/\"html_url\"://g' | awk -F '"' '{pr
1935
body=$(grep body < $resp_tmp_file | sed 's/\"body\"://g;s/\"//g')
2036
version=$(echo $html_url | awk -F '/' '{print $NF}')
2137

22-
msg='{"msgtype": "markdown", "markdown": {"title": "el-form-renderer更新", "text": "@所有人\n# [el-form-renderer('$version')]('$html_url')\n'$body'"}}'
38+
echo "5/5: notifying with dingtalk bot"
39+
msg='{"msgtype": "markdown", "markdown": {"title": "'$REPO_NAME'更新", "text": "@所有人\n# ['$REPO_NAME'('$version')]('$html_url')\n'$body'"}}'
2340

2441
curl -X POST https://oapi.dingtalk.com/robot/send\?access_token\=$DINGTALK_ROBOT_TOKEN -H 'Content-Type: application/json' -d "$msg"
2542

2643
rm $resp_tmp_file
44+
45+
echo "executing notify.sh successfully"

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"@babel/plugin-transform-runtime": "^7.4.3",
6060
"@babel/preset-env": "^7.4.3",
6161
"@femessage/el-semver-input": "^1.1.3",
62-
"@femessage/github-release-notes": "^0.19.0",
62+
"@femessage/github-release-notes": "latest",
6363
"@vue/test-utils": "^1.0.0-beta.30",
6464
"axios": "^0.19.0",
6565
"babel-core": "^7.0.0-bridge.0",
@@ -104,7 +104,7 @@
104104
"node": ">= 4.0.0",
105105
"npm": ">= 3.0.0"
106106
},
107-
"vue-sfc-cli": "1.10.6",
107+
"vue-sfc-cli": "1.12.0",
108108
"browserslist": [
109109
"> 1%",
110110
"last 2 versions",

src/components/render-form-item.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,12 @@
4343
<!-- TODO: 支持 el-checkbox-button 变体 -->
4444
<el-checkbox
4545
v-else-if="data.type === 'checkbox-group'"
46-
:key="opt.label"
46+
:key="opt.value"
4747
v-bind="opt"
48-
/>
48+
:label="'value' in opt ? opt.value : opt.label"
49+
>
50+
{{ opt.label }}
51+
</el-checkbox>
4952
<!-- WARNING: radio 用 label 属性来表示 value 的含义 -->
5053
<!-- FYI: radio 的 value 属性可以在没有 radio-group 时用来关联到同一个 v-model -->
5154
<el-radio

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@
743743
resolved "https://registry.npm.taobao.org/@femessage/el-semver-input/download/@femessage/el-semver-input-1.1.3.tgz#1b5d0d44a82b7aa8b83043f145a95d3dc2001e19"
744744
integrity sha1-G10NRKgreqi4MEPxRaldPcIAHhk=
745745

746-
"@femessage/github-release-notes@^0.19.0":
746+
"@femessage/github-release-notes@latest":
747747
version "0.19.0"
748748
resolved "https://registry.npmjs.org/@femessage/github-release-notes/-/github-release-notes-0.19.0.tgz#483767c6a52d3a1086000442580503fed72a0898"
749749
integrity sha512-p97YOnBoLfgiWknF5bzqlUOTHIBcBpI8L7bpekPls3annTV65TGfdkl2ICZZAvhjIcl9usDqGFj6pJWj+R+Rzw==

0 commit comments

Comments
 (0)