Search code examples
javascriptvue.jsvuejs2dropdownsemantic-ui

How to show placeholder in semantic-ui-vue dropdown without multiple attribute?


I am using semantic-ui-vue dropdown and the placeholder option is not working if I don't use multiple attribute.

Here is my sandbox link .

I have placed 2 dropdowns:

  1. Dropdown without multiple attribute - Placeholder not working
  2. Dropdown with multiple attribute - Placeholder working

How to put placeholder in the 1st dropdown? In the same case, placeholder is working in their official documentation.


Solution

  • semantic-ui-vue requires the v-model value to be null in order to consider it "empty"

    So, if you modify your code to instead of defaulting to an empty string from: "" you default to from: null