nativescript-community / ui-collectionview

Allows you to easily add a collection view (grid list view) to your projects. Supports vertical and horizontal modes, templating, and more.
Apache License 2.0
59 stars 18 forks source link

Fix: Vue3 global properties not available in slot #71

Closed MrSnoozles closed 9 months ago

MrSnoozles commented 9 months ago

This PR makes global properties available in the slot. Global properties are not recommended to use, but are part of Vue3 to enable migration from Vue2 projects.

Current behaviour

The following code will throw an error, because $L is not defined on the context.

// app.ts

const app = createApp({});
app.config.globalProperties.$L = localize;
// MyList.vue

<CollectionView :items="items">
   <template #default="{ item }">
       <Label :text="$L('Hello world')" />
   </template>
</CollectionView>