user_v12
user_v12

Reputation: 589

Show data in Vuejs

I want to show DB data using Vuejs. I want to show some product codes. It shows well as I expected. I want to show now description instead of code. But when I try it other prices and all things are changing.

I have mentioned below tried code ->

<template v-for="(chosen_configuration, index) in quote.chosen_configurations">
    <td colspan="3">
      <select id="configuration" name="configuration" v-model="quote.chosen_configurations[index]">
        <option v-for="configuration in quote.configurations" v-text="configuration.configuration_code"></option>
      </select>
    </td>
</template>

I want to show configuration.description instead of v-text="configuration.configuration_code" But when I try v-text="configuration.description" it not workes.

How can I show data using configuration.description without changing v-text="configuration.configuration_code". Is that possible ?

Upvotes: 0

Views: 45

Answers (1)

ptheodosiou
ptheodosiou

Reputation: 400

Am adding the code you need, If we understood exactly your request. If it is what you're looking for, accept it as a solution.

<template v-for="(chosen_configuration, index) in quote.chosen_configurations">
  <td colspan="3" :key="index">
    <select id="configuration" name="configuration" v-model="quote.chosen_configurations[index]">
      <option v-for="(configuration, j) in quote.configurations" :key="j" v-text="configuration.description" :value="configuration.configuration_code"></option>
    </select>
  </td>
</template>

Upvotes: 1

Related Questions