vue 远程js 组件加载_vue.js的预加载程序组件

vue 远程js 组件加载

Vue用户界面预加载器 (Vue-ui-preloader)

Vue-Ui-Loader is a preloader component made with CSS transistions and animations.

Vue-Ui-Loader是由CSS横断面和动画组成的预加载器组件。

Playground Website. Adjust the settings using the playground options. On the bottom of the page you will find the source code that you can directly use in your project or you can manually change the props.

游乐场网站。 使用游乐场选项调整设置。 在页面底部,您将找到可以直接在项目中使用的源代码,也可以手动更改道具。

安装 (Installation)

# use yarn
yarn add vue-ui-preloader
# use npm
npm install --save vue-ui-preloader

用法 (Usage)

In your main.js

在你的main.js中

import loader from "vue-ui-preloader";

Vue.use(loader);

In your template

在您的模板中

<template>
  <loader object="#ff9633" color1="#ffffff" color2="#17fd3d" size="5" speed="2" bg="#343a40" objectbg="#999793" opacity="80" name="circular"></loader>
</template>

note(you can either use the playground website to automatically get all the props set or you can set them manaully using the below prop list. You can also resort to not passing any prop, in this case the preloader will use default settings.)

注意(您可以使用游乐场网站自动获取所有道具,也可以使用以下道具列表手动进行设置。您也可以不传递任何道具,在这种情况下,预载器将使用默认设置。)

通过CDN (Via CDN)

CDN demo link - http://jsfiddle.net/8961cm0s/1/

CDN演示链接-http://jsfiddle.net/8961cm0s/1/

In your index.html

在您的index.html中

<script src="https://unpkg.com/vue-ui-preloader"></script>
<link rel="stylesheet" type="text/css" href="https://unpkg.com/vue-ui-preloader/dist/loader.css">

In your template

在您的模板中

<div id="app">
  <loader object="#ff9633" color1="#ffffff" color2="#17fd3d" size="5" speed="2" bg="#343a40" objectbg="#999793" opacity="80" name="circular"></loader>
</div>

In your main.js

在你的main.js中

Vue.use(loader)

new Vue({
  el: '#app',
  components:{
  loader:loader
  }
});

道具 (Props)

NameTypeDefaultDescription
namestring'spinning'decides the type of loader
objectstring'#ff9633'set the color of the loaders. hex or color
color1stringonly for circularset the color of the circular loader disk1. hex or color
color2stringonly for circularset the color of the circular loader disk2. hex or color
sizenumber5set the size of loader
bgstring'#343a40'set the color of the loader background. hex or color
objectbgstring'#999793'set the color of the loader object background. hex or color
opacitynumber80set the opacity of background
speednumber2animation speed in seconds
名称 类型 默认 描述
名称 “旋转” 决定装载机的类型
目的 '#ff9633' 设置装载机的颜色。 十六进制或彩色
颜色1 仅用于循环 设置圆形加载器磁盘的颜色1。 十六进制或彩色
颜色2 仅用于循环 设置圆形加载器disk2的颜色。 十六进制或彩色
尺寸 5 设置装载机的尺寸
'#343a40' 设置加载程序背景的颜色。 十六进制或彩色
对象 '#999793' 设置加载程序对象背景的颜色。 十六进制或彩色
不透明 80 设置背景的不透明度
速度 2 动画速度(以秒为单位)

作者 (Author)

Vinayak sharma Hrishikesh Agarwal

Vinayak Sharma 赫里希克什·阿加瓦尔

翻译自: https://vuejsexamples.com/pre-loader-components-for-vue-js/

vue 远程js 组件加载

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值