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

chore: update

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