0
new Vue({
    el: '#application',

    data: {
        currencies: [
         {
            'name': 'Dollar',
            'sign': '$'
         }, {
            'name': 'Euro',
            'sign': '€'
         }, {
            'name': 'Pound',
            'sign': '£'
         }, {
            'name': 'Cent',
            'sign': '¢'
         }
      ]
    }
});
<select class="custom-select" v-model="quotationForm.currency">
    <option v-for="currency in currencies" v-bind:value="currency.sign">
       <span v-html="currency.sign"></span>
       {{ currency.name }}
    </option>
</select>

Currency sign can not been rendered on the select box.

But when i try to make statis it's works fine as per given below...

<select class="custom-select" v-model="quotationForm.currency">
    <option v-for="currency in currencies" v-bind:value="currency.sign">
        &euro;
        {{ currency.name }}
    </option>
</select>

Whyv-html is not works in the select box? have any suggestion

Thank You.

1 Answer 1

2

I tested it on my own and it's working: Link

<template>
  <select class="custom-select" v-model="quotationForm.currency">
   <option :key="index" v-for="(currency, index) in currencies" v-bind:value="currency.sign">
     <span v-html="currency.sign"></span>
       {{ currency.name }}
   </option>
  </select>
</template>
<script>
export default {
    data() {
     return {
       quotationForm: {
         currency: null
       },
       currencies: [
        {
          'name': 'Dollar',
          'sign': '&#36;'
        }, {
          'name': 'Euro',
          'sign': '&euro;'
        }, {
          'name': 'Pound',
          'sign': '&pound;'
        }, {
          'name': 'Cent',
          'sign': '&cent;'
        }
      ]
    }
 }
}
</script>
Sign up to request clarification or add additional context in comments.

1 Comment

Thaks for your response i really apologize for it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.