vue-baberragevue組件使用

更新时间:2023-06-16 23:45:03 阅读: 评论:0

vue-baberragevue組件使⽤
vue組件使⽤
<template>
<div class="barrages>
<vue-baberrage
:isShow="barrageIsShow"
:barrageList="barrageList"
:maxWordCount="maxWordCount"
:throttleGap="throttleGap"
:loop="barrageLoop"
:boxHeight="boxHeight"
:
messageHeight="messageHeight"
:lanesCount="lanesCount"
>
</vue-baberrage>
</div>
</template>
<script>
import Vue from "vue";
import { vueBaberrage, MESSAGE_TYPE } from "vue-baberrage";
Vue.u(vueBaberrage);
export default{
/
/ 弹幕重叠:⾼度调⼤数量调⼩
name:"Barrages",
data(){
return{
msg:"就是个辣鸡~就是个辣鸡~就是个辣鸡~",
barrageIsShow: true,
// 消息框全顯⽰的⾼度
messageHeight:30,
boxHeight:412,
barrageLoop: true,
maxWordCount:120,
throttleGap:5000,五行属水的汉字
barrageList:[],
lanesCount:4,
};
},
computed:{
// posRender(){
//  return 3
// }
},
mounted(){
this.addToList();
},
methods:{
addToList(){
let list =[
{
id:1,
avatar:
"/arch?q=%E5%9B%BE%E7%89%87&tbm=isch&source=iu&ictx=1&fir=2tLMTBYQMTAwvM%252C52L9RPt5gLBg7M%25 2C_&vet=1&usg=AI4_-kSRdi-c9NVz2JgdG-Hhq6c0eYOSNg&sa=X&ved=2ahUKEwjrhrz1097tAhXDgtgFHY_RBkEQ9QF6BAgGEAE#imgrc=2tLMTBYQMTA wvM",
msg: this.msg,
time: Math.random()*9+3,
barrageStyle:"red",
},
{
{
id:2,
avatar:
"/arch?q=%E5%9B%BE%E7%89%87&tbm=isch&source=iu&ictx=1&fir=2tLMTBYQMTAwvM%252C52L9RPt5gLBg7M%25 2C_&vet=1&usg=AI4_-kSRdi-c9NVz2JgdG-Hhq6c0eYOSNg&sa=X&ved=2ahUKEwjrhrz1097tAhXDgtgFHY_RBkEQ9QF6BAgGEAE#imgrc=2tLMTBYQMTA wvM",
msg: this.msg,
time: Math.random()*9+5,
barrageStyle:"green",
},
{
id:3,
avatar:
"/arch?q=%E5%9B%BE%E7%89%87&tbm=isch&source=iu&ictx=1&fir=2tLMTBYQMTAwvM%252C52L9RPt5gLBg7M%25 2C_&vet=1&usg=AI4_-kSRdi-c9NVz2JgdG-Hhq6c0eYOSNg&sa=X&ved=2ahUKEwjrhrz1097tAhXDgtgFHY_RBkEQ9QF6BAgGEAE#imgrc=2tLMTBYQMTA wvM",
msg: this.msg,
time: Math.random()*9+3,
barrageStyle:"normal",
},
送教上门工作实施方案
{
id:4,
avatar:
"/arch?q=%E5%9B%BE%E7%89%87&tbm=isch&source=iu&ictx=1&fir=2tLMTBYQMTAwvM%252C52L9RPt5gLBg7M%25 2C_&vet=1&usg=AI4_-kSRdi-c9NVz2JgdG-Hhq6c0eYOSNg&sa=X&ved=2ahUKEwjrhrz1097tAhXDgtgFHY_RBkEQ9QF6BAgGEAE#imgrc=2tLMTBYQMTA wvM",
msg: this.msg,
time: Math.random()*9+5,
barrageStyle:"blue",
},
{
id:5,
avatar:
"/arch?q=%E5%9B%BE%E7%89%87&tbm=isch&source=iu&ictx=1&fir=2tLMTBYQMTAwvM%252C52L9RPt5gLBg7M%25 2C_&vet=1&usg=AI4_-kSRdi-c9NVz2JgdG-Hhq6c0eYOSNg&sa=X&ved=2ahUKEwjrhrz1097tAhXDgtgFHY_RBkEQ9QF6BAgGEAE#imgrc=2tLMTBYQMTA wvM",
msg: this.msg,
time: Math.random()*9+3,
蛋糕的单词barrageStyle:"red",一路芬芳
},
{
id:6,
avatar:
"/arch?q=%E5%9B%BE%E7%89%87&tbm=isch&source=iu&ictx=1&fir=2tLMTBYQMTAwvM%252C52L9RPt5gLBg7M%25 2C_&vet=1&usg=AI4_-kSRdi-c9NVz2JgdG-Hhq6c0eYOSNg&sa=X&ved=2ahUKEwjrhrz1097tAhXDgtgFHY_RBkEQ9QF6BAgGEAE#imgrc=2tLMTBYQMTA wvM",
msg: this.msg,
time: Math.random()*9+5,
barrageStyle:"normal",
},
{
id:7,
avatar:
"/arch?q=%E5%9B%BE%E7%89%87&tbm=isch&source=iu&ictx=1&fir=2tLMTBYQMTAwvM%252C52L9RPt5gLBg7M%25 2C_&vet=1&usg=AI4_-kSRdi-c9NVz2JgdG-Hhq6c0eYOSNg&sa=X&ved=2ahUKEwjrhrz1097tAhXDgtgFHY_RBkEQ9QF6BAgGEAE#imgrc=2tLMTBYQMTA wvM",
msg: this.msg,
time: Math.random()*9+5,
barrageStyle:"red",
},
{
id:8,
avatar:
"/arch?q=%E5%9B%BE%E7%89%87&tbm=isch&source=iu&ictx=1&fir=2tLMTBYQMTAwvM%252C52L9RPt5gLBg7M%25 2C_&vet=1&usg=AI4_-kSRdi-c9NVz2JgdG-Hhq6c0eYOSNg&sa=X&ved=2ahUKEwjrhrz1097tAhXDgtgFHY_RBkEQ9QF6BAgGEAE#imgrc=2tLMTBYQMTA wvM",
msg: this.msg,
msg: this.msg,
time: Math.random()*9+5,
barrageStyle:"normal",
},
{
id:9,
avatar:
"/arch?q=%E5%9B%BE%E7%89%87&tbm=isch&source=iu&ictx=1&fir=2tLMTBYQMTAwvM%252C52L9RPt5gLBg7M%25 2C_&vet=1&usg=AI4_-kSRdi-c9NVz2JgdG-Hhq6c0eYOSNg&sa=X&ved=2ahUKEwjrhrz1097tAhXDgtgFHY_RBkEQ9QF6BAgGEAE#imgrc=2tLMTBYQMTA wvM",
msg: this.msg,
time: Math.random()*9+5,
barrageStyle:"red",
},
{
id:10,
avatar:
"/arch?q=%E5%9B%BE%E7%89%87&tbm=isch&source=iu&ictx=1&fir=2tLMTBYQMTAwvM%252C52L9RPt5gLBg7M%25 2C_&vet=1&usg=AI4_-kSRdi-c9NVz2JgdG-Hhq6c0eYOSNg&sa=X&ved=2ahUKEwjrhrz1097tAhXDgtgFHY_RBkEQ9QF6BAgGEAE#imgrc=2tLMTBYQMTA wvM",
msg: this.msg,
time: Math.random()*9+5,
barrageStyle:"yellow",
},
];
list.forEach((v)=>{
this.barrageList.push({
id: v.id,
avatar: v.avatar,
msg: v.msg,
time: v.time,
type: MESSAGE_TYPE.NORMAL,
barrageStyle: v.barrageStyle,
});
});
},
},
word组合};
再生制动
</script>
<style lang="scss">
.barrages-drop {
.blue {
border-radius:50px;
background: #e6ff75;
color: #fff;
}
.green {
border-radius:50px;
background: #75ff cd;
color: #fff;
}
.red {
border-radius:50px;
background: #e68fba;
color: #fff;
}
.yellow {
border-radius:50px;
background: #dfc795;
color: #fff;
手划船
助人为乐的近义词}
.baberrage-stage {
position: absolute;
width:100%;
height:512px;
overflow: hidden;
top:0;
margin-top:130px;
background: pink;
font-size:15px;
}
}
</style>
屬性
lanesCount
Default: 0
Acceptable-Values: Number
Function: 泳道的数量。

本文发布于:2023-06-16 23:45:03,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/82/971324.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:度调   数量   送教   蛋糕   工作   实施方案   单词   上门
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图