|
| 1 | +<template> |
| 2 | + <div class="app-container"> |
| 3 | + <!-- Table --> |
| 4 | + <el-button type="text" @click="dialogTableVisible = true">打开嵌套表格的 Dialog</el-button> |
| 5 | + |
| 6 | + <el-dialog title="收货地址" :visible.sync="dialogTableVisible"> |
| 7 | + <el-table :data="gridData"> |
| 8 | + <el-table-column property="date" label="日期" width="150"></el-table-column> |
| 9 | + <el-table-column property="name" label="姓名" width="200"></el-table-column> |
| 10 | + <el-table-column property="address" label="地址"></el-table-column> |
| 11 | + </el-table> |
| 12 | + </el-dialog> |
| 13 | + |
| 14 | + <!-- Form --> |
| 15 | + <el-button type="text" @click="dialogFormVisible = true">打开嵌套表单的 Dialog</el-button> |
| 16 | + |
| 17 | + <el-dialog title="收货地址" :visible.sync="dialogFormVisible"> |
| 18 | + <el-form :model="form"> |
| 19 | + <el-form-item label="活动名称" :label-width="formLabelWidth"> |
| 20 | + <el-input v-model="form.name" autocomplete="off"></el-input> |
| 21 | + </el-form-item> |
| 22 | + <el-form-item label="活动区域" :label-width="formLabelWidth"> |
| 23 | + <el-select v-model="form.region" placeholder="请选择活动区域"> |
| 24 | + <el-option label="区域一" value="shanghai"></el-option> |
| 25 | + <el-option label="区域二" value="beijing"></el-option> |
| 26 | + </el-select> |
| 27 | + </el-form-item> |
| 28 | + </el-form> |
| 29 | + <div slot="footer" class="dialog-footer"> |
| 30 | + <el-button @click="dialogFormVisible = false">取 消</el-button> |
| 31 | + <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button> |
| 32 | + </div> |
| 33 | + </el-dialog> |
| 34 | + </div> |
| 35 | +</template> |
| 36 | + |
| 37 | +<script> |
| 38 | +export default { |
| 39 | + data() { |
| 40 | + return { |
| 41 | + gridData: [{ |
| 42 | + date: '2016-05-02', |
| 43 | + name: '王小虎', |
| 44 | + address: '上海市普陀区金沙江路 1518 弄' |
| 45 | + }, { |
| 46 | + date: '2016-05-04', |
| 47 | + name: '王小虎', |
| 48 | + address: '上海市普陀区金沙江路 1518 弄' |
| 49 | + }, { |
| 50 | + date: '2016-05-01', |
| 51 | + name: '王小虎', |
| 52 | + address: '上海市普陀区金沙江路 1518 弄' |
| 53 | + }, { |
| 54 | + date: '2016-05-03', |
| 55 | + name: '王小虎', |
| 56 | + address: '上海市普陀区金沙江路 1518 弄' |
| 57 | + }], |
| 58 | + dialogTableVisible: false, |
| 59 | + dialogFormVisible: false, |
| 60 | + form: { |
| 61 | + name: '', |
| 62 | + region: '', |
| 63 | + date1: '', |
| 64 | + date2: '', |
| 65 | + delivery: false, |
| 66 | + type: [], |
| 67 | + resource: '', |
| 68 | + desc: '' |
| 69 | + }, |
| 70 | + formLabelWidth: '120px' |
| 71 | + } |
| 72 | + } |
| 73 | +} |
| 74 | +</script> |
| 75 | + |
| 76 | +<style scoped> |
| 77 | + .line { |
| 78 | + text-align: center; |
| 79 | + } |
| 80 | +</style> |
| 81 | + |
0 commit comments