Please Disable Your Browser Adblock Extension for our site and Refresh This Page!

our ads are user friendly, we do not serve popup ads. We serve responsible ads!

Refresh Page
Skip to main content
On . By CodimTh

Suspense is a new feature that renders a default/fallback component until the main component fetches the data.

Sometimes we use async operations to fetch data from the server. Instead of handing the template with v-if and then setting it back when we return the data, Suspense does it for us.

Suspense can be used for both parts of the template, or the whole template:

    <template #default>
      <div v-for="item in articleList" :key="">
          <h2>{{ item.title }}</h2>
          <p>{{ item.body }}</p>
    <template #fallback>
      Articles loading...
import axios from 'axios'
export default {
  async setup() {
    let articleList = await axios
      .then(response => {
    return {


Add new comment

Restricted HTML


Page Facebook

Become a patron

If you need some help or you search a Drupal freelancer don't hesitate to contact us.


Contact Us

All the content is FREE but I still need your help


Become a patreon