Vue Content Loading (Vue 2-era)

1.6.0 · abandoned · verified Tue Apr 21

Vue Content Loading (version 1.6.0) is a component library designed for Vue 2 applications to create customizable SVG loading card placeholders, similar in style to Facebook's content loading animations. It allows developers to either use predefined presets or construct custom loading patterns using SVG elements. This package was last published in March 2019, indicating it is no longer actively maintained and is considered abandoned for modern Vue development. For Vue 3 compatibility and ongoing updates, developers should use the similarly named but distinct package `vue-content-loader` (without the hyphen), which is a separate, actively maintained project. This package primarily targets the Vue 2 ecosystem and does not officially support Vue 3, making it unsuitable for new projects built with Vue 3.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates global registration of the main `VueContentLoading` component for custom patterns, and local import of a specific preset like `VclFacebook` in a Vue 2 Single File Component.

<!-- main.ts or main.js for global registration -->
import Vue from 'vue';
import App from './App.vue';
import VueContentLoading from 'vue-content-loading';

Vue.component('VueContentLoading', VueContentLoading);

new Vue({
  render: h => h(App)
}).$mount('#app');

// MyComponent.vue
<template>
  <div class="card-container">
    <h3>User Profile</h3>
    <VueContentLoading :width="400" :height="120">
      <circle cx="30" cy="30" r="30" />
      <rect x="75" y="13" rx="4" ry="4" width="250" height="15" />
      <rect x="75" y="37" rx="4" ry="4" width="150" height="10" />
    </VueContentLoading>

    <h3>Recent Posts</h3>
    <VclFacebook class="facebook-loader" />
  </div>
</template>

<script lang="ts">
import Vue from 'vue';
import { VclFacebook } from 'vue-content-loading';

export default Vue.extend({
  name: 'UserProfileLoader',
  components: {
    VclFacebook, // Only need to import named presets if not globally registered
  },
});
</script>

<style>
.card-container {
  border: 1px solid #eee;
  padding: 20px;
  border-radius: 8px;
  max-width: 450px;
  margin: 20px auto;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.facebook-loader {
  margin-top: 20px;
}
</style>

view raw JSON →