S
S
svilkov872019-03-20 08:26:53
Vue.js
svilkov87, 2019-03-20 08:26:53

How to avoid [vue/no-parsing-error] Parsing error: duplicate-attribute?

It is assumed that the component will have data in the form of such hashes:

<template>
    <settings
        :mod="'mod'"
        :ready_site: {
                old_price: 1,
                price: 1100,
        }
        :license: {
                old_price: 20,
                price: 200,
                title: 2,
        }
        :hosting: {
                old_price: 30,
                price: 300,
                title: 4,
        }
</template>

When creating such a construct, I get an error from the linter:
[vue/no-parsing-error]Parsing error: duplicate-attribute.
[vue/no-duplicate-attributes]Duplicate attribute 'old_price:'.
and about the same, but swearing at the same keys in the hash.
If I need the data in the form of hashes with keys, then how to avoid the error above?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-03-20
@svilkov87

:license="{
  old_price: 20,
  price: 200,
  title: 2,
}"

Well, the rest are the same.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question