tableMixin.js 647 Bytes
import { mapGetters } from 'vuex'
let mixin = {
  data () {
    return {
      formData: {
        pageSize: 10
      }
    }
  },
  computed: {
    ...mapGetters(['dicData'])
  },
  created () {
    this.featchData()
  },
  methods: {
    // 表格索引得问题
    indexMethod (index) {
      return index + 1 + (this.form.currentPage - 1) * this.formData.pageSize;
    },
    handleSizeChange (val) {
      this.formData.pageSize = val
      this.featchData()
    },
    handleCurrentChange (val) {
      this.form.currentPage = val
      this.featchData()
    },
    handleSubmit () {
      this.featchData()
    }
  }
}
export default mixin