app的动态导航栏及自定义图标的开发

news2024/11/16 12:33:01

效果展示

 

 

我的代码

<template>
  <div class="nav-container">
    <!--    动态底部导航栏 start-->
    <div class="nav-content">
      <van-tabbar style="background-image: linear-gradient(135deg, #EE9AE5 10%, #5961F9 100%) !important;"
                  v-model="active">
        <van-tabbar-item v-for="(icon,index) in icons.list"  :key="index" :to="icon.path">
          <span>{{ icon.name }}</span>
          <template #icon="props">
            <img :src="props.active ? icon.active : icon.inactive"/>
          </template>
        </van-tabbar-item>
      </van-tabbar>
    </div>
    <!--    动态底部导航栏 end-->
  </div>
</template>

<script setup>
import {reactive, ref} from "vue";
const active = ref(0);
const icons = reactive({
  list: [
    {
      path:'/',
      name: '首页',
      inactive: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAgdJREFUWEftlk1LG1EUht8zKUJddCG4qIXuCkJru1TajaIzyR3bZT+Q/gMVMROVrura5saC+g/6QXXZOjeZCHUhaJfVtrgUEQrtrpuCkDliAzbRmclMhiEIubvL+XrOC/fcQ2jxoRbXx+UEmB5Z79OIHoG0x/8UZHfNZf64uDG6F1XRyApkjfWHGlIrDL5ZW4xAhy4q4wVn9FMUiEgAWb04TsTLQQWYaaJQzqyEhQgNYBlqAcBMyMSvpCNmw/iGArB09QGEJ2ESnvkwVmVZPG0U0xDAMuwdgPobJfK28xfpmANBsb4Ak8K+1lGhfQDXmyt+FvXzOMW9S8r845XHEyBnlO4w3MhPKrhTrS/vpL+d97kAMKPbD1yirZhde4en+LZU5o/651tzeyHs7uMK/UqkeDXptnTEfV+A3IgaZA2fEwSAdESd6nWXNkBbgbYCl0mB72D8rpsXhC4w3wLR1aA5En8OEC/IkjnnVcQy1HsAzxIFIBdD+Q2x6VUka6iXBMw3DTA1rO5eSeFr4K8WB4D5ryybnb5/wanB0u0jEN3wg4ipwK50xL1AgKxeXCLiiSQAmGm5UM5MBgKcGnNptcqM6s5/7jSrABHW8iVxYa/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SwNotb+UIM6OhW0/0uWYe9v027CaOJfxQOZbsCjAVmeEsxCD1n6Ltd6SvxH+0bC9I9dm0QnoNgcmQHZWnQ+ZB0VeeqOOrsIXKqGgT0qgF8RJAMcqgdH+KUNkQQUf+6J2f7Gz/wDdFRpuUYmTKAAAAABJRU5ErkJggg==',
    },
    {
      path:'/home/find',
      name: '发现',
      active: 'http://jkw.life:8020/icon/分类-01.png',
      inactive: 'http://jkw.life:8020/icon/分类-01-01.png',
    },
    {
      path:'/home/find',
      name: '资讯',
      active: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAA1BJREFUWEftV0t200AQrB6TDytyA8INcgPMIn4WLDAnsDmBBQnrOGviPPkEyCfAWYCCs8DcIEewb+Cs8kPTvBlL8kiZkZy8ZId29mhmSt3V1dW034h6DBwANCLBg6NTb4InfPYaP1uAaAPcIuCQ9hoRF+6bgimIby+HweTD/DGw+PXvW7W1520Q+wC2zTNtAJbrhFBIOfh69u78IUC+7P7YkUJ0wei49mcAGDghQH1xC8CL/AY6Bzjoj73hKkA+70YdIuoCvFN4/wLAiIEtAt6rtQyAysfR2OupcIm1zZYgdBh4XQAyZyCUggfBqTc11/xmtC0kdQnqa3krF2bgj2SE8vZqpNK65J0FQPHQZxIdViEkvMyBYUxIUMAsCUxdEOqF9RkRwr8CYRHsygDMA/ebUZ2lzqUlRdmbOsQkEJZV04MApFfYUkSFEFfxpBSAymVN4rc+pKIc9xuR1oyjsZcPf4JAg13fTHgBxAJvVDpKAZiLi3NozuBACgwtubQCcBEyJXp1BGJM7pBOY0EYEw5TIMUI6OgxDqx1z5jFNdQrI5DmT9cy0LMAmfbH3iv1XhHA3m40tVTLjIHe8ZkXpmffi4RKuwnkZ5rAmPXPPC2nZQAUMSHQs1VDJYCFkoHjm6uTtB8oWWUSLbOubSlQukEsR6l86z6wvqlVL1XSUgDJ5d9yBLy5GtgaU1kVLCuA/FQZmfFRpeIeA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W2+s3YgVVISqt2lYIyMPCJ+c3YZqBKEGZzZbjE113wA+Arsp3AA67RYceLz4D81kwf94YsfbdWTj5NXSA1NFX21aGIt/twArzWKasvXVuULU4x+BLTkLGGaMsXriLadJ8QSTZqoRftIOv6UhdlTMAJuu5+WLO1B57ddIDYGECpDxqDNZpC9wAerxwF0zOUcxsXcuVTzxsFaMJ4Gp0futgZHgZ4J0A/QDzODG+tIfg/axQvl4t0o4AdYaPk0ZJM9r5esruhFo6QrCcffT12KLbFYnAN7OmdruTf0vdbx8oXFOuKMQjzNjcPhBtB6xd9arpOVl42epTrOMQdiIOez2UL59eoP4C7SmoMBnbuvgAAAAASUVORK5CYII=',
    },
    {
      path:'/home/center',
      name: '我的',
      active: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAu9JREFUWEfFlU9IFGEYxp93DIVS6VQUFFR0yeimRIEFtrM7u0R1WCMhsPAiZMHMFmGhq0Ed3FkpI8gOBVLZeigJZnZnLdJDkJ2iDklgkWB/TqISJO28sUvrv3ZndmYXnMvAfO/zPL/v/Yb3I6zxQ2ucD8cAbZJWXW4KTQBLAA7828BrgPQFwXzUp/tnnWyqYIBgMFa2faayG0TtlgHM179unO8YGmpMFQJSEIAiJuoB8wGAHYWYAvgMCM2q4R2zq7cFCCMszIp1nwi0085s+TqDJ6uN8d1hhE0rnS2A4ol3gbjDSfhiLVO3mvR1ugZok7SK8hT9BFDtCgCYXSjjTX26/3c+vWUHZI/eTIT7LsMzMmaciSal9P+T87EEUDz6ExAaiwEAI6YmpZPuAER9GsCWogCAb6ohbXULMAegsjgAmlcNX5VLAG0UoPoiAcZUw3fIFYAs6p0EhIsBYCAcNaQuVwAhMbGXYb4vBsA0zX29I4G8HvaDSIw/Bfi4GwgGhqOGZKm1B/DptTAx7gaAYO6PGIE3ridhVqh4tA4Q5T3HnAHM3WrSbzmG0zrbDmTNQ954EzM/tOsEA1+I0a4mpcd2t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AKx0tSyndTKWi/vMZwFaD3BHxZx+APzGIbpwJR/PBV9SQnHwZsZAI4iGU5AW6jIDp6p/MNesfEMCmH3zJaNqPxHuVjVEGM3k5cB8KTQESAkVLKKuWjE9A+O+g5Keni5+Cmptbe2rfUQECHsB3jpnsM+ulqvCApRjbPWpTl89H1MC/zhAUqgvBCxvZQoY+OppuSLUGkgKdYuAgy0C3Pa0PBQKIN2vtrODx60AkI8dmTH5JBRAILI5/eYzr56KoU/CqjAZVQeIcBTAGgDLDIl8A/CRGde9grxjSs/6MjIZha3/B/gNNqzhIdHwUi8AAAAASUVORK5CYII=',
    },
  ]
})




</script>

<style scoped>
.van-tabbar-item--active{
  background: linear-gradient(left , rgb(188, 123, 255) 23% , rgb(243, 168, 250) 81%);
  background: -o-linear-gradient(left , rgb(188, 123, 255) 23% , rgb(243, 168, 250) 81%);
  background: -ms-linear-gradient(left , rgb(188, 123, 255) 23% , rgb(243, 168, 250) 81%);
  background: -moz-linear-gradient(left , rgb(188, 123, 255) 23% , rgb(243, 168, 250) 81%);
  background: -webkit-linear-gradient(left , rgb(188, 123, 255) 23% , rgb(243, 168, 250) 81%);


}
</style>

vant4的Tabbar 标签栏的使用

基本使用案例

<van-tabbar v-model="active">
  <van-tabbar-item icon="home-o">标签</van-tabbar-item>
  <van-tabbar-item icon="search">标签</van-tabbar-item>
  <van-tabbar-item icon="friends-o">标签</van-tabbar-item>
  <van-tabbar-item icon="setting-o">标签</van-tabbar-item>
</van-tabbar>

自定义图标使用案例 

用<template #icon="props">插槽结合动态数据绑定达到图标的自定义效果

<van-tabbar v-model="active">
  <van-tabbar-item badge="3">
    <span>自定义</span>
    <template #icon="props">
      <img :src="props.active ? icon.active : icon.inactive" />
    </template>
  </van-tabbar-item>
  <van-tabbar-item icon="search">标签</van-tabbar-item>
  <van-tabbar-item icon="setting-o">标签</van-tabbar-item>
</van-tabbar>
import { ref } from 'vue';

export default {
  setup() {
    const active = ref(0);
    const icon = {
      active: 'https://fastly.jsdelivr.net/npm/@vant/assets/user-active.png',
      inactive:
        'https://fastly.jsdelivr.net/npm/@vant/assets/user-inactive.png',
    };
    return {
      icon,
      active,
    };
  },
};

 代码详解

自定义导航栏背景色

style="background-image: linear-gradient(135deg, #EE9AE5 10%, #5961F9 100%) !important;"

自定义导航栏选中部分颜色

<style scoped>
.van-tabbar-item--active{
  background: linear-gradient(left , rgb(188, 123, 255) 23% , rgb(243, 168, 250) 81%);
  background: -o-linear-gradient(left , rgb(188, 123, 255) 23% , rgb(243, 168, 250) 81%);
  background: -ms-linear-gradient(left , rgb(188, 123, 255) 23% , rgb(243, 168, 250) 81%);
  background: -moz-linear-gradient(left , rgb(188, 123, 255) 23% , rgb(243, 168, 250) 81%);
  background: -webkit-linear-gradient(left , rgb(188, 123, 255) 23% , rgb(243, 168, 250) 81%);


}
</style>

绑定一个动态的active参数值

v-model="active"
import {reactive, ref} from "vue";
const active = ref(0);

 动态数据的设定

path为路由跳转路径,name为底部描述文字,active为选中时的图标,inactive为未选中时的图标

const icons = reactive({
  list: [
    {
      path:'/',
      name: '首页',
      inactive: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAgdJREFUWEftlk1LG1EUht8zKUJddCG4qIXuCkJru1TajaIzyR3bZT+Q/gMVMROVrura5saC+g/6QXXZOjeZCHUhaJfVtrgUEQrtrpuCkDliAzbRmclMhiEIubvL+XrOC/fcQ2jxoRbXx+UEmB5Z79OIHoG0x/8UZHfNZf64uDG6F1XRyApkjfWHGlIrDL5ZW4xAhy4q4wVn9FMUiEgAWb04TsTLQQWYaaJQzqyEhQgNYBlqAcBMyMSvpCNmw/iGArB09QGEJ2ESnvkwVmVZPG0U0xDAMuwdgPobJfK28xfpmANBsb4Ak8K+1lGhfQDXmyt+FvXzOMW9S8r845XHEyBnlO4w3MhPKrhTrS/vpL+d97kAMKPbD1yirZhde4en+LZU5o/651tzeyHs7uMK/UqkeDXptnTEfV+A3Ig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B5CZPdo2PZCB3jQPntwfX1l6b8BjHRTEhABGhoPe9+1/kpnfjIMcg1gfdUgBgCS8ee05v70NEzmQahTRIo+nQxBGQBI2pF73ohjPAvg/tXp40o8vmhIqNgmgwAJBafGQvb5LADti9safEuBTQBTVSDlAMg4BGn35wG4rKG7FHlSlbjuWSMjfcv9eQC91tDROsFXQA4BqDwZSwNotb+UIM6OhW0/0uWYe9v027CaOJfxQOZbsCjAVmeEsxCD1n6Ltd6SvxH+0bC9I9dm0QnoNgcmQHZWnQ+ZB0VeeqOOrsIXKqGgT0qgF8RJAMcqgdH+KUNkQQUf+6J2f7Gz/wDdFRpuUYmTKAAAAABJRU5ErkJggg==',
    },
    {
      path:'/home/find',
      name: '发现',
      active: 'http://jkw.life:8020/icon/分类-01.png',
      inactive: 'http://jkw.life:8020/icon/分类-01-01.png',
    },
    {
      path:'/home/find',
      name: '资讯',
      active: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAA1BJREFUWEftV0t200AQrB6TDytyA8INcgPMIn4WLDAnsDmBBQnrOGviPPkEyCfAWYCCs8DcIEewb+Cs8kPTvBlL8kiZkZy8ZId29mhmSt3V1dW034h6DBwANCLBg6NTb4InfPYaP1uAaAPcIuCQ9hoRF+6bgimIby+HweTD/DGw+PXvW7W1520Q+wC2zTNtAJbrhFBIOfh69u78IUC+7P7YkUJ0wei49mcAGDghQH1xC8CL/AY6Bzjoj73hKkA+70YdIuoCvFN4/wLAiIEtAt6rtQyAysfR2OupcIm1zZYgdBh4XQAyZyCUggfBqTc11/xmtC0kdQnqa3krF2bgj2SE8vZqpNK65J0FQPHQZxIdViEkvMyBYUxIUMAsCUxdEOqF9RkRwr8CYRHsygDMA/ebUZ2lzqUlRdmbOsQkEJZV04MApFfYUkSFEFfxpBSAymVN4rc+pKIc9xuR1oyjsZcPf4JAg13fTHgBxAJvVDpKAZiLi3NozuBACgwtubQCcBEyJXp1BGJM7pB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p9zx1IxORpIsz7BgDyhikSoQHYgexzwS+A+53vuQN+E7eyWx8Afd2CREyeI8KTLrZizjDF5dCGMMBbkDFMkQoNoIvKPU3XxxD20oWeO5BUS0OwrINuiNoGVO8XRbUTXM8AeqyggyjrkahqmGJ34/+OmKkpF0AYA/jQPz7M34yytqPr2zARkxoBU00ACqoel459Bwx7diUoQKcW2+s3YgVVISqt2lYIyMPCJ+c3YZqBKEGZzZbjE113wA+Arsp3AA67RYceLz4D81kwf94YsfbdWTj5NXSA1NFX21aGIt/twArzWKasvXVuULU4x+BLTkLGGaMsXriLadJ8QSTZqoRftIOv6UhdlTMAJuu5+WLO1B57ddIDYGECpDxqDNZpC9wAerxwF0zOUcxsXcuVTzxsFaMJ4Gp0futgZHgZ4J0A/QDzODG+tIfg/axQvl4t0o4AdYaPk0ZJM9r5esruhFo6QrCcffT12KLbFYnAN7OmdruTf0vdbx8oXFOuKMQjzNjcPhBtB6xd9arpOVl42epTrOMQdiIOez2UL59eoP4C7SmoMBnbuvgAAAAASUVORK5CYII=',
    },
    {
      path:'/home/center',
      name: '我的',
      active: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAu9JREFUWEfFlU9IFGEYxp93DIVS6VQUFFR0yeimRIEFtrM7u0R1WCMhsPAiZMHMFmGhq0Ed3FkpI8gOBVLZeigJZnZnLdJDkJ2iDklgkWB/TqISJO28sUvrv3ZndmYXnMvAfO/zPL/v/Yb3I6zxQ2ucD8cAbZJWXW4KTQBLAA7828BrgPQFwXzUp/tnnWyqYIBgMFa2faayG0TtlgHM179unO8YGmpMFQJSEIAiJuoB8wGAHYWYAvgMCM2q4R2zq7cFCCMszIp1nwi0085s+TqDJ6uN8d1hhE0rnS2A4ol3gbjDSfhiLVO3mvR1ugZok7SK8hT9BFDtCgCYXSjjTX26/3c+vWUHZI/eTIT7LsMzMmaciSal9P+T87EEUDz6ExAaiwEAI6YmpZPuAER9GsCW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nPQwGwv2W4sOtFSwCVvU/fwwAUI7zUdCYYEwgGTovcBIO7m4Eg0GRGx3tMGluAGww+bDKrXYR0M6PjR0waK4Dj/Q+7I07kKYBOk+FMfarkl7ZdHds9aeq3ApiZhosMPm0yDOoEupTR8TN2vYautMjvZJQWuTqhkkKdI2CokYSBIU/L8ymRlczU4RXkaOhdkBb5PoavAKx0tSyndTKWi/vMZwFaD3BHxZx+APzGIbpwJR/PBV9SQnHwZsZAI4iGU5AW6jIDp6p/MNesfEMCmH3zJaNqPxHuVjVEGM3k5cB8KTQESAkVLKKuWjE9A+O+g5Keni5+Cmptbe2rfUQECHsB3jpnsM+ulqvCApRjbPWpTl89H1MC/zhAUqgvBCxvZQoY+OppuSLUGkgKdYuAgy0C3Pa0PBQKIN2vtrODx60AkI8dmTH5JBRAILI5/eYzr56KoU/CqjAZVQeIcBTAGgDLDIl8A/CRGde9grxjSs/6MjIZha3/B/gNNqzhIdHwUi8AAAAASUVORK5CYII=',
    },
  ]
})

动态数据的绑定 以及遍历

 <van-tabbar-item v-for="(icon,index) in icons.list"  :key="index" :to="icon.path">
          <span>{{ icon.name }}</span>
          <template #icon="props">
            <img :src="props.active ? icon.active : icon.inactive"/>
          </template>
        </van-tabbar-item>

icon图标的寻找

网址

阿里巴巴矢量库

 首先搜索想要的图标

 点击下载图标 (实际不用下载,这步是为了拿到图标的网址)

 

 

 

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/605270.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

防火墙之流量管理

防火墙流量管理 原理概述&#xff1a; 防火墙&#xff08;英语&#xff1a;Firewall&#xff09;技术是通过有机结合各类用于安全管理与筛选的软件和硬件设备&#xff0c;帮助计算机网络于其内、外网之间构建一道相对隔绝的保护屏障&#xff0c;以保护用户资料与信息安全性的一…

【Python 文本分析】零基础也能轻松掌握的学习路线与参考资料

Python 常用的文本分析工具有很多&#xff0c;如 Natural Language Toolkit (NLTK)、TextBlob、spaCy、Jieba等。本文将分别介绍这些工具及其对应的学习路线、参考资料和优秀实践。 Natural Language Toolkit (NLTK) Natural Language Toolkit (NLTK) 是 Python 中文本分析研…

记一次Java生成SQL脚本文件换行格式为window/unix的笔记

今天在做一个SQL脚本文件生成需求&#xff0c;其中&#xff0c;需要设置&#xff1a; 文件编码为&#xff1a;UTF-8文件换行格式为&#xff1a;UNIX UTF-8这个好说&#xff0c;因为java代码可以指定文件编码&#xff0c;如&#xff1a; 但是Unix换行格式就很神奇了&#xff0…

职场恶霸00后,看完这篇你就知道了

在程序员职场上&#xff0c;什么样的人最让人反感呢? 是技术不好的人吗?并不是。技术不好的同事&#xff0c;我们可以帮他。 是技术太强的人吗?也不是。技术很强的同事&#xff0c;可遇不可求&#xff0c;向他学习还来不及呢。 真正让人反感的&#xff0c;是技术平平&#x…

032:Mapbox GL实现卷帘功能,可开启、关闭

第032个 点击查看专栏目录 本示例的目的是介绍演示如何在vue+mapbox中实现地图卷帘功能,这里可以设置开启、关闭卷帘。根据参数的不同,可以配置相关的功能,请参考底部的API信息。本示例比较重要的一点是要知道如何引用mapbox-gl-compare插件。 直接复制下面的 vue+mapbox源…

SpringData 进阶篇-上

SpringData 一&#xff1a;背景介绍二&#xff1a;XML配置 与JavaConfig配置2.1 XML配置2.1.1 配置文件2.1.2 具体使用 2.2 JavaConfig配置2.2.1 配置类2.2.2 具体使用&#xff1a; 三&#xff1a;SpringDataJpa的CRUD3.1 接口代码3.2 具体使用3.3 其它方法3.4 分页方法 四&am…

【数据集处理】中国地面气候资料日值数据集(V3.0)

1 数据集介绍-中国地面气候资料日值数据集(V3.0) 中国地面气候资料日值数据集(V3.0)包含以下气象数据资料(包括降水、气温、风速等)。 2 数据处理 以湿度数据(RHU) 处理为例,数据文件如下: 2.1 步骤1:从文件中提取数据 首先提取所有需要的有效信息,查看【数据表格…

sql_server数据库入门学习(二)

&#x1f3ac; 博客主页&#xff1a;博主链接 &#x1f3a5; 本文由 M malloc 原创&#xff0c;首发于 CSDN&#x1f649; &#x1f384; 学习专栏推荐&#xff1a;LeetCode刷题集&#xff01; &#x1f3c5; 欢迎点赞 &#x1f44d; 收藏 ⭐留言 &#x1f4dd; 如有错误敬请指…

Java程序设计入门教程--创建对象

目录 声明对象 声明对象的格式 声明对象的作用 建立对象 创建一个对象 初始化对象 当我们创建了一个类&#xff0c;就等同于我们创建了一种新的数据类型&#xff0c;你可以像使用基本数据类型一样地使用类。 类定义好之后&#xff0c;我们将用该类定义一个实例&am…

【从零开始进行高精度手眼标定 eye in hand(小白向)2 Tsai轴角法与四元数法编程实现】

从零开始进行高精度手眼标定 eye in hand&#xff08;小白向&#xff09;2 Tsai轴角法与四元数法编程实现 前言Tsai标定方法原理推导轴角方法原理matlab编程实现 四元数方法原理matlab编程实现 前言 最近由于组内的相关工作需求&#xff0c;需要进行机器人的高精度标定。原始的…

Redis的常用数据结构之集合类型

集合元素的特点 集合中的元素无序&#xff0c;不可以重复无法通过某一个下标的方式获取元素单个集合最多可以存储2的32次方-1个元素redis支持对集合取交集&#xff08;共同兴趣点&#xff09;、并集&#xff08;两个开发团队擅长什么&#xff09;、差集 单个集合中的操作指令…

系统架构设计师教程(第2版)

系统架构设计师教程&#xff08;第2版&#xff09;作为全国计算机技术与软件专业技术资格&#xff08;水平&#xff09;考试指定用书&#xff0c;系统地介绍了系统架构设计师的基本要求&#xff0c;应具备的基础知识和需要掌握的知识。 全书分上、下两篇&#xff0c;共计 20 章…

Qt Quick系列(6)—动画

&#x1f680;作者&#xff1a;CAccept &#x1f382;专栏&#xff1a;Qt Quick 文章目录 前言1、简单动画代码示例 2、应用动画代码示例相关知识点 3、缓动曲线代码示例相关知识点 4、动画分组代码示例 5、嵌套动画代码示例 6、状态转换代码示例相关知识点 结语 前言 欢迎来…

安卓进阶(一)App性能优化

文章目录 性能优化的目的及方向流畅性启动速度页面显示速度响应速度 稳定性ANRCrash 资源节省性 布局优化选择耗费性能较少的布局减少布局的层级&#xff08;嵌套&#xff09;使用布局标签尽量少用布局属性wrap_contentincludemergeinclude与merge的区别ViewStub 内存泄露常见内…

计算机网络实验:交换机的Telnet远程登录配置

目录 前言实验目的实验内容实验过程画出拓扑图设置IP3&#xff0c;给交换机设IP&#xff0c;实际上相当于给VLAN 1 这个接口设置IP4&#xff0c;连网线5&#xff0c;测试网络是否连通6&#xff0c;通过telnet去管理配置交换机交换机的密码2、console密码3、telnet密码 总结 前言…

【CSS3系列】第五章 · web 字体

写在前面 Hello大家好&#xff0c; 我是【麟-小白】&#xff0c;一位软件工程专业的学生&#xff0c;喜好计算机知识。希望大家能够一起学习进步呀&#xff01;本人是一名在读大学生&#xff0c;专业水平有限&#xff0c;如发现错误或不足之处&#xff0c;请多多指正&#xff0…

【3DsMAX】从零开始建房(1)

目录 目标 步骤 1. 制作地基 2. 制作台阶 3. 制作地砖 4. 制作第一层主体 5. 挖空第一层门的位置 6. 制作展示厅 目标 要做的房子模型如下&#xff1a; 步骤 1. 制作地基 首先创建一个长方体 可以将其转换为可编辑多边形&#xff0c;然后选中所有顶点&#xff0c;调…

【复变函数笔记】解析函数的定义和性质

文章目录 解析函数的等价定义解析函数的性质 解析函数的等价定义 解析函数的定义&#xff1a; f ( z ) f(z) f(z)在区域内可导则在区域内解析&#xff0c;在一点解析就是在某一邻域内可导。解析函数不可能只在一点解析。柯西-黎曼方程&#xff1a;函数 f ( z ) u ( x , y ) …

【TreeSet集合】比较器排序Comparator的使用

比较器排序Comparator的使用 存储学生对象并遍历&#xff0c;创建TreeSet集合使用带参构造方法 要求&#xff1a;按照年龄从小到大排序&#xff0c;年龄相同时&#xff0c;按照姓名的字母顺序排序 创建学生类&#xff1a; package com.gather.set.treeset; public class Stude…

Nginx网站服务——编译安装与系统服务添加

一、Nginx简介 Nginx特点&#xff1a;&#xff08;占用内存少&#xff0c;并发能力强&#xff09; Nginx 是开源、高性能、高可靠的 Web 和反向代理服务器&#xff0c;而且支持热部署&#xff0c;几乎可以做到 7 * 24 小时不间断运行&#xff0c;即使运行几个月也不需要重新启…