vue动态调节背景图片

2023-10-30

vue动态调节背景图片

在一些场景下我们需要使用户可以进行自定义背景图片,包括背景图片和其透明度(当然,还有许多也可以,这里就以这两个为例子,都差不多),这里我就为大家详细介绍如何动态设置背景图片(伪类绑定样式属性值)。

其中声音播放部分详情在 https://blog.csdn.net/qq_45803593/article/details/125653908

先上效果图
在这里插入图片描述

在这里插入图片描述

1、调节数据

首先我们先设置改变背景图片的组件,其实就是一个计数器和选择器(这里的透明度我们设置步长为 0.1,最小值为 0.5,最大值为1,精确 1 位小数)

        <div class="opacityChoice">
            <div>
                <span>聊天背景透明度</span>
            </div>
            <div>
                <el-input-number size="mini" v-model="theme.opacity" :min="0.5" :max="1" :precision="1" :step="0.1" label="透明度"></el-input-number>
            </div>
        </div>
        <div class="bgImgChoice">
            <div>
                <span>聊天背景选择</span>
            </div>
            <div>
                <el-select size="mini" v-model="theme.bgImg" placeholder="请选择背景图片" @change="seeBackGround()">
                    <el-option
                        v-for="item in bgImgs"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                    </el-option>
                </el-select>
            </div>
            <div>
                <el-image style="width: 120px; height: 80px" :src="bgImg"></el-image>
            </div>
        </div>
        <div class="updateThemeBtn">
            <el-button type="primary" @click="updateThemeInfo()">确认修改</el-button>
        </div>

data 部分

  data () {
    return {
      theme: {},
      ...
      bgImg: '', // 目前选择的图片
      ...
      bgImgs: [
        {
          value: 'http://localhost:8081/upload/chat/bg/1.jpg',
          label: '默认'
        },
        {
          value: 'http://localhost:8081/upload/chat/bg/2.jpg',
          label: '宇航员'
        },
        {
          value: 'http://localhost:8081/upload/chat/bg/3.jpg',
          label: '星空'
        },
        {
          value: 'http://localhost:8081/upload/chat/bg/4.jpg',
          label: '星云'
        },
        {
          value: 'http://localhost:8081/upload/chat/bg/5.jpg',
          label: '天空'
        },
        {
          value: 'http://localhost:8081/upload/chat/bg/6.jpg',
          label: '云雾'
        },
        {
          value: 'http://localhost:8081/upload/chat/bg/7.jpg',
          label: '夕阳'
        },
        {
          value: 'http://localhost:8081/upload/chat/bg/8.jpg',
          label: '月狼'
        }
      ]
    }
  },

在页面创建时,我们将数据进行初始化

  created () {
    this.hasSound = this.$store.state.user.userInfo.notifySound !== 'none'
    this.theme = this.$store.state.user.userInfo
    this.bgImg = this.$store.state.user.userInfo.bgImg
  },

在选中的背景图片发生变化时,我们替换相应的图片,并在点击提交时向数据库提交数据

  methods: {
    seeBackGround () {
      this.$nextTick(() => {
        this.bgImg = this.theme.bgImg
      })
    },
    updateThemeInfo () {
      if (!this.hasSound) {
        this.theme.notifySound = 'none'
      }
      userApi.updateThemeInfo(this.theme).then(res => {
        this.$message.success('修改主题信息成功n(*≧▽≦*)n')
        this.$store.dispatch('user/SET_USERINFO', res.data.userInfo)
      })
    }
  }

2、展示页面

      <el-container class="myImg" :style="{'--myImgPath': 'url(' + userInfo.bgImg + ')', '--myOpacity': userInfo.opacity}">
        <el-aside width="350px" style="height: inherit;border-right: 1px solid #c8c8c8;">
          <router-view></router-view>
        </el-aside>
        <el-container>
          <el-header>
            <div class="conversationName">
              <span style="font-size:24px">{{ currentConversation.name }}</span>
            </div>
          </el-header>
          <el-main>
            <my-main
              v-if="currentConversation.id"
              :currentConversation="currentConversation" />
            <div class="no-conversation hor-ver-center" v-else>
              <p class="text">聊天~打开心灵的窗户</p>
              <chat-svg width="800" height="648"/>
            </div>
          </el-main>
        </el-container>
      </el-container>

我们将其父元素背景设置为透明

.chat {
  height: inherit;
  background: transparent;
}

然后我们为其插入伪类样式,其中 var(--myImgPath)var(--myOpacity) 是用来动态传值的,在 vue 中我们可以使用 :style="{'--myImgPath': 'url(' + userInfo.bgImg + ')', '--myOpacity': userInfo.opacity}" 的形式来为其进行赋值,从而实现背景图片与背景透明度根据我们的调节来进行动态的显示

.myImg::before {
  background-image: var(--myImgPath);
  background-repeat:no-repeat;
  background-size: cover;
  background-attachment: fixed;
  content: '';
  opacity: var(--myOpacity);
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  z-index: -1;
}

3、组件代码

<template>
    <div class="theme" style="height:240px;overflow: auto;">
        <div class="audioSound">
                <div>
                    <span>新消息通知声音</span>
                </div>
                <div v-if="hasSound">
                    <audio :src="notifyAudio" ref="sound" muted></audio>
                    <el-select size="mini" v-model="theme.notifySound" placeholder="请选择提示音" @change="playSound()">
                        <el-option
                            v-for="item in sounds"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                        </el-option>
                    </el-select>
                </div>
                <el-switch
                    v-model="hasSound"
                    active-color="#13ce66"
                    inactive-color="#ff4949">
                </el-switch>
        </div>
        <div class="opacityChoice">
            <div>
                <span>聊天背景透明度</span>
            </div>
            <div>
                <el-input-number size="mini" v-model="theme.opacity" :min="0.5" :max="1" :precision="1" :step="0.1" label="透明度"></el-input-number>
            </div>
        </div>
        <div class="bgImgChoice">
            <div>
                <span>聊天背景选择</span>
            </div>
            <div>
                <el-select size="mini" v-model="theme.bgImg" placeholder="请选择背景图片" @change="seeBackGround()">
                    <el-option
                        v-for="item in bgImgs"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                    </el-option>
                </el-select>
            </div>
            <div>
                <el-image style="width: 120px; height: 80px" :src="bgImg"></el-image>
            </div>
        </div>
        <div class="updateThemeBtn">
            <el-button type="primary" @click="updateThemeInfo()">确认修改</el-button>
        </div>
    </div>
</template>
<script>
import userApi from '@/api/modules/user'
const notifySoundMap = {
  default: require('../../../static/audio/default.mp3'),
  apple: require('../../../static/audio/apple.mp3'),
  pcqq: require('../../../static/audio/pcqq.mp3'),
  momo: require('../../../static/audio/momo.mp3'),
  huaji: require('../../../static/audio/huaji.mp3'),
  mobileqq: require('../../../static/audio/mobileqq.mp3'),
  none: ''
}
export default {
  name: 'MessageNotification',
  data () {
    return {
      theme: {},
      hasSound: true,
      notifyAudio: '',
      BGIMG_URL: 'http://localhost:8081/upload/chat/bg/',
      bgImg: '',
      sounds: [
        {
          value: 'default',
          label: '默认'
        },
        {
          value: 'apple',
          label: '苹果'
        },
        {
          value: 'pcqq',
          label: '电脑端qq'
        },
        {
          value: 'momo',
          label: '陌陌'
        },
        {
          value: 'huaji',
          label: '滑稽'
        },
        {
          value: 'mobileqq',
          label: '手机qq'
        }
      ],
      bgImgs: [
        {
          value: 'http://localhost:8081/upload/chat/bg/1.jpg',
          label: '默认'
        },
        {
          value: 'http://localhost:8081/upload/chat/bg/2.jpg',
          label: '宇航员'
        },
        {
          value: 'http://localhost:8081/upload/chat/bg/3.jpg',
          label: '星空'
        },
        {
          value: 'http://localhost:8081/upload/chat/bg/4.jpg',
          label: '星云'
        },
        {
          value: 'http://localhost:8081/upload/chat/bg/5.jpg',
          label: '天空'
        },
        {
          value: 'http://localhost:8081/upload/chat/bg/6.jpg',
          label: '云雾'
        },
        {
          value: 'http://localhost:8081/upload/chat/bg/7.jpg',
          label: '夕阳'
        },
        {
          value: 'http://localhost:8081/upload/chat/bg/8.jpg',
          label: '月狼'
        }
      ]
    }
  },
  created () {
    this.hasSound = this.$store.state.user.userInfo.notifySound !== 'none'
    this.theme = this.$store.state.user.userInfo
    this.bgImg = this.$store.state.user.userInfo.bgImg
  },
  methods: {
    playSound () {
      this.notifyAudio = notifySoundMap[this.theme.notifySound]
      this.$nextTick(() => {
        this.$refs['sound'].play()
      })
    },
    seeBackGround () {
      this.$nextTick(() => {
        this.bgImg = this.theme.bgImg
      })
    },
    updateThemeInfo () {
      if (!this.hasSound) {
        this.theme.notifySound = 'none'
      }
      userApi.updateThemeInfo(this.theme).then(res => {
        this.$message.success('修改主题信息成功n(*≧▽≦*)n')
        this.$store.dispatch('user/SET_USERINFO', res.data.userInfo)
      })
    }
  }
}
</script>
<style>
.theme {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 0 25px;
}
.theme .audioSound {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    height: 60px;
}
.theme .opacityChoice {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    height: 60px;
}
.theme .bgImgChoice {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}
</style>

其相关的所有代码

<template>
    <div class="theme" style="height:240px;overflow: auto;">
        <div class="audioSound">
                <div>
                    <span>新消息通知声音</span>
                </div>
                <div v-if="hasSound">
                    <audio :src="notifyAudio" ref="sound" muted></audio>
                    <el-select size="mini" v-model="theme.notifySound" placeholder="请选择提示音" @change="playSound()">
                        <el-option
                            v-for="item in sounds"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                        </el-option>
                    </el-select>
                </div>
                <el-switch
                    v-model="hasSound"
                    active-color="#13ce66"
                    inactive-color="#ff4949">
                </el-switch>
        </div>
        <div class="opacityChoice">
            <div>
                <span>聊天背景透明度</span>
            </div>
            <div>
                <el-input-number size="mini" v-model="theme.opacity" :min="0.5" :max="1" :precision="1" :step="0.1" label="透明度"></el-input-number>
            </div>
        </div>
        <div class="bgImgChoice">
            <div>
                <span>聊天背景选择</span>
            </div>
            <div>
                <el-select size="mini" v-model="theme.bgImg" placeholder="请选择背景图片" @change="seeBackGround()">
                    <el-option
                        v-for="item in bgImgs"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                    </el-option>
                </el-select>
            </div>
            <div>
                <el-image style="width: 120px; height: 80px" :src="bgImg"></el-image>
            </div>
        </div>
        <div class="updateThemeBtn">
            <el-button type="primary" @click="updateThemeInfo()">确认修改</el-button>
        </div>
    </div>
</template>
<script>
import userApi from '@/api/modules/user'
const notifySoundMap = {
  default: require('../../../static/audio/default.mp3'),
  apple: require('../../../static/audio/apple.mp3'),
  pcqq: require('../../../static/audio/pcqq.mp3'),
  momo: require('../../../static/audio/momo.mp3'),
  huaji: require('../../../static/audio/huaji.mp3'),
  mobileqq: require('../../../static/audio/mobileqq.mp3'),
  none: ''
}
export default {
  name: 'MessageNotification',
  data () {
    return {
      theme: {},
      hasSound: true,
      notifyAudio: '',
      BGIMG_URL: 'http://localhost:8081/upload/chat/bg/',
      bgImg: '',
      sounds: [
        {
          value: 'default',
          label: '默认'
        },
        {
          value: 'apple',
          label: '苹果'
        },
        {
          value: 'pcqq',
          label: '电脑端qq'
        },
        {
          value: 'momo',
          label: '陌陌'
        },
        {
          value: 'huaji',
          label: '滑稽'
        },
        {
          value: 'mobileqq',
          label: '手机qq'
        }
      ],
      bgImgs: [
        {
          value: 'http://localhost:8081/upload/chat/bg/1.jpg',
          label: '默认'
        },
        {
          value: 'http://localhost:8081/upload/chat/bg/2.jpg',
          label: '宇航员'
        },
        {
          value: 'http://localhost:8081/upload/chat/bg/3.jpg',
          label: '星空'
        },
        {
          value: 'http://localhost:8081/upload/chat/bg/4.jpg',
          label: '星云'
        },
        {
          value: 'http://localhost:8081/upload/chat/bg/5.jpg',
          label: '天空'
        },
        {
          value: 'http://localhost:8081/upload/chat/bg/6.jpg',
          label: '云雾'
        },
        {
          value: 'http://localhost:8081/upload/chat/bg/7.jpg',
          label: '夕阳'
        },
        {
          value: 'http://localhost:8081/upload/chat/bg/8.jpg',
          label: '月狼'
        }
      ]
    }
  },
  created () {
    this.hasSound = this.$store.state.user.userInfo.notifySound !== 'none'
    this.theme = this.$store.state.user.userInfo
    this.bgImg = this.$store.state.user.userInfo.bgImg
  },
  methods: {
    playSound () {
      this.notifyAudio = notifySoundMap[this.theme.notifySound]
      this.$nextTick(() => {
        this.$refs['sound'].play()
      })
    },
    seeBackGround () {
      this.$nextTick(() => {
        this.bgImg = this.theme.bgImg
      })
    },
    updateThemeInfo () {
      if (!this.hasSound) {
        this.theme.notifySound = 'none'
      }
      userApi.updateThemeInfo(this.theme).then(res => {
        this.$message.success('修改主题信息成功n(*≧▽≦*)n')
        this.$store.dispatch('user/SET_USERINFO', res.data.userInfo)
      })
    }
  }
}
</script>
<style>
.theme {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 0 25px;
}
.theme .audioSound {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    height: 60px;
}
.theme .opacityChoice {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    height: 60px;
}
.theme .bgImgChoice {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}
</style>

<template>
  <div class="chat">
    <el-container style="height: inherit;">
      <audio :src="NotifyAudio" ref="audio" muted></audio>
      <el-aside width="60px" style="height: inherit;background-color:#2f2e2e">
        <my-menu />
      </el-aside>
      <el-container class="myImg" :style="{'--myImgPath': 'url(' + userInfo.bgImg + ')', '--myOpacity': userInfo.opacity}">
        <el-aside width="350px" style="height: inherit;border-right: 1px solid #c8c8c8;">
          <router-view></router-view>
        </el-aside>
        <el-container>
          <el-header>
            <div class="conversationName">
              <span style="font-size:24px">{{ currentConversation.name }}</span>
            </div>
          </el-header>
          <el-main>
            <my-main
              v-if="currentConversation.id"
              :currentConversation="currentConversation" />
            <div class="no-conversation hor-ver-center" v-else>
              <p class="text">聊天~打开心灵的窗户</p>
              <chat-svg width="800" height="648"/>
            </div>
          </el-main>
        </el-container>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import myMenu from '@/views/layout/MyMenu'
import myMain from '@/views/layout/myMain'
import chatSvg from '@/SVGComponents/chat'
import conversationApi from '@/api/modules/conversation'
const notifySoundMap = {
  default: require('../../static/audio/default.mp3'),
  apple: require('../../static/audio/apple.mp3'),
  pcqq: require('../../static/audio/pcqq.mp3'),
  momo: require('../../static/audio/momo.mp3'),
  huaji: require('../../static/audio/huaji.mp3'),
  mobileqq: require('../../static/audio/mobileqq.mp3'),
  none: ''
}
export default {
  name: 'Chat',
  components: { myMain, myMenu, chatSvg },
  data () {
    return {
      NotifyAudio: '', // 播放的声音
      notifySound: '' // 目前设置的声音
    }
  },
  created () {
    this.notifySound = this.userInfo.notifySound
    this.getMyConversationsList()
  },
  sockets: {
    // 客户端connect事件,服务端可针对connect进行信息传输
    connect: function () {
      this.$message.info('连接成功')
      console.log('socket connected:', this.$socket.id)
    },
    onlineUser (data) {
      // console.log('当前在线用户列表:', data)
      this.$store.dispatch('user/SET_ONLINE_USER', data)
    },
    receiveMessage (news) {
      this.$refs['audio'].play()
      // 不是现在所处的房间就新增未读消息
      if (news.roomId !== this.$store.state.conversation.currentConversation.roomId || JSON.stringify(this.$store.state.conversation.currentConversation) === '{}') {
        this.$store.dispatch('conversation/SET_UNREAD_NUM', {type: 'add', data: news})
      }
    },
    receiveValidateMessage (news) { // 同时向系统消息页面发送未读消息
      this.$refs['audio'].play()
    },
    receiveAgreeFriendValidate (data) {
      this.$refs['audio'].play()
    }
  },
  computed: {
    currentConversation () {
      return this.$store.state.conversation.currentConversation
    },
    userInfo () {
      return this.$store.state.user.userInfo
    }
  },
  watch: {
    userInfo: {
      handler (newVal, oldVal) {
        this.userGoOnline()
      },
      deep: true,
      immediate: true
    },
    notifySound: {
      handler (notifySound) {
        this.NotifyAudio = notifySoundMap[notifySound]
      },
      deep: true,
      immediate: true
    }
  },
  methods: {
    // 用户上线
    userGoOnline () {
      if (this.userInfo) { // 有用户信息时才发送给后端进行保存
        this.$socket.emit('goOnline', this.userInfo)
      }
    },
    // 将会话信息存入vuex
    getMyConversationsList () {
      conversationApi.getMyConversationsList(this.$store.state.user.userInfo.id).then(res => {
        this.$store.dispatch('conversation/SET_RECENT_CONVERSATION', {type: 'init', data: res.data.myConversationsList})
      })
    }
  }
}
</script>
<style>
.chat {
  height: inherit;
  background: transparent;
}
.myImg::before {
  background-image: var(--myImgPath);
  background-repeat:no-repeat;
  background-size: cover;
  background-attachment: fixed;
  content: '';
  opacity: var(--myOpacity);
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  z-index: -1;
}
.el-footer {
  background-color: #f7f7f7;
  color: #333;
  text-align: center;
  line-height: 60px;
}
.el-aside {
  color: #333;
  text-align: center;
}
.el-main {
  color: #333;
}
.conversationName {
  display: flex;
  height: inherit;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
}
.no-conversation {
  text-align: center;
}
.no-conversation .text {
  color: #909399;
  font-size: 20px;
}
.hor-ver-center {
  position: absolute;
  top: 60%;
  left: 60%;
  transform: translate(-50%, -60%);
}
</style>

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

vue动态调节背景图片 的相关文章

随机推荐

  • 跨时钟域信号处理(一)--Verilog单比特信号

    网上有很多的跨时钟域信号处理的相关文章 主要分为三种 单比特信号 打两拍或打更多拍 使用触发器 多比特信号 异步双口块RAM或者异步FIFO 格雷码转换 这次就主要说第1种情况 适用于单比特信号 1 应用场景 从时钟域1的单比特信号DATA
  • 【python】动态规划算法学习:0-1背包问题 -牛客网HJ16 购物单

    这里写目录标题 题目HJ16 购物单 问题理解 代码 题目HJ16 购物单 描述 王强决定把年终奖用于购物 他把想买的物品分为两类 主件与附件 附件是从属于某个主件的 下表就是一些主件与附件的例子 主件 附件 电脑 打印机 扫描仪 书柜 图
  • Git(三) Git 图形化管理工具 SourceTree 全部实用操作

    Git 三 Git 图形化管理工具 SourceTree 全部实用操作 上篇文章主要说到Git的账号情况 Getlab账号和Github账号同时使用 本篇文章接着上篇内容继续为大家介绍 Git的图形化管理工具 SourceTree 前言 一
  • 文件下载中文文件名不显示

    使用response setHeader Content Disposition attachment filename fName 下载文件 中文文件名无法显示的问题 今天遇到这么一个情况 在Controller代码中进行文件下载 其中f
  • js 多个if else如何优化?

    function getUserDescribe name if name length gt 3 console log 名字太长 else if name length lt 2 console log 名字太短 else if nam
  • 导入时报错 :No module named ‘tensorflow.contrib‘ 问题的解决

    No module named tensorflow contrib 问题解决 问题描述 在tensorflow contrib模块的调用报错 No module named tensorflow contrib 解决方案 我给删了大不了不
  • [CISCN2019 华北赛区 Day1 Web2]ikun (JWT更改与python反序列化)

    前言 文章所涉及的资料来自互联网整理和个人总结 意在于个人学习和经验汇总 如有什么地方侵权 请联系本人删除 谢谢 本文仅用于学习与交流 不得用于非法用途 题目 提示是要买到Iv6 有很多页面 需要写脚本来找 import requests
  • 基于时间轮片方式处理超时任务

    作者 酱了里个酱 来源 掘金 https juejin im post 5e733e4f51882549417fe9aa 背景 最近收到小伙伴的一个吐槽 项目里的某个函数是同步阻塞的 无法确定其运行时间 某些情况下 可能出现长时间阻塞导致应
  • 计算机视觉与深度学习-全连接神经网络-激活函数- [北邮鲁鹏]

    文章目录 基础知识 为什么需要非线性操作 激活函数 激活函数 vs 数据预处理 常用的激活函数 Sigmoid函数 Logistic函数 双曲正切函数 Tanh函数 线性整流函数 ReLU函数 Leaky ReLU函数 Softmax函数
  • BTC txid与vote的关系

    当我通过BTC的listtransactions接口获取查询最近发生的钱包交易时 需要将用户的充值记录写到数据库时 发现了一些令人巨大的误解 例如 txid字段并不是唯一的 所以写到数据库时 会有交易哈希重复的可能性 有可能你的两个用户在币
  • python处理xml文件

    1 python 操作xml的方式介绍 查看全部包含 三种 法 是xml dom 模块 它是W3CDOMAPI的实现 若需要处理DOMAPI则该模块很适合 是xml sax 模块 它是SAXAPI的实现 这个模块牺牲了便捷性来换取速度和内存
  • matlab中varargout简介

    varargout可以看做 Variable length output argument list 的缩写 在matlab中定义m函数时通过 varargout我们可以得到可变个数个返回值 在matlab命令窗口中输入doc vararg
  • 【H5】Cookie、Session、Token、JWT区别及使用方法

    Token 和 Session 的区别 Session 是一种记录服务器和客户端会话状态的机制 使服务端有状态化 可以记录会话信息 而 Token 是令牌 访问资源接口 API 时所需要的资源凭证 Token 使服务端无状态化 不会存储会话
  • Spring Boot 集成 Flowable 并自定义数据源

    永久链接 https blog kekwy com flowable datasource 问题描述 在使用 flowable spring boot starter 进行 spring boot 集成 flowable 时 flowabl
  • Python爬虫——urllib_post请求百度翻译

    post请求 post的请求参数 是不会拼接在url后面的 而是需要放在请求对象定制的参数中 post请求的参数需要进行两次编码 第一次urlencode 对字典参数进行Unicode编码转成字符串 第二次encode 将字符串数据转换为字
  • 插值法

    插值 根据已知数据点 条件 预测未知数据点的值的方法 1 多项式插值法 多项式插值法 多项式插值法 所求的插值函数是多项式 其中 就是所要求的参数 多项式插值基本公式 求系数 1 1 拉格朗日插值法 设函数 y f x 在区间 a b 上有
  • 希尔排序(重点讲解如何分组)---------通俗易懂,直击重点!!!

    文章目录 希尔排序的历史 一 关于希尔排序 二 希尔排序的思路 三 代码实例讲解 总结 希尔排序的历史 希尔排序按其设计者希尔 Donald Shell 的名字命名 该算法由希尔 1959 年公布 1 希尔排序是基于插入排序的以下两点性质而
  • 杜教筛BM(找规律)

    代码来自学长 include
  • Centos--解决Pycharm无法输入中文问题

    在 pytcharm bin pytharm sh 中添加如下代码 export GTK IM MODULE ibus export QT IM MODULE ibus export XMODIFIERS im ibus Run the I
  • vue动态调节背景图片

    vue动态调节背景图片 在一些场景下我们需要使用户可以进行自定义背景图片 包括背景图片和其透明度 当然 还有许多也可以 这里就以这两个为例子 都差不多 这里我就为大家详细介绍如何动态设置背景图片 伪类绑定样式属性值 其中声音播放部分详情在