File tree Expand file tree Collapse file tree 2 files changed +40
-7
lines changed
Expand file tree Collapse file tree 2 files changed +40
-7
lines changed Original file line number Diff line number Diff line change 1+ <template >
2+ <div >
3+ <div v-if =' loading' >Loading...</div >
4+ <div v-else-if =' error' >Error: {{ error.message }}</div >
5+ <div v-else-if =' result && result.languages' >
6+ {{ result.languages }}
7+ </div >
8+ </div >
9+ </template >
10+
11+ <script lang='ts'>
12+ import { defineComponent } from ' vue' ;
13+ import { useQuery } from ' @vue/apollo-composable' ;
14+ import gql from ' graphql-tag' ;
15+
16+ export default defineComponent ({
17+ name: ' Languages' ,
18+ setup() {
19+ const { result, loading, error } = useQuery (gql `
20+ query GetLanguages {
21+ languages(order_by: {sort: asc, name: asc}) {
22+ name
23+ label
24+ }
25+ }
26+ ` );
27+ return { /* your other items, */ result , loading , error };
28+ }
29+ });
30+ </script >
Original file line number Diff line number Diff line change 11<template >
2- <q-page class =" row items-center justify-evenly" >
2+ <q-page class =' row items-center justify-evenly' >
33 <example-component
4- title =" Example component"
4+ :meta =' meta'
5+ :todos =' todos'
56 active
6- :todos =" todos"
7- :meta =" meta"
7+ title =' Example component'
88 ></example-component >
9+ <hr />
10+ <Languages />
911 </q-page >
1012</template >
1113
12- <script lang="ts" >
13- import { Todo , Meta } from ' components/models' ;
14+ <script lang='ts' >
15+ import { Meta , Todo } from ' components/models' ;
1416import ExampleComponent from ' components/CompositionComponent.vue' ;
17+ import Languages from ' components/Languages.vue' ;
1518import { defineComponent , ref } from ' vue' ;
1619
1720export default defineComponent ({
1821 name: ' PageIndex' ,
19- components: { ExampleComponent },
22+ components: { ExampleComponent , Languages },
2023 setup() {
2124 const todos = ref <Todo []>([
2225 {
You can’t perform that action at this time.
0 commit comments