<template>
  <div>
    <input v-focus>
    <span>title:{{title}}</span>
    <span>author:{{author}}</span>
  </div>
</template>

<script>
export default {
  name: 'InputTest',
  props: {
    title: {
      type: String,
      required: true
    },
    author: {
      type: String,
      required: false
    }
  },
  directives: {
    focus: {
      inserted: function(el) {
        el.focus()
      }
    }
  },
  data() {
    return {}
  }
}
</script>
