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

如何做高并发网站的架构设计软文通

如何做高并发网站的架构设计,软文通,微信会员卡管理系统怎么开通,网站3网合一是怎么做的1.动态样式实现 1.1核心代码解释#xff1a; classpower-station-perspective-item-text#xff1a; 为这个 span 元素添加了一个 CSS 类#xff0c;以便对其样式进行定义。 clickclickItem(item.id)#xff1a; 这是一个 Vue 事件绑定。当用户点…1.动态样式实现 1.1核心代码解释 classpower-station-perspective-item-text 为这个 span 元素添加了一个 CSS 类以便对其样式进行定义。 clickclickItem(item.id) 这是一个 Vue 事件绑定。当用户点击这个 span 元素时会触发 clickItem 方法并将 item.id 作为参数传递给该方法。这用于记录用户点击了哪个项目。 :style{ color: isChecked(item.id) ? #cc7e17 : } 这是一个 Vue 动态绑定的内联样式。isChecked(item.id) 会检查当前项目是否被选中即 checkedItem.value 是否等于 item.id。如果 isChecked(item.id) 返回 true则 color 样式会被设置为 #cc7e17一种颜色值否则color 样式为空字符串表示不改变颜色。 {{ item.title }} 这是一个 Vue 插值语法用于显示每个项目的标题文本。 spanclasspower-station-perspective-item-textclickclickItem(item.id):style{ color: isChecked(item.id) ? #cc7e17 : }{{ item.title }}/span 1.2源代码 templatediv classpower-station-perspectivediv classflow-chart-container-itemdiv classpower-station-perspective-title flow-chart-container-item-parent{{ title }}/divdiv v-foritem in buttonGroupsArr:keyitem.idclasspower-station-perspective-item flow-chart-container-item locationspanclasspower-station-perspective-item-textclickclickItem(item.id):style{ color: isChecked(item.id) ? #cc7e17 : }{{ item.title }}/span/div/div/div /templatescript setup import {ref, onMounted} from vue;const title ref(菜单项); const buttonGroupsArr ref([{title: 按钮1, id: 0},{title: 按钮2, id: 1},{title: 按钮3, id: 2},{title: 按钮4, id: 3},{title: 按钮5, id: 4}, ]);const checkedItem ref(0);const isChecked (param) {return checkedItem.value param; };const clickItem (param) {checkedItem.value param; };onMounted(() {}); /scriptstyle scoped .power-station-perspective{width: 200px; } .flow-chart-container-item-parent {width: 100%;background: linear-gradient(90deg, rgba(0, 136, 234, 0.84) 0%,rgba(31, 38, 83, 0.85) 101.82%); }.flow-chart-container-item {display: grid;text-align: center;padding: 3px 5px 3px 3px;margin-bottom: 3px;align-items: center; }.power-station-perspective-item {background: rgba(0, 46, 79, 0.5); }.location {cursor: pointer; }.power-station-perspective-item-text {margin: 0 auto;cursor: pointer; }.power-station-perspective-title {margin-bottom: 3px; } /style2.动态类名 2.1核心代码解释 说明 :class 绑定 :class 是 Vue 提供的一个特性用于绑定动态类名。在这里:class 绑定了一个数组其中包含了两个元素。 数组语法 数组的第一个元素是 power-station-perspective-item-text 这意味着每个 span 元素都会始终应用这个基础类确保基本样式统一。数组的第二个元素是一个对象 { active-power-station-perspective-item-text: isChecked(item.id) }这个对象的键是 active-power-station-perspective-item-text值是一个布尔表达式 isChecked(item.id)。如果 isChecked(item.id) 返回 true则 active-power-station-perspective-item-text 类会被应用到 span 元素上否则不会应用。 :class[power-station-perspective-item-text,{ active-power-station-perspective-item-text: isChecked(item.id) }] 2.2源代码 templatediv classpower-station-perspectivediv classflow-chart-container-itemdiv classpower-station-perspective-title flow-chart-container-item-parent{{ title }}/divdiv v-foritem in buttonGroupsArr:keyitem.idclasspower-station-perspective-item flow-chart-container-item locationspanclasspower-station-perspective-item-textclickclickItem(item.id):class[power-station-perspective-item-text,{ active-power-station-perspective-item-text: isChecked(item.id) }]{{ item.title }}/span/div/div/div /templatescript setup import {ref, onMounted} from vue;const title ref(菜单项); const buttonGroupsArr ref([{title: 按钮1, id: 0},{title: 按钮2, id: 1},{title: 按钮3, id: 2},{title: 按钮4, id: 3},{title: 按钮5, id: 4}, ]);const checkedItem ref(0);const isChecked (param) {return checkedItem.value param; };const clickItem (param) {checkedItem.value param; };onMounted(() {}); /scriptstyle scoped .power-station-perspective{width: 200px; } .flow-chart-container-item-parent {width: 100%;background: linear-gradient(90deg, rgba(0, 136, 234, 0.84) 0%,rgba(31, 38, 83, 0.85) 101.82%); }.flow-chart-container-item {display: grid;text-align: center;padding: 3px 5px 3px 3px;margin-bottom: 3px;align-items: center; }.power-station-perspective-item {background: rgba(0, 46, 79, 0.5); }.location {cursor: pointer; }.power-station-perspective-item-text {margin: 0 auto;cursor: pointer; } .active-power-station-perspective-item-text{color: #cc7e17; } .power-station-perspective-title {margin-bottom: 3px; } /style3.实现效果
http://www.dnsts.com.cn/news/39494.html

相关文章:

  • 北京网站设计的公司价格微软做网页的软件
  • 深圳品牌网站设计专家中国电商网官网
  • 大学网站建设与功能开发域名访问网站的知识
  • 东莞外贸公司网站制作国内最好的网站建设
  • 麻涌网站建设公司厦门论坛网站建设
  • 网站推广是网站建设完成之后的长期工作重庆网站制作外包公司
  • 中国建设网站官方网站外链网址
  • 涪陵做网站前程无忧网广州网站建设类岗位
  • 旅游网站设计报告做网站要服务器吗
  • 广东省建设工程总监扣分查询网站新农村建设的网站
  • 可免费注册的网站关键词搜索量怎么查
  • 企业建站找哪家东莞网站建设及外包
  • 网络公司网站asp红河北京网站建设
  • 徐州建站网站模板企业形象网站用什么语言开发
  • 无锡市滨湖区建设局网站优秀设计师的个人网站
  • php租车网站wordpress如何设置字体大小
  • 西安网站挂标智库建设网站
  • 知名网站定制公司电话手机网站开源
  • 网站建设电子商务wordpress slider设置
  • 合肥网站设计服网站开发整体制作流程
  • 企业网站 优秀重庆怎么站seo
  • 广州网站建设便宜山西网络广告推广
  • 淘宝客必须做网站app制作程序
  • asp.net做三个网站怎样把网站做的更好
  • 网站建设后需要交费吗北京网站报价
  • 电商运营的网站网站建设外包 排名
  • 佛山建站佛山网页设计腾讯企点下载安装
  • 外贸网站适合用数字域名吗怎么制作网站生成图片
  • 全国注册室内设计师网中英文网站用一个域名还是两个域名利于优化
  • wordpress 网站上传怎样能在百度上搜索到自己的店铺