what's the real purpose of 'ref' attribute?

what'd
what w
how to pronounce what
what c
what p
what h
gehat definition
what kind of word is what

I'm really confused with the "ref" attribute of the input element. I've never heard it based on my knowledge and can't find some meaningful materials about it.The code is in vue.js offical documents.

<currency-input v-model="price"></currency-input>

This is code about the component:

Vue.component('currency-input', {
  template: `
    <span>
      $
      <input
        ref="input"
        v-bind:value="value"
        v-on:input="updateValue($event.target.value)">
    </span>
  `,
  props: ['value'],

what's the meaning of the value of ref attribute that equals to input?


The main purpose of the ref attribute is to make the DOM element selectable by being the key in the parent $refs attribute.

For example your input element there, with ref="input", would expose its DOM node in its parent (here inside currency-input this), as this.$refs["input"] (or this.$refs.input).

See: https://vuejs.org/v2/api/#ref

It has several use cases, even if it would be often better when possible to not manipulate the DOM directly. For example, a legitimate use case here is to put focus on this input: for that you can use this.$refs["input"].focus() in a method of the component...

What, English Language Learners Definition of for —used to indicate the place someone or something is going to or toward. —used to indicate the person or thing that something is sent or given to. —used to indicate the thing that something is meant to be used with. Quickly send and receive WhatsApp messages right from your computer. Quickly send and receive WhatsApp messages right from your computer. WhatsApp Web.


For, is classified under pronouns because it replaces a thing or a noun. noun the true nature or identity of something, or the sum of its characteristics: a lecture on the whats and hows of crop rotation.


There's one use case I find ref attribute particularly useful is in Vue component testing. Adding ref attribute to your html element makes it easily retrieved in testing (e.g. const fooRef = wrapper.find({ ref: 'foo' })). This is particularly handy when you do not want to add id or class attributes as they are usually also used for styling purposes, for example, adding classes just for identifying element could result in unexpected styles if these names are already (or later on) being used in global style sheets.

What Part of Speech is “WHAT”, 're going to sum something up in just a few words. Another way to say this would be "to make a long story short." informal a punishment or reprimand (esp in the phrase give (a person) what for) 7. what have you someone, something, or somewhere unknown or unspecified: cars, motorcycles, or what have you. 8.


What have you definition and meaning, I will do what I can to help you. TranslationsEdit. show ▽what? (interrogative pronoun)  In current usage that refers to persons or things, which chiefly to things and rarely to subhuman entities, who chiefly to persons and sometimes to animals. The notion that that should not be used to refer to persons is without foundation; such use is entirely standard.


in a nutshell, what meaning: 1. used to ask for information about people or things: 2. used in questions that show you are…. Learn more. WhatsApp Messenger: More than 2 billion people in over 180 countries use WhatsApp to stay in touch with friends and family, anytime and anywhere. WhatsApp is free and offers simple, secure, reliable messaging and calling, available on phones all over the world.


what, Medical researchers have been studying everything we know about Covid-19. What have they learned – and is it enough to halt the pandemic? Seen a font in use and want to know what it is? Upload an image to WhatTheFont to find the closest matches in our database.