Vue Custom component ref reported an error

when using custom components to use ref, an error is found.
when correct: click the button input box focus

 <div id="L4">
                <ref-component>
                </ref-component>
                
           </div>
           <script>
            Vue.component("ref-component",{
              template:`
                        <div>
                           <input ref="name" type="text">
                            <button  @click="focus">fouce</button>
                        </div>
                       `,
              methods:{
                focus:function(){
                this.$refs.name.focus()
                }
              }
            })
            new Vue({
              el:"-sharpL4"
            })

but if the button event is executed when the input box is written to a subcomponent, an error will be reported

     <div id="L4">
                <ref-component>
                </ref-component>
                
           </div>
           <script>
            Vue.component("ref-component",{
              template:`
                        <div>
                           <refs-component ref="name"></refs-component>
                            <button  @click="focus">fouce</button>
                        </div>
                       `,
              methods:{
                focus:function(){
                this.$refs.name.focus()
                }
              }
            })
            Vue.component("refs-component",{
              template:`<input type="text" />`
            })
            new Vue({
              el:"-sharpL4"
            })
           </script>

error report is

clipboard.png

how can I access the contents of this subcomponent?

Mar.12,2021

obviously refs-component this component does not have a focus method, and you do not have a reference on input

Vue.component('refs-component',{
  template:`<input ref='input' type="text" />`,
  methods: {
     focus(){
         this.$refs.input.focus();
     }
  }    
})

try this

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c1f7-2c2df.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c1f7-2c2df.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?