Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

209
Vistas
Storefront UI - SfComponentSelect don't work properly

In my own component, i'm using SfComponentSelect (here in official docs)

When I click on option of select, selected option not show above the label "MySelect", this happen otherwise on sample inside the official docs.

This is my 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 Respuestas
Responde la pregunta

0

After struggling on problem, i've found a solution for this problem.

  1. Create new component (called: MyNewComponent) defining SfComponentSelect as mixins and copying from template and scss from SfComponentSelect.
  2. Defining for MyNewComponent a new props and html for this
  3. Using MyNewComponent as below

<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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda