当前位置:网站首页>Simple and easy to modify spring frame components
Simple and easy to modify spring frame components
2022-07-07 10:44:00 【Weave_ network】
Use scenarios
Pop up components
Applicable framework vue, uniapp
Reuse uniapp Simple modification in the framework label And Unit of measure After usepx
Andrpx
<!-- vue -->
<template>
<div v-show="ishide" @touchmove.stop.prevent>
<!-- Mask -->
<div class="mask" :style="maskStyle"></div>
<!-- Content -->
<div class="tip" :style="tipStyle">
<slot></slot>
</div>
</div>
</template>
<!-- uniapp -->
<!-- <template> <view v-show="ishide" @touchmove.stop.prevent> <view class="mask" :style="maskStyle"></view> <view class="tip" :style="tipStyle"> <slot></slot> </view> </view> </template> -->
<script> export default {
props: {
// Control the pop-up window ishide: {
type: Boolean, required: true }, // Set popup level zindex: {
type: Number, default: 99 }, // Set mask transparency opacity: {
type: Number, default: 0.6 }, // Set the width of the content area width: {
type: String, default: '70%' }, // Set the height of the content area height: {
type: String, default: '300px' }, // Set the content area fillet radius: {
type: String, default: '10px' }, // Set the bottom color of the content area bgcolor: {
type: String, default: '#FFFFFF' } }, computed: {
// Mask style maskStyle() {
return ` z-index:${
this.zindex}; background:rgba(0,0,0,${
this.opacity}); ` }, // Content style tipStyle() {
return ` width:${
this.width}; height:${
this.height}; z-index:${
this.zindex+1}; border-radius:${
this.radius}; background-color:${
this.bgcolor}; ` } } } </script>
<style scoped> .mask {
position: fixed; bottom: 0; right: 0; left: 0; top: 0; } .tip {
position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); } </style>
Components use
<template>
<div>
<!-- Switch control -->
<button type="default" @click="isshow=!isshow"> Popup </button>
<!-- Use components -->
<zwy-popup :ishide='isshow' width="70%" height="700rpx" radius="40rpx">
<!-- Custom display content -->
<div class="content">
<div class="image"></div>
<div class="title"> Activity title </div>
<div> Content </div>
<div> Content </div>
<div class="info"> Content </div>
<div class="btn"> Button </div>
</div>
<!-- Custom close button -->
<div class="close" @click="isshow=false">*</div>
</zwy-popup>
</div>
</template>
<script> export default {
data() {
return {
isshow: false } } } </script>
<style scoped> .content {
width: 100%; height: 100%; display: flex; align-items: center; flex-direction: column; justify-content: center; background-color: coral; border-radius: 10px; } .image {
width: 80px; height: 80px; border-radius: 50%; background: #4CD964; } .title {
font-size: 18px; margin: 30px 0 20px 0; } .info {
margin: 20px 0; font-size: 12px; text-align: center; background: #F5F5F5; border-radius: 8px; padding: 8px 10px; } .btn {
width: 100px; height: 30px; font-size: 12px; line-height: 30px; text-align: center; border-radius: 16px; background: linear-gradient(-90deg, #FEEF43, #E9D81B); } .close {
width: 30px; height: 30px; color: #FFFFFF; line-height: 30px; text-align: center; border-radius: 50%; border: 1px solid #FFFFFF; position: relative; bottom: -10%; left: 50%; transform: translate(-50%, -50%); } </style>
边栏推荐
- How to prepare for the advanced soft test (network planning designer)?
- openinstall与虎扑达成合作,挖掘体育文化产业数据价值
- Some online academic report websites and machine learning videos
- The gun startles the dragon, and the crowd "locks" Zhou Zhi
- String formatting
- 施努卡:机器视觉定位技术 机器视觉定位原理
- P2788 math 1 - addition and subtraction
- About hzero resource error (groovy.lang.missingpropertyexception: no such property: weight for class)
- [homework] 2022.7.6 write your own cal function
- Five simple and practical daily development functions of chrome are explained in detail. Unlock quickly to improve your efficiency!
猜你喜欢
无法打开内核设备“\\.\VMCIDev\VMX”: 操作成功完成。是否在安装 VMware Workstation 后重新引导? 模块“DevicePowerOn”启动失败。 未能启动虚拟机。
路由器开发知识汇总
[recommendation system 01] rechub
对word2vec的一些浅层理解
leetcode-304:二维区域和检索 - 矩阵不可变
What are the contents of the intermediate soft test, the software designer test, and the test outline?
Summary of router development knowledge
[recommendation system 02] deepfm, youtubednn, DSSM, MMOE
BUUCTF---Reverse---reverse1
Mendeley -- a free document management tool that automatically inserts references into papers
随机推荐
P1223 排队接水/1319:【例6.1】排队接水
PHP \ newline cannot be output
Unable to open kernel device '\.\vmcidev\vmx': operation completed successfully. Reboot after installing vmware workstation? Module "devicepoweron" failed to start. Failed to start the virtual machine
Yarn的基础介绍以及job的提交流程
I plan to take part in security work. How about information security engineers and how to prepare for the soft exam?
基于HPC场景的集群任务调度系统LSF/SGE/Slurm/PBS
Mendeley -- a free document management tool that automatically inserts references into papers
CC2530 ZigBee iar8.10.1 environment construction
SQL Server 知识汇集9 : 修改数据
长列表性能优化方案 memo
JS实现链式调用
Schnuka: machine vision positioning technology machine vision positioning principle
【实战】霸榜各大医学分割挑战赛的Transformer架构--nnFormer
What are the contents of the intermediate soft test, the software designer test, and the test outline?
I'd rather say simple problems a hundred times than do complex problems once
使用 load_decathlon_datalist (MONAI)快速加载JSON数据
【推薦系統 01】Rechub
[dai6] mirror image of JZ27 binary tree
Multisim--软件相关使用技巧
Experience sharing of software designers preparing for exams