Struggling with the following example, seeking assistance
new Vue({
el:"#app",
data: {
items: [
{
type: "a",
Descr: "searching"
},
{
type: "a",
Descr: "maps"
},
{
type: "b",
Descr: "maps and social"
},
{
type: "b",
Descr: "searching"
},
{
type: "c",
Descr: "maps"
},
{
type: "c",
Descr: "maps and social"
},
{
type: "any_value",
Descr: "maps and social"
}
]
},
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="app">
<div v-for="(item,i) in items" :key="i">
<div>{{item.type}}</div>
<div>{{item.Descr}}</div>
</div>
</div>
Current output:
a
searching
a
maps
b
maps and social
b
searching
c
maps
c
maps and social
any_value
maps and social
Desired output:
a
--------
* searching
* maps
b
--------
* maps and social
* searching
c
--------
* maps
* maps and socials
any_value
--------
* maps and social
Note : type and Descr can be any value
,but i want them to list under the type like above example
Highly appreciated if it can be achieved using a single v-if property.
-------------------------------End------------------------------------------- this line is because the error saying It looks like your post is mostly code; please add some more details