Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
data-table
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2022-12-01 09:47:37 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c076454361caa00a26faf868f2dd67a18b426079
c0764543
1 parent
1c31ab51
fix 编辑模式不能提交数据
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
src/views/index.vue
src/views/index.vue
View file @
c076454
...
...
@@ -27,6 +27,7 @@
<van-form @submit="onSubmit">
<van-cell-group :border="false">
<component
:id="item.key"
:ref="item.component_props.name"
v-for="(item, index) in formData"
:key="index"
...
...
@@ -35,8 +36,13 @@
@active="onActive"
/>
</van-cell-group>
<div style="margin: 16px">
<van-button round block type="primary" native-type="submit"> 提交 </van-button>
<div v-if="formData.length" style="margin: 16px">
<van-button v-if="model === 'edit'" round block type="primary">
提交
</van-button>
<van-button v-else round block type="primary" native-type="submit">
提交
</van-button>
</div>
</van-form>
</van-config-provider>
...
...
@@ -76,6 +82,9 @@ const mockData = ref([]);
const formData = ref([]);
const postData = ref({});
// 编辑模式不能提交操作
const model = $route.query.model;
// 格式化表单数据结构
const formatData = (data) => {
const arr = [];
...
...
Please
register
or
login
to post a comment