204 Star 2.2K Fork 1.2K

smallchill / Saber

 / 详情

升级2.5.3版本之后option从后端接口获取crud出现列表展示字段显示为空

Backlog
Opened this issue  
2020-09-14 09:26

目前发现只是列表展示有问题,新增和编辑都正常

输入图片说明
输入图片说明

代码如下:

<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>

Comments (1)

feilong created任务
feilong set related repository to smallchill/Saber
Expand operation logs

可以更新到最新版本2.6.15试下
参考https://avuejs.com/doc/crud/crud-ajax

Sign in to comment

Status
Assignees
Milestones
Pull Requests
Successfully merging a pull request will close this issue.
Branches
Planed to start   -   Planed to end
-
Top level
Priority
参与者(2)
632261 smallweigit 1588214431
JavaScript
1
https://git.oschina.net/smallc/Saber.git
git@git.oschina.net:smallc/Saber.git
smallc
Saber
Saber

Search

101014 b92fc32e 1850385 101014 af024cb7 1850385