F
F
frolova_elena2018-07-24 15:02:50
Vue.js
frolova_elena, 2018-07-24 15:02:50

How to implement toggle in dropdown without select?

<span class="dropdown">
        <span href="#" class="select_language">{{selected}}
       <input type="checkbox">
      <ul>
        <select v-model="selected">
        <option><li @click.prevent="localizee('en')">EN</li></option>
        <option><li @click.prevent="localizee('ru')">RU </li></option>
        </select>
      </ul></span>
      </span>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2018-07-24
@frolova_elena

Why not make an array of available languages: And bypass it with v-for:
languages: [ 'en', 'ru' ]

<ul>
  <li
    v-for="lang in languages"
    @click="selected = lang"
  >
    {{ lang }}
  </li>
</ul>

??

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question