1 min read

QueryPreviewList

QueryPreviewList

Renders the results previews of a list of queries, and exposes the QueryPreview slots to modify the content. The requests are made in sequential order.

Props

Name Description Type Default
animation Animation component that will be used to animate the elements. union 'ul'
queries List of queries to preview. Array

Slots

Name Description Bindings
(name - type - description)
slotName

See it in action

Here you have a basic example of how the QueryPreviewList is rendered. Keep in mind that this component is intended to be used overriding its default slot. By default it will only render the names of the results.

Play with the default slot

In this example, the results will be rendered inside a sliding panel.

Play with the result slot

The component exposes a slot to override the result content, without modifying the list.

In this example, the ID of the results will be rendered along with the name.

<template>
  <QueryPreviewList class="x-flex x-gap-8" :queries="queries" #result="{ result }">
    <span class="x-font-bold">{{ result.id }}:</span>
    <span>{{ result.name }}</span>
  </QueryPreviewList>
</template>
<script>
  import { QueryPreviewList } from '@empathyco/x-components/queries-preview';
  export default {
    name: 'QueryPreviewListDemoOverridingResultSlot',
    components: {
      QueryPreviewList
    },
    data() {
      return {
        queries: ['sandals', 'tshirt', 'jacket']
      };
    }
  };
</script>