Skip to content

Commit

Permalink
新增只读配置
Browse files Browse the repository at this point in the history
  • Loading branch information
eiixy committed Dec 21, 2020
1 parent affeb06 commit ade7ad5
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 8 deletions.
3 changes: 3 additions & 0 deletions src/attributes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
<el-form-item v-if="'multiple' == index" label="是否多选">
<el-checkbox v-model="attrs.multiple"></el-checkbox>
</el-form-item>
<el-form-item v-if="'readonly' == index" label="是否只读">
<el-checkbox v-model="attrs.readonly"></el-checkbox>
</el-form-item>
<el-form-item v-if="'options' == index" label="可选项">
<draggable v-model="attrs.options" handle=".handle" :animation="200">
<div
Expand Down
18 changes: 13 additions & 5 deletions src/widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ export default [{
title: "单行输入框",
description: "",
placeholder: "请输入",
required: false
required: false,
readonly: false,
},
ui: {
width: 24
Expand All @@ -25,6 +26,7 @@ export default [{
description: "",
placeholder: "请选择",
required: false,
readonly: false,
options: [{
label: "选择1",
value: 0
Expand All @@ -48,6 +50,7 @@ export default [{
description: "",
placeholder: "请选择",
required: false,
readonly: false,
options: [{
label: "选择1",
value: 1
Expand All @@ -70,7 +73,8 @@ export default [{
title: "日期选择框",
description: "",
placeholder: "请选择",
required: false
required: false,
readonly: false,
},
ui: {
width: 24
Expand All @@ -83,7 +87,8 @@ export default [{
title: "时间日期选择框",
description: "",
placeholder: "请选择",
required: false
required: false,
readonly: false,
},
ui: {
width: 24
Expand All @@ -98,6 +103,7 @@ export default [{
placeholder: "请输入",
rows: 3,
required: false,
readonly: false,
},
ui: {
width: 24
Expand All @@ -110,7 +116,8 @@ export default [{
title: "数值框",
description: "",
placeholder: "请输入",
required: false
required: false,
readonly: false,
},
ui: {
width: 24
Expand All @@ -123,7 +130,8 @@ export default [{
title: "金额框",
description: "",
placeholder: "请输入",
required: false
required: false,
readonly: false,
},
ui: {
width: 24,
Expand Down
1 change: 1 addition & 0 deletions src/widgets/amount/input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
class="w100"
@input.native="inputhandle"
:placeholder="item.attributes.placeholder"
:readonly="'readonly' in item.attributes ? item.attributes.readonly : false"
v-model="item.value"
controls-position="right"
></el-input>
Expand Down
1 change: 1 addition & 0 deletions src/widgets/date/input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
v-model="item.value"
value-format="yyyy-MM-dd HH:mm:ss"
type="date"
:readonly="'readonly' in item.attributes ? item.attributes.readonly : false"
:placeholder="item.attributes.placeholder"
></el-date-picker>
</template>
Expand Down
1 change: 1 addition & 0 deletions src/widgets/datetime/input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
v-model="item.value"
type="datetime"
:placeholder="item.attributes.placeholder"
:readonly="'readonly' in item.attributes ? item.attributes.readonly : false"
></el-date-picker>
</template>

Expand Down
1 change: 1 addition & 0 deletions src/widgets/multi-select/input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
v-model="item.value"
multiple
:placeholder="item.attributes.placeholder"
:readonly="'readonly' in item.attributes ? item.attributes.readonly : false"
>
<el-option
v-for="(option,i) in item.attributes.options"
Expand Down
1 change: 1 addition & 0 deletions src/widgets/number/input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
class="w100"
@input.native="inputhandle"
:placeholder="item.attributes.placeholder"
:readonly="'readonly' in item.attributes ? item.attributes.readonly : false"
v-model="item.value"
controls-position="right"
></el-input>
Expand Down
1 change: 1 addition & 0 deletions src/widgets/select/input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
v-model="item.value"
:placeholder="item.attributes.placeholder"
>
:readonly="'readonly' in item.attributes ? item.attributes.readonly : false"
<el-option
v-for="(option,i) in item.attributes.options"
:key="i"
Expand Down
10 changes: 7 additions & 3 deletions src/widgets/string/input.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<template>
<el-input v-model="item.value" :placeholder="item.attributes.placeholder"></el-input>
<el-input
v-model="item.value"
:placeholder="item.attributes.placeholder"
:readonly="'readonly' in item.attributes ? item.attributes.readonly : false"
></el-input>
</template>

<script>
import vModel from "../../vModel"
import vModel from "../../vModel";
export default {
extends: vModel
extends: vModel,
};
</script>
1 change: 1 addition & 0 deletions src/widgets/textarea/input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
type="textarea"
:rows="item.attributes.rows||3"
:placeholder="item.attributes.placeholder"
:readonly="'readonly' in item.attributes ? item.attributes.readonly : false"
></el-input>
</template>

Expand Down

0 comments on commit ade7ad5

Please sign in to comment.