diff --git a/examples/views/index.vue b/examples/views/index.vue
index 5075bb6..a8349b9 100644
--- a/examples/views/index.vue
+++ b/examples/views/index.vue
@@ -60,6 +60,10 @@
+ 表单生成器 eagle-form
+
+
+
@@ -73,6 +77,10 @@ export default {
treeSelectValue: undefined,
treeSelectDataSource: [
{ id: 0, label: '一级菜单', children: [{ id: 1, label: '二级菜单-1' }, { id: 2, label: '二级菜单-2', children: [{ id: 3, label: '三级菜单' }] }] }
+ ],
+ formValue: {},
+ formList: [
+ { type: 'el-input' }
]
}
},
diff --git a/packages/cform/index.vue b/packages/cform/index.vue
new file mode 100644
index 0000000..4b60524
--- /dev/null
+++ b/packages/cform/index.vue
@@ -0,0 +1,271 @@
+
+
+
+
+
+
+
+
+
+
+ {{ data.title }}
+
+
+
+
+ handleComponentInput(e, item)" :is="item.type" @change="(e) => handleComponentChange(e, item)" v-on="handleComponentOn(item)" :style="componentStyle(item.style)" v-model="model[item.key]" v-bind="componentProps(item)">
+
+
+
+
+
+
+
+
+
+
+
+
+ handleComponentInput(e, item)" :is="item.type" @change="(e) => handleComponentChange(e, item)" v-on="handleComponentOn(item)" :style="componentStyle(item.style)" v-model="model[item.key]" v-bind="componentProps(item)">
+
+
+
+
+
+
+
+ 确定
+ 取消
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/dist-picker/dist-picker-inner.vue b/packages/dist-picker/dist-picker-inner.vue
index 51010bb..ea3ee00 100644
--- a/packages/dist-picker/dist-picker-inner.vue
+++ b/packages/dist-picker/dist-picker-inner.vue
@@ -114,7 +114,7 @@ export default {
}
},
created() {
- if (this.type != 'mobile') {
+ if (this.type !== 'mobile') {
this.provinces = this.getDistricts()
this.cities = this.province ? this.getDistricts(this.getAreaCode(this.determineType(this.province))) : []
this.areas = this.city ? this.getDistricts(this.getAreaCode(this.determineType(this.city), this.area)) : []
@@ -140,11 +140,11 @@ export default {
},
currentCity(value) {
this.$emit('city', this.setData(value, this.currentProvince))
- if (value != this.placeholders.city && this.hideArea) this.emit('selected')
+ if (value !== this.placeholders.city && this.hideArea) this.emit('selected')
},
currentArea(value) {
this.$emit('area', this.setData(value, this.currentProvince))
- if (value != this.placeholders.area) this.emit('selected')
+ if (value !== this.placeholders.area) this.emit('selected')
},
province(value) {
this.currentProvince = this.province || this.placeholders.province
@@ -240,7 +240,7 @@ export default {
if (codes.length > 1) {
let index
codes.forEach((item, i) => {
- if (item.slice(0, 2) == preCode) {
+ if (item.slice(0, 2) === preCode) {
index = i
}
})
diff --git a/packages/editor/index.vue b/packages/editor/index.vue
index 9cbca10..565b556 100644
--- a/packages/editor/index.vue
+++ b/packages/editor/index.vue
@@ -93,16 +93,16 @@ export default {
container: [
['bold', 'italic', 'underline', 'strike'],
['blockquote', 'code-block'],
- [{'header': 1}, {'header': 2}],
- [{'list': 'ordered'}, {'list': 'bullet'}],
- [{'script': 'sub'}, {'script': 'super'}],
- [{'indent': '-1'}, {'indent': '+1'}],
- [{'direction': 'rtl'}],
- [{'size': ['12px', '14px', '16px', '18px', '20px', '24px', '32px']}],
- [{'header': [1, 2, 3, 4, 5, 6, false]}],
- [{'color': []}, {'background': []}],
- [{'font': ['SimSun', 'SimHei', 'Microsoft-YaHei', 'KaiTi', 'FangSong', 'Arial', 'Times-New-Roman', 'sans-serif']}],
- [{'align': []}],
+ [{ 'header': 1 }, { 'header': 2 }],
+ [{ 'list': 'ordered' }, { 'list': 'bullet' }],
+ [{ 'script': 'sub' }, { 'script': 'super' }],
+ [{ 'indent': '-1' }, { 'indent': '+1' }],
+ [{ 'direction': 'rtl' }],
+ [{ 'size': ['12px', '14px', '16px', '18px', '20px', '24px', '32px'] }],
+ [{ 'header': [1, 2, 3, 4, 5, 6, false] }],
+ [{ 'color': [] }, { 'background': [] }],
+ [{ 'font': ['SimSun', 'SimHei', 'Microsoft-YaHei', 'KaiTi', 'FangSong', 'Arial', 'Times-New-Roman', 'sans-serif'] }],
+ [{ 'align': [] }],
['clean'],
['link', 'image', 'video']
],
diff --git a/packages/index.js b/packages/index.js
index a7ca4b0..c17e6a2 100644
--- a/packages/index.js
+++ b/packages/index.js
@@ -3,6 +3,7 @@ import Confirm from './confirm'
import DistPicker from './dist-picker'
import Editor from './editor'
import FileUpload from './file-upload'
+import Cform from './cform'
import ImageUpload from './Image-upload'
import ImageUploadMultiple from './Image-upload/multiple'
import ImageView from './image-view'
@@ -13,6 +14,7 @@ import SwitchButton from './switch-button'
import TreeSelect from './tree-select'
const components = {
+ Cform,
Code,
Confirm,
DistPicker,
--
libgit2 0.21.0