vue3 el-tabs 和 el-dropdown 结合实现 tagsView 标签导航

news2024/9/20 21:20:10

大致思路

所谓 tagsView 可以分成两部分来去看:

  1. tags
  2. view

那怎么分开看呢?

首先我们先来看 tags

所谓 tgas 指的是:位于 appmain 之上的标签

那么现在我们忽略掉 view,现在只有一个要求:

view 之上渲染这个 tag

仅看这一个要求,很简单吧。

views:

明确好了 tags 之后,我们来看 views

脱离了 tags 只看 views 就更简单了,所谓 views指的就是一个用来渲染组件的位置,就像我们之前的 Appmain 一样,只不过这里的 views 可能稍微复杂一点,因为它需要在渲染的基础上增加:

  1. 动画
  2. 缓存(数据的缓存)

这两个额外的功能。

加上这两个功能之后可能会略显复杂,但是 官网已经帮助我们处理了这个问题

所以 单看 views 也是一个很简单的功能。

那么接下来我们需要做的就是把 tagsview 合并起来而已。

那么明确好了原理之后,我们就来看 实现方案:

  1. 创建 tagsView 组件:用来处理 tags 的展示
  2. 处理基于路由的动态过渡,在 AppMain 中进行:用于处理 view 的部分

整个的方案就是这么两大部,但是其中我们还需要处理一些细节相关的,完整的方案为

  1. 监听路由变化,组成用于渲染 tags 的数据源
  2. 创建 tags 组件,根据数据源渲染 tag,渲染出来的 tags 需要同时具备
    1. 国际化 title (这里不考虑)
    2. 路由跳转
  1. 处理鼠标右键效果,根据右键处理对应数据源
  2. 处理基于路由的动态过渡

那么明确好了方案之后,接下来我们根据方案进行处理即可。

基本布局

这里我们会基于element-plus的Tabs 标签页组件以及dropdown联合进行封装开发

layout/components/tagsView/idnex.vue

<template>
  <div
    class="f-tag-list"
    :style="{ left: appStore.sidebar.opened == '1' ? '220px' : '64px' }"
  >
    <el-tabs
      v-model="editableTabsValue"
      type="card"
      closable
      @edit="handleTabsEdit"
      class="flex-1"
      style="min-width: 100px;"
    >
      <el-tab-pane
        v-for="item in editableTabs"
        :key="item.name"
        :label="item.title"
        :name="item.name"
      >
      </el-tab-pane>
    </el-tabs>

    <span class="tag-btn">
      <el-dropdown>
        <span class="el-dropdown-link">
          <el-icon>
            <arrow-down />
          </el-icon>
        </span>
        <template #dropdown>
          <el-dropdown-menu>
            <el-dropdown-item>Action 1</el-dropdown-item>
            <el-dropdown-item>Action 2</el-dropdown-item>
            <el-dropdown-item>Action 3</el-dropdown-item>
            <el-dropdown-item disabled>Action 4</el-dropdown-item>
            <el-dropdown-item divided>Action 5</el-dropdown-item>
          </el-dropdown-menu>
        </template>
      </el-dropdown>
    </span>
  </div>
</template>

<script setup>
import useAppStore from "@/store/modules/app";

const appStore = useAppStore();

let tabIndex = 2;
const editableTabsValue = ref("2");
const editableTabs = ref([
  {
    title: "Tab 1",
    name: "1",
    content: "Tab 1 content",
  },
  {
    title: "Tab 2",
    name: "2",
    content: "Tab 2 content",
  },
  {
    title: "Tab 2",
    name: "3",
    content: "Tab 2 content",
  },
  {
    title: "Tab 2",
    name: "4",
    content: "Tab 2 content",
  },
  {
    title: "Tab 2",
    name: "5",
    content: "Tab 2 content",
  },
  {
    title: "Tab 2",
    name: "6",
    content: "Tab 2 content",
  },
  {
    title: "Tab 2",
    name: "7",
    content: "Tab 2 content",
  },
  {
    title: "Tab 2",
    name: "8",
    content: "Tab 2 content",
  },
  {
    title: "Tab 2",
    name: "9",
    content: "Tab 2 content",
  },
  {
    title: "Tab 2",
    name: "10",
    content: "Tab 2 content",
  },
]);
const handleTabsEdit = (targetName, action) => {
  if (action === "add") {
    const newTabName = `${++tabIndex}`;
    editableTabs.value.push({
      title: "New Tab",
      name: newTabName,
      content: "New Tab content",
    });
    editableTabsValue.value = newTabName;
  } else if (action === "remove") {
    const tabs = editableTabs.value;
    let activeName = editableTabsValue.value;
    if (activeName === targetName) {
      tabs.forEach((tab, index) => {
        if (tab.name === targetName) {
          const nextTab = tabs[index + 1] || tabs[index - 1];
          if (nextTab) {
            activeName = nextTab.name;
          }
        }
      });
    }

    editableTabsValue.value = activeName;
    editableTabs.value = tabs.filter((tab) => tab.name !== targetName);
  }
};
</script>

<style scoped lang="scss">
:deep(.el-tooltip__trigger:focus-visible) {
  outline: unset !important;
}

:deep(.el-tabs__header) {
  margin-bottom: 0 !important;
}

:deep(.el-tabs--card > .el-tabs__header) {
  border-bottom: none !important;
}

:deep(.el-tabs__nav) {
  border: 0 !important;
}

:deep(.el-tabs--card > .el-tabs__header .el-tabs__item) {
  border-left: 0 !important;
  height: 32px !important;
  line-height: 32px !important;
  background-color: rgba(216,226,249, .3);
  @apply mx-1 rounded;
}

:deep(.el-tabs__nav-next), :deep( .el-tabs__nav-prev) {
    line-height: 32px;
    height: 32px;
}

:deep(.is-disabled) {
    cursor: not-allowed;
    @apply text-gray-300;
}

.f-tag-list {
  height: 44px;
  z-index: 100;
  width: 100%;
  background: #fff;
  -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12),
    0 0 3px 0 rgba(0, 0, 0, 0.04);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04);
  @apply bg-white flex items-center px-2;
}

.tag-btn {
  @apply bg-white rounded ml-auto flex items-center justify-center;
  height: 32px;
  width: 32px;
  -webkit-box-shadow: 0 0px 1px 0 rgba(0, 0, 0, 0.12),
    0 0 0px 0 rgba(0, 0, 0, 0.04);
  box-shadow: 0 px 1px 0 rgba(0, 0, 0, 0.12), 0 0 1px 0 rgba(0, 0, 0, 0.04);
}
</style>

同步路由和存储

layout/components/tagsView/index.vue

<template>
  <div
    class="f-tag-list"
    :style="{ left: appStore.sidebar.opened == '1' ? '220px' : '64px' }"
  >
    <el-tabs
      v-model="activeTags"
      type="card"
      @edit="handleTagsEdit"
      @tab-change="tabChangeEvent"
      class="flex-1"
      style="min-width: 100px"
    >
      <el-tab-pane
        v-for="item in tagsList"
        :key="item.path"
        :label="item.title"
        :name="item.path"
        :closable="item.path != '/dashboard'"
      >
      </el-tab-pane>
    </el-tabs>

    <span class="tag-btn">
      <el-dropdown>
        <span class="el-dropdown-link">
          <el-icon>
            <arrow-down />
          </el-icon>
        </span>
        <template #dropdown>
          <el-dropdown-menu>
            <el-dropdown-item>Action 1</el-dropdown-item>
            <el-dropdown-item>Action 2</el-dropdown-item>
            <el-dropdown-item>Action 3</el-dropdown-item>
            <el-dropdown-item disabled>Action 4</el-dropdown-item>
            <el-dropdown-item divided>Action 5</el-dropdown-item>
          </el-dropdown-menu>
        </template>
      </el-dropdown>
    </span>
  </div>
</template>

<script setup>
import useAppStore from "@/store/modules/app";
import Cookies from "js-cookie";

const route = useRoute();
const router = useRouter();
const appStore = useAppStore();

const activeTags = ref(route.path);
const tagsList = ref([
  {
    title: "首页",
    path: "/dashboard",
  },
]);

// 初始化tags标签
function initTagsList() {
  let tagsInitList = Cookies.get('tagsList');
  if(tagsInitList) {
    tagsList.value = JSON.parse(tagsInitList);
  }
}
initTagsList()

// 添加标签导航
function addtags(tag) {
  // 判断是否已经存在tag
  let noTag = tagsList.value.findIndex((t) => t.path == tag.path) == -1;
  if (noTag) {
    tagsList.value.push(tag);
  }
  // 缓存
  Cookies.set("tagsList", JSON.stringify(tagsList.value));
}

// 监听路由变化
onBeforeRouteUpdate((to, from) => {
  activeTags.value = to.path;
  addtags({
    title: to.meta.title,
    path: to.path,
  });
});

// 标签栏点击事件
const handleTagsEdit = (targetName, action) => {
  console.log(action, targetName);
  if (action === "add") {
  } else if (action === "remove") {
  }
};

// 监听 tag 的切换
const tabChangeEvent = (name) => {
  activeTags.value = name;
  router.push(name)
};
</script>

<style scoped lang="scss">
  ...
</style>

关闭标签导航实现

当我们点击关闭标签导航的时候会自动切换到下一个;关闭下一个标签导航会自动切换到上一个

layout/components/tagsView/index.vue

<el-tabs
  v-model="activeTags"
  type="card"
++  @tab-remove="handleTagsRemoveEvent"
  @tab-change="tabChangeEvent"
  class="flex-1"
  style="min-width: 100px"
>

// 标签栏点击事件
const handleTagsRemoveEvent = (t) => {
  let tags = tagsList.value;
  let currentActiveTag = activeTags.value;

  // 如果关闭的是当前激活的标签
  if (currentActiveTag === t) {
    // 尝试找到下一个或上一个可激活的标签
    let nextTag;
    for (let i = 0; i < tags.length; i++) {
      if (tags[i].path === t) {
        nextTag = tags[i + 1] || tags[i - 1]; // 尝试找下一个或上一个标签
        break;
      }
    }

    // 如果没有找到可激活的标签(例如,只剩下一个标签且被关闭),可以选择默认路由
    if (!nextTag) {
      nextTag = tags[0]; // 或者其他默认逻辑
    }

    // 更新激活标签
    activeTags.value = nextTag.path;

    // 如果新激活的标签不是当前路由,则跳转
    if (nextTag.path !== route.path) {
      router.push(nextTag.path);
    }
  }

  // 过滤标签列表并缓存
  tagsList.value = tags.filter((tag) => tag.path !== t);
  Cookies.set("tagsList", JSON.stringify(tagsList.value));
};

关闭其他和关闭全部功能实现

layout/components/tagsView/index.vue

<span class="tag-btn">
  <el-dropdown @command="commandEvent">
    <span class="el-dropdown-link">
      <el-icon>
        <arrow-down />
      </el-icon>
    </span>
    <template #dropdown>
      <el-dropdown-menu>
        <el-dropdown-item command="clearOther">关闭其他</el-dropdown-item>
        <el-dropdown-item command="clearAll">全部关闭</el-dropdown-item>
      </el-dropdown-menu>
    </template>
  </el-dropdown>
</span>

// 关闭其他/关闭全部功能
const commandEvent = (val) => {
  if (val == "clearAll") {
    // 标签激活状态切换为 首页
    activeTags.value = "/dashboard";
    // 直接跳转到首页路由
    router.push("/dashboard");
    // 过滤 tags 数组,只剩下首页
    tagsList.value = [
      {
        title: "首页",
        path: "/dashboard",
      },
    ];
  } else if (val == "clearOther") {
    // 过滤只剩下首页和当前激活的tag
    tagsList.value = tagsList.value.filter(
      (tab) => tab.path == "/dashboard" || tab.path == activeTags.value
    );
  }
  Cookies.set("tagsList", JSON.stringify(tagsList.value));
};

优化逻辑

对于上面写的逻辑我们这里对其进行一个抽离封装成hooks

hooks/useTags.js

import Cookies from "js-cookie";

export function useTags() {
  const route = useRoute();
  const router = useRouter();

  const activeTags = ref(route.path);
  const tagsList = ref([
    {
      title: "首页",
      path: "/dashboard",
    },
  ]);

  // 初始化tags标签
  function initTagsList() {
    let tagsInitList = Cookies.get("tagsList");
    if (tagsInitList) {
      tagsList.value = JSON.parse(tagsInitList);
    }
  }
  initTagsList();

  // 添加标签导航
  function addtags(tag) {
    // 判断是否已经存在tag
    let noTag = tagsList.value.findIndex((t) => t.path == tag.path) == -1;
    if (noTag) {
      tagsList.value.push(tag);
    }
    // 缓存
    Cookies.set("tagsList", JSON.stringify(tagsList.value));
  }

  // 监听路由变化
  onBeforeRouteUpdate((to, from) => {
    activeTags.value = to.path;
    addtags({
      title: to.meta.title,
      path: to.path,
    });
  });

  // 监听 tag 的切换
  const tabChangeEvent = (name) => {
    activeTags.value = name;
    router.push(name);
  };

  // 标签栏点击事件
  const handleTagsRemoveEvent = (t) => {
    let tags = tagsList.value;
    let currentActiveTag = activeTags.value;

    // 如果关闭的是当前激活的标签
    if (currentActiveTag === t) {
      // 尝试找到下一个或上一个可激活的标签
      let nextTag;
      for (let i = 0; i < tags.length; i++) {
        if (tags[i].path === t) {
          nextTag = tags[i + 1] || tags[i - 1]; // 尝试找下一个或上一个标签
          break;
        }
      }

      // 如果没有找到可激活的标签(例如,只剩下一个标签且被关闭),可以选择默认路由
      if (!nextTag) {
        nextTag = tags[0]; // 或者其他默认逻辑
      }

      // 更新激活标签
      activeTags.value = nextTag.path;

      // 如果新激活的标签不是当前路由,则跳转
      if (nextTag.path !== route.path) {
        router.push(nextTag.path);
      }
    }

    // 过滤标签列表并缓存
    tagsList.value = tags.filter((tag) => tag.path !== t);
    Cookies.set("tagsList", JSON.stringify(tagsList.value));
  };

  // 关闭其他/关闭全部功能
  const commandEvent = (val) => {
    if (val == "clearAll") {
      // 标签激活状态切换为 首页
      activeTags.value = "/dashboard";
      // 直接跳转到首页路由
      router.push("/dashboard");
      // 过滤 tags 数组,只剩下首页
      tagsList.value = [
        {
          title: "首页",
          path: "/dashboard",
        },
      ];
    } else if (val == "clearOther") {
      // 过滤只剩下首页和当前激活的tag
      tagsList.value = tagsList.value.filter(
        (tab) => tab.path == "/dashboard" || tab.path == activeTags.value
      );
    }
    Cookies.set("tagsList", JSON.stringify(tagsList.value));
  };

  return {
    activeTags,
    tagsList,
    tabChangeEvent,
    handleTagsRemoveEvent,
    commandEvent,
  }
}

layout/components/tagsView/index.vue

<template>
  <div
    class="f-tag-list"
    :style="{ left: appStore.sidebar.opened == '1' ? '220px' : '64px' }"
  >
    <el-tabs
      v-model="activeTags"
      type="card"
      @tab-remove="handleTagsRemoveEvent"
      @tab-change="tabChangeEvent"
      class="flex-1"
      style="min-width: 100px"
    >
      <el-tab-pane
        v-for="item in tagsList"
        :key="item.path"
        :label="item.title"
        :name="item.path"
        :closable="item.path != '/dashboard'"
      >
      </el-tab-pane>
    </el-tabs>

    <span class="tag-btn">
      <el-dropdown @command="commandEvent">
        <span class="el-dropdown-link">
          <el-icon>
            <arrow-down />
          </el-icon>
        </span>
        <template #dropdown>
          <el-dropdown-menu>
            <el-dropdown-item command="clearOther">关闭其他</el-dropdown-item>
            <el-dropdown-item command="clearAll">全部关闭</el-dropdown-item>
          </el-dropdown-menu>
        </template>
      </el-dropdown>
    </span>
  </div>
</template>

<script setup>
import useAppStore from "@/store/modules/app";
import { useTags } from "@/hooks/useTags";

const appStore = useAppStore();
const {
  activeTags,
  tagsList,
  tabChangeEvent,
  handleTagsRemoveEvent,
  commandEvent,
} = useTags();
</script>

<style scoped lang="scss">
:deep(.el-tooltip__trigger:focus-visible) {
  outline: unset !important;
}

:deep(.el-tabs__header) {
  margin-bottom: 0 !important;
}

:deep(.el-tabs--card > .el-tabs__header) {
  border-bottom: none !important;
}

:deep(.el-tabs__nav) {
  border: 0 !important;
}

:deep(.el-tabs--card > .el-tabs__header .el-tabs__item) {
  border-left: 0 !important;
  height: 32px !important;
  line-height: 32px !important;
  background-color: rgba(216, 226, 249, 0.3);
  @apply mx-1 rounded;
}

:deep(.el-tabs__nav-next),
:deep(.el-tabs__nav-prev) {
  line-height: 32px;
  height: 32px;
}

:deep(.is-disabled) {
  cursor: not-allowed;
  @apply text-gray-300;
}

.f-tag-list {
  height: 44px;
  z-index: 100;
  width: 100%;
  background: #fff;
  -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12),
    0 0 3px 0 rgba(0, 0, 0, 0.04);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04);
  @apply bg-white flex items-center px-2;
}

.tag-btn {
  @apply bg-white rounded ml-auto flex items-center justify-center;
  height: 32px;
  width: 32px;
  -webkit-box-shadow: 0 0px 1px 0 rgba(0, 0, 0, 0.12),
    0 0 0px 0 rgba(0, 0, 0, 0.04);
  box-shadow: 0 px 1px 0 rgba(0, 0, 0, 0.12), 0 0 1px 0 rgba(0, 0, 0, 0.04);
}
</style>

到这里的话我们的tagsView布局和功能就开发完成了。

当然这里也可以自己手写一个,我这里给出一个手写的示例代码:

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

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

相关文章

开源 AI 智能名片 S2B2C 商城小程序相关角色的探索

摘要&#xff1a;本文围绕开源 AI 智能名片 S2B2C 商城小程序的决策产品方向&#xff0c;基于两个原则展开研究。原则一是根据该产品方向尽可能多地寻找相关角色&#xff0c;原则二是以探索痛点而非销售为核心。同时确保识别出的角色覆盖价值使用者、价值传递者与价值生产者三类…

揭秘团购奇迹:如何在一个月内实现超过600万的盈利

你是否曾经对那些看似亏损的商业机会感到好奇&#xff0c;却意外地发现它们在短短一个月内能为你带来超过六百万的收益&#xff1f;这个令人震惊的数字&#xff0c;是否激起了你的好奇心和探索欲&#xff1f;如果你愿意深入了解我们今天要分享的内容&#xff0c;我坚信你也能找…

零基础小白能学网络安全吗?

最近看到很多朋友都在问“零基础能学网络安全吗&#xff1f;” 今天整一篇帮大家分析一下&#xff0c;希望对你有帮助。 首先&#xff0c;问出这个问题的朋友&#xff0c;我大致判断一下&#xff0c;你对网络安全并不了解&#xff0c;只是单纯看到某个视频某篇文章&#xff0…

想从事FPGA需要学好哪些知识?

想从事FPGA需要学好&#xff1a; 1、数字电路基础 2、微机原理&#xff0c;汇编语言&#xff08;推荐王克义老师的《微机原理&#xff08;第2版&#xff09;》&#xff09;或计算机体系结构或单片机原理&#xff1b; 3、C/C&#xff0b;&#xff0b;语言&#xff1b; 4、Ve…

免费且实用:UI设计常用的颜色参考网站和一些Icon设计网站

用心去分享&#xff01;请给我点个关注和点赞收藏&#xff01;谢谢各位努力的人才&#xff01; 1.在UI设计的时候&#xff0c;没有灵感&#xff0c;怎么办&#xff1f;可以参考这个网站&#xff08;需要魔法能量&#xff09; 网址如下&#xff1a; Color Hunt - Color Palette…

windows中多ping网络ICMP

之前没搞过ICMP,第一次弄&#xff0c;遇到好多坑&#xff0c;其中在接收ICMP消息时无法指定ip这个坑困扰了好久&#xff0c;最后在网上找到一种解决方法&#xff1b;直接看效果吧&#xff01;&#xff01; 其中我获取ip状态直接扔到线程池里面处理的 struct DevicePingMsg {D…

OpenAI新模型“Strawberry“蓄势待发:会思考的AI即将登场?

OpenAI新模型"Strawberry"蓄势待发&#xff1a;会思考的AI即将登场&#xff1f; OpenAI的神秘大模型"草莓"&#xff08;Strawberry&#xff0c;之前称为Q*&#xff09;可能要提早亮相了。这款AI不仅能思考&#xff0c;还可能彻底改变我们与人工智能互动的方…

果蔬识别系统性能优化之路(三)

目录 前情提要遗留问题 解决方案优化查询速度优化ivf初始化的速度 下一步 前情提要 果蔬识别系统性能优化之路&#xff08;二&#xff09; 遗留问题 优化同步速度&#xff0c;目前大约30秒&#xff0c;不是一个生产速度 这次来解决遗留问题 通过console&#xff0c;发现两个…

【F178】基于Springboot+vue实现的智能无人仓库管理

作者主页&#xff1a;Java码库 主营内容&#xff1a;SpringBoot、Vue、SSM、HLMT、Jsp、PHP、Nodejs、Python、爬虫、数据可视化、小程序、安卓app等设计与开发。 收藏点赞不迷路 关注作者有好处 文末获取源码 项目描述 互联网发展至今&#xff0c;无论是其理论还是技术都已经…

揭秘数据库性能飞跃的秘密:深入理解索引与执行计划的艺术

作者简介&#xff1a;我是团团儿&#xff0c;是一名专注于云计算领域的专业创作者&#xff0c;感谢大家的关注 座右铭&#xff1a; 云端筑梦&#xff0c;数据为翼&#xff0c;探索无限可能&#xff0c;引领云计算新纪元 个人主页&#xff1a;团儿.-CSDN博客 目录 前言&#…

2024最新版超级全的Python基础知识

数据类型和变量 Python使用缩进来组织代码块,一般使用4个空格的缩进.使用#来注释一行,其他每一行都是一个语句,当语句以冒号:结尾时,缩进的语句视为代码块.Python对大小写敏感 1.1整数 Python可以处理任意大小的整数,包括负整数,写法与数学上写法一致,例如&#xff1a;-100.如…

项目管理软件的技术深度剖析:从架构到创新的全面探索

各位技术小伙伴们&#xff0c;今天咱们跟随猴哥聊聊一个既熟悉又略带神秘的话题——项目管理软件。在快节奏的现代商业环境中&#xff0c;项目管理就像是企业运作的润滑剂&#xff0c;而项目管理软件&#xff0c;就是那把让一切井然有序的神器。不过&#xff0c;别看它平时默默…

大模型sft评估指标方案

大模型sft评估一直都是一个让人头疼的问题&#xff0c;那么如何进行sft评估呢&#xff1f; 一共有两类方案 第一类&#xff1a;用另一个AI或者人类 对模型答案进行打分 可以是竞技场模式&#xff0c;也可以是离线打分模式 打分可以用一些权威的榜单&#xff0c;例如 super…

AI芯片国产化率100%!运营商最大单集群智算中心投产

8月30日&#xff0c;中国移动建成运营商最大单集群智算中心——中国移动智算中心&#xff08;哈尔滨&#xff09;&#xff0c;并正式投产使用&#xff0c;将为全国的科技创新与产业升级带来强大助力。 该智算中心部署超1.8万张AI加速卡&#xff0c;AI芯片国产化率达100%&#x…

【吊打面试官系列-Redis面试题】都有哪些办法可以降低 Redis 的内存使用情况呢?

大家好&#xff0c;我是锋哥。今天分享关于【都有哪些办法可以降低 Redis 的内存使用情况呢&#xff1f;】面试题&#xff0c;希望对大家有帮助&#xff1b; 都有哪些办法可以降低 Redis 的内存使用情况呢&#xff1f; 如果你使用的是 32 位的 Redis 实例&#xff0c;可以好好利…

佰朔资本:股票市场牛熊是什么意思,熊市怎么找投资机会?

股票商场中的牛市&#xff0c;也被称为多头商场&#xff0c;指的是股票价格长时刻呈上升趋势的股票商场&#xff0c;后续广泛看涨的情况。 股票商场中的熊市&#xff0c;也被称为空头商场&#xff0c;指股票的价格长时刻呈下降趋势的股票商场&#xff0c;后续广泛看跌的情况。…

计算机常见网络协议分析(1)

1.ppp协议 &#xff09;流程&#xff1a;五个阶段 链路不可用阶段dead 链路建立阶段established 认证阶段authentiate 网络层协议阶段network 链路终止阶段terminate &#xff09;帧格式: Flags&#xff1a;帧定界&#xff0c;表示帧开始和结束&#xff0c;一字节&#…

实验十一 Java的网络应用

实验目的及要求 目的&#xff1a;熟悉java中网络通讯的基本原理及简单网络程序的开发。 内容&#xff1a;1.编写使用ServerSocket创建服务器端程序&#xff1b; 2.编写使用Socket创建客户器端程序&#xff1b; 3.验证使用套接字实现网络通信的方法。 二、实验环境 计算机…

Codeforces Round 969 (Div. 2) (A~D)

文章目录 A. Doras Set思路code B. Index and Maximum Value思路code C. Dora and C思路code D. Iris and Game on the Tree思路code Codeforces Round 969 (Div. 2) A. Dora’s Set 思路 签到题&#xff0c;把玩一下样例不难发现&#xff1a; 对于 [ l , r ] [l,r] [l,r] …

MVC架构的JSP快速学习(一)

目录 服务相关配置 模型介绍 基础依赖 模型图(抽象) 项目结构 控制器编写 服务相关配置 1. Tomcat配置 http://t.csdnimg.cn/9rILV 2. Maven配置 http://t.csdnimg.cn/REKu9 3. Idea配置 tomcat maven 模型介绍 虽然JSP本身不强制使用MVC&#xff0c;但它通常与Serv…