nativescript-community / ui-pager

Pager / Carousel component that allows the user to swipe left and right through pages of data.
https://nativescript-community.github.io/ui-pager/
Apache License 2.0
19 stars 10 forks source link

Using Observable Array in Pager #21

Open liamcharmer opened 2 years ago

liamcharmer commented 2 years ago

NativeScript Vue

I have an Observable Array containing objects as each item.

I pass the Observable Array as a Prop into the component.

When I try to iterate through the Observable Array in the Pager, it does not work. I created an empty array in the data, and then push each observable array and it works. However ideally would like the Observable array being passed in from the prop to work.

<template>
 <Pager
      height="75%"
      width="100%"
      backgroundColor="yellow"
      :showIndicator="true"
      for="item in items"
    >
      <v-template>
        <Label :text="item" />
      </v-template>
      </template>
<script>
import { ObservableArray } from '@nativescript/core';
export default {
  props: {
    items: {
      type: ObservableArray,
      default: null,
      required: true,
    },
}
}
dangrima90 commented 1 year ago

@liamcharmer did you ever manage to get it to work?