<template>
  <div>
    <TfMenuItem
      :key="url"
      :class="{'sub-page': !children || children.length === 0}"
      :index="url"
    >
      {{ text }}
    </TfMenuItem>
    <ExampleMenuItem
      v-for="child of children"
      :key="child.url"
      :url="child.url"
      :text="child.text"
      :children="child.children"
    />
  </div>
</template>

<script>
  export default {
    name: 'ExampleMenuItem',
    props: {
      url: {
        type: String,
        default: null,
      },
      text: {
        type: String,
        default: null,
      },
      children: {
        type: Array,
        default: () => [],
      },
    },
  };
</script>
