<template>
  <div class="app-container">
    <el-row :gutter="6">
      <el-col :span="13">
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span>菜单</span>
          </div>
          <div class="item">
            <menus @refreshSubView="refreshSubView" />
          </div>
        </el-card>

      </el-col>
      <el-col :span="11">
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span>[{{ carName }}]</span>
          </div>
          <div class="item">
            <register ref="register" />
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
  import menus from './components/menu'
  import register from './components/register'

  export default {
    name: 'stcd',
    components: { menus, register },
    data() {
      return {
        carName: '未选择'
      }
    },
    methods: {
      refreshSubView(row) {
        console.log('row',row)
        this.carName = row.menuName
        this.$refs.register.refreshSubView(row)
      }
    }
  }
</script>
