There's a sub-component that I'm using for a page:
<template>
<div class="ll-page-wrapper">
<div class="ll-page-div">
<Page :total="data_count" :current="cur_page" @on-change="changePage"></Page>
</div>
</div>
</template>
<script>
export default {
props: {
data_count: {
type: Number,
required: true
}
}
}
</script>
Within the parent component, I'm using it like this:
<ll-page :data_count="os_type_data.count"
@change_page_for_parent="os_type_change_page"></ll-page>
Sometimes the os_type_data.count
ends up being undefined
since it hasn't been fetched yet.
To prevent this issue without altering the parent component code and impacting the user experience, I'm looking to resolve it within the sub-component. Can anyone suggest a solution?