代码拉取完成,页面将自动刷新
目前发现只是列表展示有问题,新增和编辑都正常
代码如下:
<template>
<basic-container>
<avue-crud :data="data" :option="option"></avue-crud>
</basic-container>
</template>
<script>
import ApiBase from '@/api/apiBase'
export default {
data() {
return {
masterApi: ApiBase,
masterUri: this.$route.path,
data: [],
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
query: {
ordering: '',
search: ''
},
option:{
title:'表格的标题',
page: true,
align:'center',
menuAlign:'center',
column:[]
}
}
},
created() {
this.onLoad()
},
methods: {
getList() {
let params = Object.assign(this.page, this.query)
this.masterApi.list(this.masterUri, params).then(res => {
this.data = res.results
this.page.total = res.count
});
},
onLoad() {
this.masterApi.getOption(this.masterUri).then(res => {
// this.option.column = [{'label': 'name', 'value': 'name'}, {'label': 'sex', 'value': 'sex'}]
this.option = Object.assign(this.option, res.option)
this.getList()
})
}
},
}
</script>
可以更新到最新版本2.6.15试下
参考https://avuejs.com/doc/crud/crud-ajax
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
登录 后才可以发表评论