当前位置:网站首页>直播管理项目
直播管理项目
2022-07-01 09:37:00 【七彩冰淇淋与藕汤】


1.直播封面更改,input type= file样式不可变的决绝方法:将其设为与自定义按钮一样的大小、透明,z-index置于自定义按钮之上
2.直播间链接的复制
<p class="live-link">
直播间链接:{
{ liveRoomInfo.url }}
<img src="@/assets/images/ic_copy.png" alt="" class="live-image"
v-clipboard:copy="liveRoomInfo.url"
v-clipboard:success="onCopy"
v-clipboard:error="onError"
>
</p>
<!--
v-clipboard:copy="liveRoomInfo.url" :待拷贝内容
v-clipboard:success="onCopy" :拷贝成功的回调
v-clipboard:error="onError" :拷贝失败的回调
-->3.文字计数,独立的div块,绝对定位置于input里。文字的计数方式为中文算一个字,两个英文算一个字。
let s="中文zh英文eng"
let reg=/[\u4e00-\u9fa5]/g //匹配全文的中文
let zhLen=s.match(reg).length //4
let len=Math.ceil((s.length+zhLen)/2)4.推流地址的展示和非首次直播默认勾选协议
借助 localStorage进行存储。协议勾选默认长期存储。
推流地址的展示由于不在init网络请求的返回值里,因此也将其存储在localStorage,一是为了避免刷新丢失,二是减少网络请求。

5.橱窗商品的选择,录用父子间消息传递。父传子:props;子传父:自定义事件参数。
父组件将已经选择的商品和全部商品传给子组件,橱窗商品弹窗默认勾选已经选中商品。这里有个坑,即无法将父组件传过来的商品对象直接勾选,而是需要在所有的商品过滤除已选商品,才能实现在此框中的勾选。因为父组件传过来的已选商品对象数组和全部商品对象数组的相对应商品无法直接找到,所以需要重新找。而且勾选的数据可能会发生改变,而父元素传来的数据不可变,因此需要再维护一份选中商品数组。
mounted(){
this.hasSelected.forEach(item=>{ //hasSelected:父传来的已选商品
let goodsIndex=this.shopGoods.findIndex(it=>{ //hasSelected:父传来的全部商品
return it.goodsId===item.goodsId
})
this.selectedGoods.push(this.shopGoods[goodsIndex]) //独立维护一份已选商品,因为props传来的数据不可更改
})
this.toggleSelection(this.selectedGoods) //触发勾选
},难点:
1.子组件中的遮罩层不能覆盖整个窗口
原因:子组件即使设置了position:fixed,也只能覆盖调用它的父组件,因为它是挂载在其上。原本是将遮罩层与其中的内容显示框分离,遮罩层在父组件上,父组件又被全局app调用,后因不符合组件拆分理念,故发现上述问题。
解决方法:在子组件中添加如下代码,将组件挂载到body身上
mounted() {
this.$nextTick(() => {
const body = document.querySelector("body");
if (body.append) {
body.append(this.$el);
} else {
body.appendChild(this.$el);
}
});
},
在vue3中可以使用 teleport,传送门
<teleport to='body'>
<modal/>
</teleport>边栏推荐
- Log4j log framework
- [pytorch] 2.4 convolution function nn conv2d
- Mikrotik Routeros Internet access settings
- Differences between JS valueof and toString
- 树结构---二叉树2非递归遍历
- Precautions for lvgl v8.2 string display on keil MDK (take little bear pie as an example)
- JS prototype chain
- 年薪100万,在北上广深买的起房子吗?
- Click the screen with your finger to simulate F11 and enter the full screen
- PR training notes
猜你喜欢

Nacos service configuration and persistence configuration

睡了二哥。。。
![2.3 [kaggle dataset - dog feed example] data preprocessing, rewriting dataset, dataloader reading data](/img/6e/d8ef618127ac492f5142f7b600266d.png)
2.3 [kaggle dataset - dog feed example] data preprocessing, rewriting dataset, dataloader reading data

Import and export of power platform platform sharepointlist

Mise en œuvre simple de l'équilibrage de la charge par nacos

樹結構---二叉樹2非遞歸遍曆
![Problems caused by delete and delete[]](/img/d9/a1c3e5ce51ef1be366a973aa42d1f0.png)
Problems caused by delete and delete[]

计网01-物理层

LVGL V8.2字符串显示在Keil MDK上需要注意的事项(以小熊派为例)

HMS Core音频编辑服务3D音频技术,助力打造沉浸式听觉盛宴
随机推荐
2.3 【pytorch】数据预处理 torchvision.datasets.ImageFolder
Using closures to implement private variables
云原生到底是什么?它会是未来发展的趋势吗?
How to realize the usage of connecting multiple databases in idel
122. Thread class thread method summary; Why is the thread start method start () not run ()?
樹結構---二叉樹2非遞歸遍曆
ES6 const essence and completely immutable implementation (object.free)
Simple load balancing with Nacos
Class loading
node. How to implement the SQL statement after JS connects to the database?
我喜欢两个男人。。。
奇怪,为什么ArrayList初始化容量大小为10?
JS use toString to distinguish between object and array
主流实时流处理计算框架Flink初体验
HMS core audio editing service 3D audio technology helps create an immersive auditory feast
js this丢失问题分析 及 解决方案
Learning practice: comprehensive application of cycle and branch structure (II)
How to launch circle of friends marketing and wechat group activities
嵌入式开发用到的一些工具
2.2 【pytorch】torchvision.transforms