<template>
  <div>
    <div class="container normal-panel normal-margin">
      <add @onSuccess="onSuccess"></add>
    </div>
    <div class="container normal-panel normal-margin">
      <list ref="list">
        <template v-slot:edit="scope">
          <edit v-if="tool.checkAuth($route.name,'update')" :data="scope.data" @onSuccess="onSuccess"  :type="'text'"></edit>
        </template>
        <template v-slot:del="scope">
          <brand_del v-if="tool.checkAuth($route.name,'delete')" :data="scope.data" @onSuccess="onSuccess"  :type="'text'"></brand_del>
        </template>
      </list>
    </div>
    <div id="test"></div>
  </div>
</template>

<script>
import list from './modules/list.vue';
import add from './modules/add';
import edit from './modules/edit';
import brand_del from './modules/brand_del';
export default {
name: "index",
  components:{
    list,
    add,
    edit,
    brand_del
  },
  methods:{
    onSuccess () {
      this.$refs.list.listData()
    },
  }
}
</script>

<style scoped>

</style>