77 :class =" [trigger.type]"
88 :loading =" loadings[index].value"
99 v-bind =" { [trigger.size]: true }"
10- @click =" onClick(trigger.method, trigger.url , index)"
10+ @click =" onClick(trigger.method, parsedUrls[index] , index)"
1111 >
1212 {{ trigger.label }}
1313 </v-button >
1414 </div >
1515</template >
1616
1717<script lang="ts">
18- import { defineComponent , PropType , ref } from ' vue' ;
18+ import { computed , defineComponent , inject , PropType , ref } from ' vue' ;
1919import { useApi , useStores } from ' @directus/extensions-sdk' ;
20+ import { render } from ' micromustache' ;
2021
2122type Trigger = {
2223 label: string ;
@@ -43,9 +44,12 @@ export default defineComponent({
4344 const { useNotificationsStore } = useStores ();
4445 const store = useNotificationsStore ();
4546
47+ const values = inject (' values' , ref <Record <string , any >>({}));
48+ const parsedUrls = computed (() => props .triggers .map ((trigger ) => render (trigger .url ?? ' ' , values .value )));
49+
4650 const loadings = props .triggers .map (() => ref (false ));
4751
48- return { loadings , onClick };
52+ return { loadings , parsedUrls , onClick };
4953
5054 async function onClick(method : string , url : string , index : number ) {
5155 const loading = loadings [index ];
0 commit comments