当前位置:网站首页>Live broadcast management project
Live broadcast management project
2022-07-01 09:42:00 【Colorful ice cream and lotus root soup】


1. Live broadcast cover changes ,input type= file A way to make a decision with an immutable style : Set it to the same size as the custom button 、 transparent ,z-index On top of the custom button
2. Replication of links between live broadcasts
<p class="live-link">
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" : Content to be copied
v-clipboard:success="onCopy" : Copy successful callback
v-clipboard:error="onError" : Callback for copy failure
-->3. Text count , independent div block , The absolute positioning is placed in input in . The counting method of characters is to count one character in Chinese , Two English words count as one word .
let s=" chinese zh english eng"
let reg=/[\u4e00-\u9fa5]/g // Match the full text in Chinese
let zhLen=s.match(reg).length //4
let len=Math.ceil((s.length+zhLen)/2)4. The display of streaming address and the default check-in agreement of non first live broadcast
With the help of localStorage For storage . Check default long-term storage in the agreement .
The streaming address is not displayed init The return value of the network request , So also store it in localStorage, One is to avoid losing refresh , The second is to reduce network requests .

5. Selection of window goods , Employ message transmission between father and son . Father's son :props; Son father : Custom event parameters .
The parent component passes the selected commodities and all commodities to the child component , In the window item pop-up window, the selected item is checked by default . There's a pit here , That is, the commodity object transferred from the parent component cannot be directly checked , Instead, you need to filter all the selected products , To check this box . Because the corresponding commodities of the selected commodity object array and all commodity object arrays passed by the parent component cannot be found directly , So we need to look again . And the checked data may change , The data from the parent element is immutable , Therefore, it is necessary to maintain an array of selected products .
mounted(){
this.hasSelected.forEach(item=>{ //hasSelected: The selected goods from my father
let goodsIndex=this.shopGoods.findIndex(it=>{ //hasSelected: All the goods from my father
return it.goodsId===item.goodsId
})
this.selectedGoods.push(this.shopGoods[goodsIndex]) // Maintain a selected product independently , because props The data transmitted cannot be changed
})
this.toggleSelection(this.selectedGoods) // Trigger tick
},difficulty :
1. The mask layer in the subcomponent cannot cover the entire window
reason : Even if the sub component is set position:fixed, It can only override the parent component that calls it , Because it is attached to it . Originally, the mask layer was separated from the content display box , The mask layer is on the parent component , The parent component is global app call , The latter does not conform to the concept of component disassembly , Therefore, the above problems are found .
resolvent : Add the following code to the sub component , Mount the component to body On the body
mounted() {
this.$nextTick(() => {
const body = document.querySelector("body");
if (body.append) {
body.append(this.$el);
} else {
body.appendChild(this.$el);
}
});
},
stay vue3 Can be used in teleport, Portal
<teleport to='body'>
<modal/>
</teleport>边栏推荐
- Solution of EPS image blur by latex insertion
- Youqitong PE toolbox [vip] v3.7.2022.0106 official January 22 Edition
- dsPIC30F6014a LCD 方块显示
- node. How to implement the SQL statement after JS connects to the database?
- 硬件中台项目
- 微信小程序 webview 禁止页面滚动,同时又不影响业务内overflow的滚动的实现方式
- MapReduce programming basics
- 炒币,亏了1000万。
- js this丢失问题分析 及 解决方案
- What is P in cap theory
猜你喜欢

PR training notes

Tearful eyes, it's not easy to change jobs. Three rounds of interviews, four hours of soul torture

架构实战营 模块九:设计电商秒杀系统

scratch大鱼吃小鱼 电子学会图形化编程scratch等级考试二级真题和答案解析2022年6月

苹果放大招!这件事干的太漂亮了……

我喜欢两个男人。。。

Strange, why is the ArrayList initialization capacity size 10?

dsPIC30F6014a LCD 方块显示

Hololens2 development -6-eyetracking and speech recognition

Learning practice: comprehensive application of cycle and branch structure (II)
随机推荐
Some tools used in embedded development
Tree structure -- binary tree 2 non recursive traversal
HMS core audio editing service 3D audio technology helps create an immersive auditory feast
JS prototype inheritance can only inherit instances, not constructors
吃一个女富豪的瓜。。。
Dspic30f6014a LCD block display
Upload labs for file upload - white box audit
JS原型链
Project procurement management
ESP8266 FreeRTOS开发环境搭建
历史上的今天:九十年代末的半导体大战;冯·诺依曼发表第一份草案;CBS 收购 CNET...
我喜欢两个男人。。。
好高的佣金,《新程序员》合伙人计划来袭,人人皆可参与!
js函数arguments对象
[unity shader] substitution of bool type in the property definition
122. Thread class thread method summary; Why is the thread start method start () not run ()?
js变量提升(hoisting)
Swift control encapsulation - paging controller
Using closures to implement private variables
A 419 error occurred in the laravel postman submission form. July 6th, 2020 diary.