1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
| <template> <PageContainer> // slot 插入header内容 <template slot="header"> <div class="header"> <div class="header-left"> <h1 class="header-title">页面header</h1> <div> <button id="filter-button" @click="onChangeSearchVisible"> 筛选 <i :class="state.formVisible == true ? `el-icon-caret-bottom` : `icon-arrow`" /> </button> </div> </div> </div> <div v-if="state.formVisible" class="header-search"> <el-form ref="formRef" label-width="100px"> <div class="search-row"> <el-form-item label="ID" prop="id"> <el-input @change="onSubmitSearch" placeholder="请输入" clearable size="mini"></el-input> </el-form-item> <el-form-item label="姓名" prop="name"> <el-input @change="onSubmitSearch" placeholder="请输入" clearable size="mini"></el-input> </el-form-item> <el-form-item label="学校" prop="school"> <el-input @change="onSubmitSearch" placeholder="请输入" clearable size="mini"></el-input> </el-form-item> <el-form-item label="学院" prop="department"> <el-input @change="onSubmitSearch" placeholder="请输入" clearable size="mini"></el-input> </el-form-item> <el-form-item label="专业" prop="major"> <el-input @change="onSubmitSearch" placeholder="请输入" clearable size="mini"></el-input> </el-form-item> <el-form-item label="导师" prop="teacher"> <el-input @change="onSubmitSearch" placeholder="请输入" clearable size="mini"></el-input> </el-form-item> </div> </el-form> </div> </template>
// slot content 页面内容 <template slot="content"> <div v-for="(item, index) in [0, 1, 2, 3, 4, 5, 6, 7, 8]" :key="index" style="background-color: green; height: 150px; margin: 20px"> <div style="font-size: 70px">{{ index }}</div> </div> </template> </PageContainer> </template>
<script lang="ts"> import {Component, Vue, Prop} from 'vue-property-decorator' import {PageContainer} from '@/components'
@Component({ name: 'fix-header', components: { PageContainer } }) export default class BatteryRequirement extends Vue { private state = { formVisible: false, form: { id: '', name: '', school: '', department: '', teacher: '', major: '', } }
private onChangeSearchVisible() { this.state.formVisible = !this.state.formVisible }
private onClearForm() { this.state.form = { type: '', user: '', id: '', current_dept: '' } } private onSubmitSearch() { console.log('search筛选') } } </script>
|