i need to to focus ref with name test1 a set some value which is placed in compontend slot (from outside). Is it possible to do it somehow? I tried to get from $refs or $slots, but failed.
App.vue
<template>
<div id="app">
<HelloWorld>
<input type="text" ref="test1" />
</HelloWorld>
</div>
</template>
```
<script>
import HelloWorld from './components/HelloWorld.vue';
export default {
name: 'App',
components: {
HelloWorld,
},
};
</script>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
Component.vue
<template>
<slot></slot>
<hr />
<input type="text" ref="test2" />
</template>
<script>
export default {
name: 'HelloWorld',
mounted() {
this.$refs.test2.value = 'test 2 value';
// how get ref 'test1' ?
},
};
</script>