changed data structure

This commit is contained in:
Moriz Wahl 2019-11-27 10:17:39 +01:00
parent 8758bc9e42
commit 433e7d409a
2 changed files with 12 additions and 11 deletions

View File

@ -6,10 +6,12 @@ import helpers from '~/storybook/helpers'
helpers.init()
export const results = [
{
heading: 'Contributions'
},
{
id: 'de100841-2336-4b01-a574-f1bd2c0b262a',
searchType: 'Contributions',
firstType: true,
slug: 'user-post-by-jenny',
label: 'User Post by Jenny',
value: 'User Post by Jenny',
@ -24,7 +26,6 @@ export const results = [
{
id: 'f48f00a0-c412-432f-8334-4276a4e15d1c',
searchType: 'Contributions',
firstType: false,
slug: 'eum-quos-est-molestiae-enim-magni-consequuntur-sed-commodi-eos',
label: 'Eum quos est molestiae enim magni consequuntur sed commodi eos.',
value: 'Eum quos est molestiae enim magni consequuntur sed commodi eos.',
@ -39,7 +40,6 @@ export const results = [
{
id: 'p7',
searchType: 'Contributions',
firstType: false,
slug: 'this-is-post-7',
label: 'This is post #7',
value: 'This is post #7',
@ -54,7 +54,6 @@ export const results = [
{
id: 'p12',
searchType: 'Contributions',
firstType: false,
slug: 'this-is-post-12',
label: 'This is post #12',
value: 'This is post #12',
@ -66,9 +65,11 @@ export const results = [
slug: 'louie',
},
},
{
heading: 'Users'
},
{
id: 'u1',
firstType: true,
searchType: 'Users',
name: 'Peter Lustig',
label: 'Peter Lustig',
@ -85,7 +86,6 @@ export const results = [
{
id: 'u2',
searchType: 'Users',
firstType: false,
name: 'Bob der Baumeister',
label: 'Bob der Baumeister',
slug: 'bob-der-baumeister',
@ -93,7 +93,6 @@ export const results = [
{
id: '7b654f72-f4da-4315-8bed-39de0859754b',
searchType: 'Users',
firstType: false,
name: 'Tonya Mohr',
label: 'Tonya Mohr',
slug: 'tonya-mohr',

View File

@ -37,8 +37,10 @@
@click.capture.native="isOpen = true"
>
<template slot="option" slot-scope="{ option }">
<ds-flex v-if="option.firstType" class="search-option-heading">
<ds-text>{{ option.searchType }}</ds-text>
<ds-flex v-if="option.heading" class="search-option-heading">
<ds-flex-item class="search-option-heading">
<ds-text>{{ option.heading }}</ds-text>
</ds-flex-item>
</ds-flex>
<ds-flex v-if="option.searchType === 'Contributions'">
<ds-flex-item class="search-option-label">
@ -274,8 +276,8 @@ export default {
width: 100%;
}
.search-option-heading {
font-weight: bold;
margin-bottom: 1em;
font-weight: bold;
cursor: default;
}
}
</style>