无法实现子页面的跳转
自己常见了一个文件夹下面的页面,但无法实现主页面到子页面的跳转,麻烦老师帮忙看看,谢谢<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.name" placeholder="学生姓名" clearable style="width:200px;height: 30px;margin-top: 5px;margin-bottom: 5px;margin-left: 10px"></el-input>
<el-input v-model="dataForm.sex" placeholder="性别" clearable style="width:200px;height: 30px;margin-top: 5px;margin-bottom: 5px;margin-left: 10px"></el-input>
<el-button @click="getDataList()">查询</el-button>
<!-- <el-button @click="addOrUpdateHandle()">新增</el-button> -->
<el-button type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button>批量删除</el-button>
</el-form-item>
</el-form>
<el-table :data="dataList" v-loading="dataListLoading">
<el-table-column label="序号" type="index" width="50">
</el-table-column>
<el-table-column prop="name" header-align="center" align="center" label="学生姓名">
</el-table-column>
<el-table-column prop="password" header-align="center" align="center" label="学生密码">
</el-table-column>
<el-table-column prop="sex" header-align="center" align="center" label="性别">
</el-table-column>
</el-table>
<el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex"
:page-sizes="[2, 20, 50, 100]" :page-size="pageSize" :total="totalPage" layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- "addOrUpdateVisible" -->
<add-or-update v-if="true" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import InsertStudent from './studenPage-insert.vue'
export default {
data() {
return {
dataForm: {
name: '',
sex: ''
},
dataList: [],
pageIndex: 1,
pageSize: 2,
totalPage: 0,
dataListLoading: false,
addOrUpdateVisible: false
}
},
components: {
InsertStudent
},
activated() {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList() {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/student/info/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'name': this.dataForm.name,
'sex': this.dataForm.sex
})
}).then(({
data
}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle(val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle(val) {
this.pageIndex = val
this.getDataList()
},
addOrUpdateHandle(id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
}
}
}
</script>
<style>
</style>