项目作者: michalsnik

项目描述 :
Composable components for rendering fake (progressive) content like facebook in vue
高级语言: JavaScript
项目地址: git://github.com/michalsnik/vue-content-placeholders.git
创建时间: 2017-10-09T19:13:54Z
项目社区:https://github.com/michalsnik/vue-content-placeholders

开源协议:MIT License

下载


vue-content-placeholders

npm
vue2

Vue addon for rendering fake content while data is fetching to provide better UX and lower bounce rate.

example


:cd: Installation

  • via npm: npm install vue-content-placeholders --save
  • via yarn: yarn add vue-content-placeholders

:rocket: Usage

Include plugin in your main.js file.

  1. import Vue from 'vue'
  2. import VueContentPlaceholders from 'vue-content-placeholders'
  3. Vue.use(VueContentPlaceholders)

⚠️ A css file is included when importing the package. You may have to setup your bundler to embed the css in your page.

Examples:

  1. <content-placeholders>
  2. <content-placeholders-heading :img="true" ></content-placeholders-heading>
  3. <content-placeholders-text :lines="3" ></content-placeholders-text>
  4. </content-placeholders>

rendered example

  1. <content-placeholders :rounded="true">
  2. <content-placeholders-img ></content-placeholders-img>
  3. <content-placeholders-heading ></content-placeholders-heading>
  4. </content-placeholders>

rendered example

Available components and properties

  • root <content-placeholders>
    • Boolean animated (default: true)
    • Boolean rounded (default: false) - border radius
    • Boolean centered (default: false)

      these properties define how all children components will act

  • <content-placeholders-heading ></content-placeholders-heading>
    • Boolean img (default: false)
  • <content-placeholders-text ></content-placeholders-text>
    • Number lines (default: 4)
  • <content-placeholders-img ></content-placeholders-img>

🔓 License

See the LICENSE file for license rights and limitations (MIT).