<template>
  <div>
    <list ref="list">
      <add v-if="tool.checkAuth($route.name,'insert')" slot="add" @addClick="addClick"></add>
      <template v-if="tool.checkAuth($route.name,'delete')" v-slot:del="scope">
        <ondel :data="scope.data.data" @onSuccess="$refs.list.queryTypeList()"></ondel>
      </template>
      <template v-if="tool.checkAuth($route.name,'update')" v-slot:edit="scope">
        <edit class="inline-16" :data="scope.data.data" @onSuccess="$refs.list.queryTypeList()" @onEdit="onEdit"></edit>
      </template>
    </list>
  </div>
</template>onSuccess

<script>
import list from './modules/list.vue'
import add from './modules/add.vue'
import edit from './modules/edit.vue'

import ondel from './modules/del.vue'

export default {
  components:{
    list,
    add,
    edit,
    ondel
  },
  methods: {
    addClick () {
      this.$refs.list.addPate()
    },
    onEdit (data) {
      this.$refs.list.cellClick(data)
    }
  }
}

</script>
<style>
</style>