|
| 1 | +<script lang="ts" setup> |
| 2 | +import { getCurrentInstance, ref } from 'vue' |
| 3 | +import { createRouter, createWebHistory } from 'vue-router' |
| 4 | +import DsfrToggleSwitch from '../../DsfrToggleSwitch/DsfrToggleSwitch.vue' |
| 5 | +import DsfrTiles from '../DsfrTiles.vue' |
| 6 | +import type { DsfrTileProps } from '../DsfrTiles.types' |
| 7 | +
|
| 8 | +const horizontal = ref(false) |
| 9 | +const tiles: DsfrTileProps[] = [ |
| 10 | + { |
| 11 | + title: 'Ma formidable tuile 1', |
| 12 | + imgSrc: 'https://loremflickr.com/80/80/cat?random=1', |
| 13 | + description: 'Une tuile absolument formidable', |
| 14 | + }, |
| 15 | + { |
| 16 | + title: 'Ma formidable tuile 2', |
| 17 | + imgSrc: 'https://loremflickr.com/80/80/cat?random=2', |
| 18 | + description: 'Une tuile absolument formidable', |
| 19 | + }, |
| 20 | + { |
| 21 | + title: 'Ma formidable tuile 3', |
| 22 | + imgSrc: 'https://loremflickr.com/80/80/cat?random=3', |
| 23 | + description: 'Une tuile absolument formidable', |
| 24 | + }, |
| 25 | + { |
| 26 | + title: 'Ma formidable tuile 4', |
| 27 | + imgSrc: 'https://loremflickr.com/80/80/cat?random=4', |
| 28 | + description: 'Une tuile absolument formidable', |
| 29 | + }, |
| 30 | +] |
| 31 | +const app = getCurrentInstance() |
| 32 | +app?.appContext.app.use( |
| 33 | + createRouter({ |
| 34 | + history: createWebHistory(), |
| 35 | + routes: [ |
| 36 | + { path: '', component: { template: '<div>Accueil</div>' } }, |
| 37 | + { path: '/dummy-path', component: { template: '<div>DummyPath</div>' } }, |
| 38 | + ], |
| 39 | + }), |
| 40 | +) |
| 41 | +</script> |
| 42 | + |
| 43 | +<template> |
| 44 | + <div class="fr-container fr-my-2v"> |
| 45 | + <div class="fr-my-4v"> |
| 46 | + <DsfrToggleSwitch |
| 47 | + v-model="horizontal" |
| 48 | + label="Tuiles à l’horizontal" |
| 49 | + /> |
| 50 | + </div> |
| 51 | + <DsfrTiles |
| 52 | + :tiles |
| 53 | + :horizontal |
| 54 | + /> |
| 55 | + </div> |
| 56 | +</template> |
0 commit comments