提交 b4bb9962 authored 作者: 王鹏飞's avatar 王鹏飞

chore: update

上级 ca06dbb9
{ {
"name": "@ezijing/vue-form", "name": "@ezijing/vue-form",
"version": "2.3.15", "version": "2.3.17",
"private": false, "private": false,
"description": "基于Vue Element-UI的表单", "description": "基于Vue Element-UI的表单",
"scripts": { "scripts": {
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
<template v-else> <template v-else>
<v-card v-bind="page" v-on="$listeners"> <v-card v-bind="page" v-on="$listeners">
<slot name="content-header"></slot>
<slot name="content"> <slot name="content">
<div class="v-layout-html" v-html="page.html" v-if="page.html"></div> <div class="v-layout-html" v-html="page.html" v-if="page.html"></div>
<v-form-pane v-bind="page" v-on="$listeners" v-if="page.form"> <v-form-pane v-bind="page" v-on="$listeners" v-if="page.form">
...@@ -30,6 +31,7 @@ ...@@ -30,6 +31,7 @@
</template> </template>
</v-form-pane> </v-form-pane>
</slot> </slot>
<slot name="content-footer"></slot>
</v-card> </v-card>
</template> </template>
</slot> </slot>
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
<div class="v-form-pane__hint" v-html="form.hint"></div> <div class="v-form-pane__hint" v-html="form.hint"></div>
</template> </template>
<!-- 多个表单 --> <!-- 多个表单 -->
<template v-if="form.hasAdd && isMultiple"> <template v-if="isMultiple">
<v-form :options="form.options" :items="form.prependItems" :model="model[0] || model" :hasButton="false" v-on="$listeners" ref="form" v-if="form.prependItems"></v-form>
<template v-for="(item, index) in model"> <template v-for="(item, index) in model">
<div class="v-form-group" :key="index"> <div class="v-form-group" :key="index">
<div class="v-form-group__inner"> <div class="v-form-group__inner">
...@@ -26,19 +27,10 @@ ...@@ -26,19 +27,10 @@
</v-form> </v-form>
<template v-if="form.aside"> <template v-if="form.aside">
<div class="v-form-group__aside"> <div class="v-form-group__aside">
<div <div v-html="form.aside.prepend.html" v-if="form.aside.prepend.visible && form.aside.prepend.visible(item)"></div>
v-html="form.aside.prepend.html"
v-if="form.aside.prepend.visible && form.aside.prepend.visible(item)"
></div>
<div> <div>
<div v-for="(button, i) in form.aside.buttons" :key="i"> <div v-for="(button, i) in form.aside.buttons" :key="i">
<el-button <el-button type="primary" size="medium" plain @click="button.onClick(item, $refs.form[index])" v-if="button.visible && button.visible(item)">
type="primary"
size="medium"
plain
@click="button.onClick(item, $refs.form[index])"
v-if="button.visible && button.visible(item)"
>
{{ button.text }}</el-button {{ button.text }}</el-button
> >
</div> </div>
...@@ -51,32 +43,15 @@ ...@@ -51,32 +43,15 @@
</template> </template>
</div> </div>
</template> </template>
<div class="v-form-group__add"> <div class="v-form-group__add" v-if="form.hasAdd">
<i class="el-icon-circle-plus" @click="handleAdd"></i> <i class="el-icon-circle-plus" @click="handleAdd"></i>
</div> </div>
<v-form <v-form :options="form.options" :items="form.appendItems" :model="model[0] || model" :hasButton="false" v-on="$listeners" ref="form" v-if="form.appendItems"></v-form>
:options="form.options"
:items="form.appendItems"
:model="model[0] || model"
:hasButton="false"
v-on="$listeners"
ref="form"
v-if="form.appendItems"
></v-form>
</template> </template>
<!-- 一个表单 --> <!-- 一个表单 -->
<template v-else> <template v-else>
<v-form <v-form :options="form.options" :items="form.items" :model="model" :hasButton="false" :submitText="form.submitText" @onSubmit="onSubmit" v-on="$listeners" ref="form">
:options="form.options"
:items="form.items"
:model="model"
:hasButton="false"
:submitText="form.submitText"
@onSubmit="onSubmit"
v-on="$listeners"
ref="form"
>
<!-- slot --> <!-- slot -->
<template v-slot:[slotName]="slotProps" v-for="slotName in slotNames"> <template v-slot:[slotName]="slotProps" v-for="slotName in slotNames">
<slot :name="slotName" v-bind="slotProps"></slot> <slot :name="slotName" v-bind="slotProps"></slot>
...@@ -86,14 +61,9 @@ ...@@ -86,14 +61,9 @@
<div class="v-form-footer"> <div class="v-form-footer">
<el-button type="primary" size="medium" @click="handlePrev" v-if="form.prev">上一步</el-button> <el-button type="primary" size="medium" @click="handlePrev" v-if="form.prev">上一步</el-button>
<el-button <el-button type="primary" size="medium" :disabled="currentForm.options.disabled" @click="handleSubmit" v-if="currentForm.hasButton">{{
type="primary" form.submitText || '保存'
size="medium" }}</el-button>
:disabled="currentForm.options.disabled"
@click="handleSubmit"
v-if="currentForm.hasButton"
>{{ form.submitText || '保存' }}</el-button
>
<el-button type="primary" size="medium" @click="handleNext" v-if="form.next">下一步</el-button> <el-button type="primary" size="medium" @click="handleNext" v-if="form.next">下一步</el-button>
</div> </div>
</div> </div>
...@@ -157,16 +127,7 @@ export default { ...@@ -157,16 +127,7 @@ export default {
}, },
// 获取 // 获取
getData() { getData() {
let { let { action: url, method = 'get', headers = {}, params = {}, data = {}, beforeRequest, callback, errorCallback } = this.get
action: url,
method = 'get',
headers = {},
params = {},
data = {},
beforeRequest,
callback,
errorCallback
} = this.get
if (beforeRequest) { if (beforeRequest) {
data = beforeRequest(data) data = beforeRequest(data)
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论