-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
179 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<script lang="ts" setup> | ||
import { reactive, ref } from 'vue' | ||
const dialogFormVisible = ref(false) | ||
const formLabelWidth = '140px' | ||
const form = reactive({ | ||
name: '', | ||
region: '', | ||
date1: '', | ||
date2: '', | ||
delivery: false, | ||
type: [], | ||
resource: '', | ||
desc: '' | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div class="main-container"> | ||
<el-button plain @click="dialogFormVisible = true"> Open a Form nested Dialog </el-button> | ||
<el-dialog v-model="dialogFormVisible" title="Shipping address" width="500"> | ||
<el-form :model="form"> | ||
<el-form-item label="Promotion name" :label-width="formLabelWidth"> | ||
<el-input v-model="form.name" autocomplete="off" /> | ||
</el-form-item> | ||
<el-form-item label="Zones" :label-width="formLabelWidth"> | ||
<el-select v-model="form.region" placeholder="Please select a zone"> | ||
<el-option label="Zone No.1" value="shanghai" /> | ||
<el-option label="Zone No.2" value="beijing" /> | ||
</el-select> | ||
</el-form-item> | ||
</el-form> | ||
<template #footer> | ||
<div class="dialog-footer"> | ||
<el-button @click="dialogFormVisible = false">Cancel</el-button> | ||
<el-button type="primary" @click="dialogFormVisible = false"> Confirm </el-button> | ||
</div> | ||
</template> | ||
</el-dialog> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
.main-container { | ||
background-color: #fff; | ||
padding: 24px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<script lang="ts" setup> | ||
import { reactive, ref } from 'vue' | ||
import type { FormInstance } from 'element-plus' | ||
const formRef = ref<FormInstance>() | ||
const initFormData = { | ||
user: '', | ||
region: '', | ||
date: '' | ||
} | ||
const formInline = reactive(initFormData) | ||
const onReset = () => { | ||
if (formRef.value) { | ||
formRef.value.resetFields() | ||
} | ||
} | ||
const onSubmit = () => { | ||
console.log('submit!') | ||
} | ||
</script> | ||
|
||
<template> | ||
<el-form ref="formRef" :inline="true" :model="formInline" class="demo-form-inline"> | ||
<el-form-item label="Approved by" prop="user"> | ||
<el-input v-model="formInline.user" placeholder="Approved by" clearable /> | ||
</el-form-item> | ||
<el-form-item label="Activity zone" prop="region"> | ||
<el-select v-model="formInline.region" placeholder="Activity zone" clearable> | ||
<el-option label="Zone one" value="shanghai" /> | ||
<el-option label="Zone two" value="beijing" /> | ||
</el-select> | ||
</el-form-item> | ||
<el-form-item label="Activity time" prop="date"> | ||
<el-date-picker v-model="formInline.date" type="date" placeholder="Pick a date" clearable /> | ||
</el-form-item> | ||
<el-form-item> | ||
<el-button type="primary" @click="onReset">重置</el-button> | ||
</el-form-item> | ||
<el-form-item> | ||
<el-button type="primary" @click="onSubmit">查询</el-button> | ||
</el-form-item> | ||
</el-form> | ||
</template> | ||
|
||
<style> | ||
.demo-form-inline .el-input { | ||
--el-input-width: 220px; | ||
} | ||
.demo-form-inline .el-select { | ||
--el-select-width: 220px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters