0

Можно ли поместить выбираемые теги не в поле инпута, а в div снизу? https://codepen.io/Dgacarda/pen/OBxKQE?editors=1010

<div id="app">
  <v-app id="inspire">
    <v-combobox :items="items" v-model="chips" label="Выберите тег" clearable chips solo multiple>
      <template slot="selection" slot-scope="data">
        <v-chip :selected="data.selected" close @input="remove(data.item)">
          <strong>{{ data.item }}</strong>&nbsp;
          <span>(interest)</span>
        </v-chip>
      </template>
    </v-combobox>
    <div id="output"></div>
  </v-app>
</div>

new Vue({
  el: '#app',
  data () {
    return {
      chips: [],
      items: ['Streaming', 'Eating']
    }
  },

  methods: {
    remove (item) {
      this.chips.splice(this.chips.indexOf(item), 1)
      this.chips = [...this.chips]
    }
  }
})

1 ответ 1

1

<div id="output">{{chips}}</div>

<div id="output2">
  <span v-for="(item, index) in chips" :key="index">{{item}}</span>
</div>

вы ведет выделенные https://codepen.io/Rusic/pen/Xxzzqx?editors=1010 Если нужно оформить, то v-for поможет.

1

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.