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

wordpress theme 插件长沙seo培训

wordpress theme 插件,长沙seo培训,做产品宣传网站多少钱,个人简历样本范文需求&#xff1a;顶部栏有切换功能&#xff0c;内容区域随顶部切换而变化 目录 实现效果实现代码使用示例在线预览 实现效果 如下 实现代码 组件代码 MoTab.vue <template><div class"mo-tab"><divv-for"item in options"class"m…

需求:顶部栏有切换功能,内容区域随顶部切换而变化

目录

    • 实现效果
    • 实现代码
    • 使用示例
    • 在线预览

实现效果

如下
在这里插入图片描述

实现代码

组件代码 MoTab.vue

<template><div class="mo-tab"><divv-for="item in options"class="mo-tab__item":class="{'mo-tab__item--active': item.value == currentValue,}"@click="handleChange(item.value)">{{ item.label }}</div></div>
</template><script>
// created at 2024-05-08
export default {name: "MoTab",props: {// 选项// eg: [{label: '显示值', value: '真实值'}]options: {type: Array,default: () => {return [];},},// 选定值value: {type: String,default: "",},},computed: {currentValue: {get() {return this.value;},set(val) {this.$emit("input", val);},},},methods: {handleChange(value) {this.currentValue = value;this.$emit("on-change", value);},},
};
</script><style lang="less">
.mo-tab {display: flex;margin-left: 20px;
}.mo-tab__item {position: relative;padding: 0 10px;line-height: 30px;font-size: 13px;color: #666;cursor: pointer;
}.mo-tab__item:hover,
.mo-tab__item--active {color: #111;
}.mo-tab__item--active::before {content: "";position: absolute;height: 2px;width: 16px;left: 50%;transform: translateX(-50%);bottom: 0;background-color: #6833cf;
}</style>

使用示例

<template><div class="app"><MoTab:options="options"v-model="value"@on-change="handleValueChange"></MoTab><div class="content"><p>选定真实值: {{ value }}</p><p>选定显示值: {{ currentLabel }}</p></div></div>
</template><script>
// created at 2023-03-31
import MoTab from "./components/MoTab/MoTab.vue";export default {name: "App",props: {},components: {MoTab,},data() {return {// 选定值value: "1",// 选项options: [{value: "1",label: "蔬菜",},{value: "2",label: "肉类",},{value: "3",label: "水果",},],};},computed: {currentLabel() {return this.options.find((item) => item.value === this.value)?.label;},},methods: {handleValueChange(value) {console.log("value change: ", value);},},created() {},
};
</script><style lang="less">
.app {width: 200px;margin: 0 auto;border: 1px solid #ccc;padding: 20px;
}.content {margin-top: 20px;border-top: 1px solid #ccc;
}
</style>

在线预览

https://mouday.github.io/vue-demo/packages/vue-mo-tab/dist/index.html

http://www.fp688.cn/news/143404.html

相关文章:

  • 二手网站哪些做的比较好seo 工具分析
  • 网站开发与维护的岗位特点职责国内搜索引擎有哪些
  • 电商兼职网站开发苏州网站建设优化
  • 网站如何做的有特色seo企业优化方案
  • 加强网站建设工作磁力链
  • 做网站的学校什么是论坛推广
  • 做电影网站哪个服务器好怎么从网上找客户
  • 个人博客登录宁德seo
  • 建一个pc网站需要多少钱网络推广网站排行榜
  • 那个合作网站做360推广比较好域名检测工具
  • 青岛黄岛区建设工程管理局网站电商网站网址
  • 毕业设计做app还是做网站百度seo泛解析代发排名
  • 网站建设网站开发淘宝seo搜索排名优化
  • 常见的网站结构有哪些火星时代教育培训机构怎么样
  • 西双版纳建设厅网站9 1短视频安装
  • 郑州网站建设公司电话多少北京优化seo公司
  • 商务网站建设的一般流程是什么杭州排名推广
  • 网站中怎么做图片的变换seo英文
  • 做学校网站素材图片素材网站seo排名优化软件
  • 松江区做网站百度seo教程视频
  • 学做卤味视频网站厦门百度推广排名优化
  • 域名注册人怎么查询重庆seo杨洋
  • 怎样找素材做网站品牌传播策划方案
  • 长春网站推广优化公司关键词seo公司推荐
  • 宣传类的网站有哪些内容厦门seo优化多少钱
  • 如何与其他网站做友情链接知乎推广渠道
  • 网站建设公司网站模板下载seo工作前景如何
  • 深圳招聘网站百度网盘app
  • 镇江地区做网站的公司新闻稿发布
  • 学会网页设计找什么工作seo推广培训费用