vue分页获取数据插件_Vue插件,用于在获取数据时呈现假内容,以提供更好的UX

该博客介绍了Vue的一个插件,用于在数据获取期间展示假内容,以改善用户体验并降低跳出率。插件可通过npm或yarn安装,并提供了多种组件和属性来定制内容占位符的样式和行为。
摘要由CSDN通过智能技术生成

vue分页获取数据插件

Vue内容占位符 (vue-content-placeholders)

Composable components for rendering fake (progressive) content like facebook in vue

可渲染虚假(渐进)内容的可组合组件,例如Vue中的Facebook

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

Vue插件可在获取数据时呈现假内容,以提供更好的用户体验和更低的跳出率。

安装 (Installation)

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

    通过npm: npm install vue-content-placeholders --save

  • via yarn: yarn add vue-content-placeholders

    通过纱线: yarn add vue-content-placeholders

用法 (Usage)

Include plugin in your main.js file.

main.js文件中包含插件。

import Vue from 'vue'
import VueContentPlaceholders from 'vue-content-placeholders'

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.

import️导入软件包时包含一个css文件。 您可能需要设置捆绑程序才能将CSS嵌入到页面中。

例子: (Examples:)

<content-placeholders>
  <content-placeholders-heading :img="true" />
  <content-placeholders-text :lines="3" />
</content-placeholders>

rendered example

<content-placeholders :rounded="true">
  <content-placeholders-img />
  <content-placeholders-heading />
</content-placeholders>

rendered example

可用的组件和属性 (Available components and properties)

  • root <content-placeholders>

    <content-placeholders>

    • animated (default: true)animated (默认值:true)
    • rounded (default: false) - border radiusrounded (默认值:false)-边框半径
    • centered (default: false)centered (默认值:false)

    these properties define how all children components will act

    这些属性定义了所有子组件的行为方式

  • <content-placeholders-heading />

    <content-placeholders-heading />

    • img (default: false)img (默认值:false)
  • <content-placeholders-text />

    <content-placeholders-text />

    • lines (default: 4)lines (默认值:4)
  • <content-placeholders-img />

    <content-placeholders-img />

翻译自: https://vuejsexamples.com/vue-addon-for-rendering-fake-content-while-data-is-fetching-to-provide-better-ux/

vue分页获取数据插件

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值