当前位置: 首页 > news >正文

SCSS上传图片占位区域样式

_App.scss


// 上传图片占位区域样式----------------------------------------
[theme="uploadImage"] {transition: 0.2s;position: relative;cursor: pointer;border-radius: 4px;/*居中填满*/background-repeat: no-repeat;background-position: center;background-size: cover;&::before {content: "按要求上传图片";transition: 0.2s;position: absolute;width: 100%;height: 100%;left: 0;top: 0;box-sizing: border-box;border: 1px dashed transparent;border-radius: 4px;background-color: #fafafa;color: #c6d1de;font-size: 20px;display: flex;justify-content: center;align-items: center;line-height: normal;animation: sg-animate-px 1s linear forwards;@keyframes sg-animate-px {0% {opacity: 0;}100% {opacity: 1;}}}&[style*="background"] {&::before {content: none!important;}}&:hover {&[style*="background"] {transform: scale(1.01);}&::before {color: #409eff;border-color: currentColor;background-color: #409eff11;}}&:active {&[style*="background"],&::before {transform: scale(0.99);}}
}

demo

<template><div :class="$options.name"><divclass="uploadImage"theme="uploadImage":style="imgFile ? { backgroundImage: `url('${imgFile}')` } : ``"@click="imgFile = `http://www.baidu.com/img/flexible/logo/pc/result@2.png`"/></div>
</template>
<script>
export default {name: `demo-uploadImage`,data() {return {imgFile: ``,};},
};
</script>
<style lang="scss" scoped>
.demo-uploadImage {.uploadImage {$width: 400;$height: 130;width: #{$width}px;height: #{$height}px;&::before {content: "#{$width} × #{$height}像素";}}
}
</style>

http://www.dtcms.com/a/350677.html

相关文章:

  • 基于多通道同步分析的智能听诊系统应用程序
  • 动态住宅代理:跨境电商数据抓取的稳定解决方案
  • vue-admin-template vue-cli 4升5(vue2版)
  • C语言中哪些常见的坑
  • Linux的奇妙冒险———进程信号
  • 滲透測試工具
  • Microsoft 365 中的 Rules-Based Classification 功能深度解析:企业数据治理与合规的智能基石
  • 25年8月通信基础知识补充2:星座的峭度(Kurtosis)、ISAC
  • 朴素贝叶斯分类器
  • A股市场高级日历效应详解与实战指南
  • 【P2P】P2P主要技术及RELAY服务1:python实现
  • 【Git】fatal: Unable to create ‘.git/index.lock’: File exists.
  • 迁移面试题
  • 亚远景- 从算法到刹车片:ISO/PAS 8800如何量化自动驾驶的“安全冗余”?
  • Life:Internship in OnSea Day 64
  • PyTorch损失函数全解析与实战指南
  • 高性能C++实践:原子操作与无锁队列实现
  • C++ #pragma
  • C++初阶(3)C++入门基础2
  • 现代C++工具链实战:CMake + Conan + vcpkg依赖管理
  • MYSQL的bin log是什么
  • JUC并发编程08 - 同步模式/异步模式
  • ROS2 python功能包launch,config文件编译后找不到
  • 链表OJ习题(2)
  • 搭建基于LangChain实现复杂RAG聊天机器人
  • AI在软件研发流程中的提效案例
  • 在vue3后台项目中使用热力图,并给热力图增加点击选中事件
  • Java中删除字符串首字符
  • 【51单片机】【protues仿真】基于51单片机数码管温度报警器系统
  • AR眼镜赋能水利智能巡检的创新实践