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

208
Views
Interfaz de usuario de Storefront: SfComponentSelect no funciona correctamente

En mi propio componente, estoy usando SfComponentSelect ( aquí en documentos oficiales )

Cuando hago clic en la opción de selección, la opción seleccionada no se muestra encima de la etiqueta "MySelect", de lo contrario, esto sucede en la muestra dentro de los documentos oficiales.

Este es mi CustomComponent.vue

 <template> <SfComponentSelect label="MySelect"> <SfComponentSelectOption v-for="option in optionsList" :key="option.value" :value="option.value" class="sort-by__option" >{{ option.label }}</SfComponentSelectOption> </SfComponentSelect> </template> <script> import { SfComponentSelect } from '@storefront-ui/vue'; export default { name: "CustomComponent", components: { SfComponentSelect }, data(){ return { optionsList: [ { value: "opt-1", label: "Option 1", }, { value: "opt-2", label: "Option 2", } ] } } }; </script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Después de luchar con el problema, encontré una solución para este problema.

  1. Cree un nuevo componente (llamado: MyNewComponent) definiendo SfComponentSelect como mixins y copiando desde template y scss desde SfComponentSelect.
  2. Definiendo para MyNewComponent nuevos accesorios y html para esto
  3. Usando MyNewComponent como se muestra a continuación

 <SelectStore :label="name" :size="pdvLists.length" @change="changeLabel" :my-new-label="myNewLabel" persistent> <SfComponentSelectOption v-for="option in options" :key="option.value" :value="option.value" class="sort-by__option" >{{ option.name }}</SfComponentSelectOption> </SelectStore> <script> import MyNewComponent from './MyNewComponent'; export default { name: "ComponentBlaBla", components: { MyNewComponent }, data() { return { options: [ { value: "opt1", name: "Opt1" }, { value: "opt2", name: "Opt2" } ], myNewLabel: '' } }, methods: { changeLabel(value){ // change something let selectedOption = this.options.filter((item) => value === item.value); this.myNewLabel = selectedOption[0].name; } } }; </script>

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!