Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
Cannot display value when using v-for
-
I have this array of objects but it seems I cannot display the value using the v-for on div. . Below is my code and the image for the value of the object.
<div class="center" v-for="note in notes"> <span>{{ note['doc']._attachment['file'].digest }} File here</span> </div>
-
@jayGorio Are those notes obtained asynchronously? If yes, make sure you are not breaking Vue’s reactivity system when writing the objects.
Also, wrap you scrollable content in<v-ons-page
> with<div class="content">...</div>
. Have a look at the DOM and see if the structure makes sense.
-
No they are obtained using promises.
<template> <v-ons-page> <div class="content"> <div class="center" v-for="note in notes"> appear here <span>{{ note['doc']._attachment['file'].digest }} File here</span> </div> </div> <v-ons-fab tappable position="bottom right" :style="{ backgroundColor: $ons.platform.isIOS() }" :visible="fabVisible" @click="dialogVisible = true" > <v-ons-icon icon="md-plus"></v-ons-icon> </v-ons-fab> </v-ons-page> </template>
-
@Fran-Diox oops sorry the attachment has no s should be _attachments it’s working now thanks. It worked when I wrapped with div class=“content” .