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-09-06 15:09:39 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ead4785c6ccae57a16de0bb086ff5fed2e629f2b
ead4785c
1 parent
10251db3
✨ feat: 新增表单封面和表单描述
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
src/views/index.vue
src/views/index.vue
View file @
ead4785
<!--
* @Date: 2022-07-18 10:22:22
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-09-06 1
4:41:04
* @LastEditTime: 2022-09-06 1
5:05:23
* @FilePath: /data-table/src/views/index.vue
* @Description: 首页
-->
<template>
<van-image
width="100%" height="200" src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg
" />
<div
style="padding: 1rem;">表单描述
</div>
<div
style="padding: 1rem;
">
<van-image
v-if="table_cover" width="100%" height="200" :src="table_cover
" />
<div
v-if="table_title" class="table-title">{{ table_title }}
</div>
<div
class="table-box
">
<van-form @submit="onSubmit">
<van-cell-group>
<component v-for="(item, index) in mockData" :key="index" :is="item.component" :item="item" />
...
...
@@ -20,14 +20,18 @@
</div>
</van-form>
</div>
</template>
<script setup>
import { createComponentType } from '@/hooks/useComponentType'
const table_cover = ref('');
const table_title = ref('');
const mockData = ref([]);
onMounted(() => {
table_cover.value = 'https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg'
table_title.value = '这是一个表单的描述'
mockData.value = [{
key: 'phone',
value: '',
...
...
@@ -165,4 +169,10 @@ const onSubmit = (values) => {
</script>
<style lang="less" scoped>
.table-title {
padding: 1rem;
}
.table-box {
padding: 1rem;
}
</style>
...
...
Please
register
or
login
to post a comment