Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

focus on child components on single page applications - 2

<template>
  <div>
    <input type="text" ref="childInput" />
  </div>
</template>

<script>
export default {
  name: 'child',
  mounted() {
    this.$root.$on('focusChildInput', () => this.$refs.childInput.focus());
  },
};
</script>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #focus #child #components #single #page #applications
ADD COMMENT
Topic
Name
1+1 =