I have order_detail
objects that look like this:
place
They are retrieved from the backend and assigned to a "london" : {
capital: true,
images: ["pic1.jpg","pic2.jpg"],
...
}
object in place
.
The issue/question I have is how to handle the delay in retrieving the data from the backend when rendering the view.
My template might have something like this:
data
but this causes errors/warnings in the console because there is no such thing as the images array until the data has been fetched.
I can think of two ways to handle this.
<p>{{place.images[0]}}</p>
and a v-if
variable to conditionally render the template part.Is there a "vuejs" approach to this that I've not considered?
答案 0 :(得分:-1)
I think you are looking for The DateTime.TryParseExact
directive
This directive will remain on the element until the associated Vue instance finishes compilation.
You have to use like
v-cloak
Read about v-cloak in docs, and more discussion