Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

142
Views
Cambiar el marcador de posición según la opción del cuadro de selección seleccionada

Tengo un cuadro de selección que obtiene un valor. Quiero que mi entrada obtenga el valor del cuadro de selección si se selecciona esa opción en el cuadro de selección. Me refiero a cambiar dinámicamente el marcador de posición de entrada por el cual se selecciona la opción.

enlace sandbox a mi código

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Intente como el siguiente fragmento (puede crear un método y encontrar la opción seleccionada):

 new Vue({ el: "#demo", data() { return { text: "", selected: null, options: [ { value: null, text: "Please select an option" }, { value: "a", text: "This is First option" }, { value: "b", text: "Selected Option" }, { value: { C: "3PO" }, text: "This is an option with object value" }, { value: "d", text: "This one is disabled", disabled: true }, ], }; }, methods: { place() { if (this.selected) return this.options.find(o => o.value === this.selected).text } } })
 <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script> <link type="text/css" rel="stylesheet" href="https://unpkg.com/bootstrap/dist/css/bootstrap.min.css" /> <link type="text/css" rel="stylesheet" href="https://unpkg.com/bootstrap-vue@latest/dist/bootstrap-vue.min.css" /> <script src="https://polyfill.io/v3/polyfill.min.js?features=es2015%2CIntersectionObserver" crossorigin="anonymous"></script> <script src="https://unpkg.com/bootstrap-vue@latest/dist/bootstrap-vue.min.js"></script> <script src="https://unpkg.com/bootstrap-vue@latest/dist/bootstrap-vue-icons.min.js"></script> <div id="demo" class="container"> <b-form-select v-model="selected" :options="options" size="sm" class="mt-3" ></b-form-select> <div class="mt-3"> Selected: <strong>{{ selected }}</strong> </div> <b-form-input v-model="text" :placeholder="place()"></b-form-input> <div class="mt-2">Value: {{ text }}</div> </div>

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!