码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • vue设置页面背景及背景图片


    本地静态图片 

    1. <template>
    2.     <view class="max">
    3.         <image src="../../static/bg.png" mode="">image>
    4.     view>
    5. template>
    6. <script>
    7.     export default {
    8.         data() {
    9.             return {
    10.                 
    11.             }
    12.         },
    13.         methods: {
    14.             
    15.         }
    16.     }
    17. script>
    18. <style lang="scss" scoped>
    19.     .max{
    20.         image{
    21.              z-index:-1; 
    22.              width:100%; 
    23.              height:100%; 
    24.              position: fixed; 
    25.              top:0; 
    26.         }
    27.     }
    28. style>

    cdn图片

    1. <template>
    2.     <view class="">
    3.      <view class="max">
    4. <image
    5. src="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-59f27697-00c5-4f1e-8c67-bb56e1e19e78/653c2495-cb7b-49a7-b6cb-f048e16fa5a7.jpg"
    6. mode=""
    7. >image>
    8. view>
    9.     view>
    10. template>
    11. <script>
    12.     export default {
    13.         data() {
    14.             return {
    15.                 
    16.             }
    17.         },
    18.         methods: {
    19.             
    20.         }
    21.     }
    22. script>
    23. <style lang="scss" scoped>
    24.     .max{
    25.         image{
    26.              z-index:-1; 
    27.              width:100%; 
    28.              height:100%; 
    29.              position: fixed; 
    30.              top:0; 
    31.         }
    32.     }
    33. style>

    设置背景色

    1. <template>
    2. <view class="container"> //最外层
    3. <view class="bg-colore">view> //此标签为最外层view标签的第一个子标签
    4. <view class="content">view>
    5. view>
    6. template>
    7. <script>
    8. script>
    9. style>
    10. .bg-colore{
    11. position: fixed;
    12. width: 100%;
    13. height: 100%;
    14. top: 0;
    15. left: 0;
    16. background-color: #f4f4f4;
    17. z-index: -1;
    18. }
    19. <style>

    实战-PC web登录页

    实战-小程序登录页

    1. <template>
    2. <view class="container">
    3. <image class="bg-img" :src="imgSrc">image>
    4. <view class="content">view>
    5. view>
    6. template>
    7. <script>
    8. export default {
    9. name: "index",
    10. data() {
    11. return {
    12. imgSrc: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-59f27697-00c5-4f1e-8c67-bb56e1e19e78/653c2495-cb7b-49a7-b6cb-f048e16fa5a7.jpg',
    13. }
    14. }
    15. }
    16. script>
    17. <style>
    18. .bg-img {
    19. position: fixed;
    20. width: 100%;
    21. height: 100%;
    22. top: 0;
    23. left: 0;
    24. z-index: -1;
    25. }
    26. style>

  • 相关阅读:
    基础组件-流量回放平台设计
    h5修改钉钉双标题栏问题
    客户端性能优化实践
    Pytorch训练神经网络完整步骤:搭建一个完整的神经网络(以用于Mnist手写数字识别的卷积神经网络为例)
    ⛳ MyBatis 中 Mapper 接口工作原理实例解析
    Shiro学习之SpringBoot整合
    通过java代码在指定目录生成一个指定内容的vue文件
    Teambition企业内部应用开发指南
    openGauss学习笔记-82 openGauss 数据库管理-内存优化表MOT管理-内存表特性-MOT使用准备前提条件
    uniapp 微信小程序 canvas 问题
  • 原文地址:https://blog.csdn.net/u013302168/article/details/128106718
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号