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

206
Views
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 answers
Answer question

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 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!