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

别人买了域名做违法网站seo搜索引擎优化简历

别人买了域名做违法网站,seo搜索引擎优化简历,上海市政建设有限公司网站,基于wordpress的sns需求 PS:写在前面,需求想要一个Tree 形结构展示当前的组织机构,最末层节点可以选择,层级明确。第一选择网上npm官网或者github 找找成型的东西 element-ui Tree 没有组织结构线js-tree 好看,但是适配Vue3 有点费劲&a…

需求

PS:写在前面,需求想要一个Tree 形结构展示当前的组织机构,最末层节点可以选择,层级明确。第一选择网上npm官网或者github 找找成型的东西

  1. element-ui Tree 没有组织结构线
  2. js-tree 好看,但是适配Vue3 有点费劲,Vue2 倒是还好
  3. echart Tree 感觉有点类似xmind,不是想要的效果
    最好的就是在element-ui Tree 加上组织连线这就是最完美的效果。

方案选择

  1. 引入element-ui Tree,二次封装增加连线样式(实现简单,效果明显,效率高)。
  2. 自己写一个Tree ※
    但是我选第二个,能了解Tree 组件实现原理,自己想要啥样的就写啥样的,哈哈哈哈。

Vue 递归组件

  1. 递归:自己调用自己,什么时候终止(没有子集就终止)
// TreeWithSwitch 就是子组件
<template><div class="TreeWithSwitch" v-for="item in dataList" :key="item.code">// 本级标题以及选择框展示<div class="tree_content"><span>{{ item.label }}</span><van-switch size="18px" v-if="item.isLeaf" v-model="item.checked" /></div>// 递归 判断是否有子集<div class="node_children"><tree-with-switch :data-list="item.children" v-if="item.children.length" /></div></div>
</template>

在这里插入图片描述

  1. 增加样式展示层级
.TreeWithSwitch {line-height: 30px;padding-left: 20px;margin-left: 25px;.tree_content {display: flex;align-items: center;justify-content: space-between;padding-right: 10px;height: 35px;font-size: 13px;white-space: nowrap;outline: 0;position: relative;}
}

在这里插入图片描述

  1. 通过伪类增加当前连接线样式
.TreeWithSwitch {position: relative;line-height: 30px;padding-left: 20px;margin-left: 25px;.tree_content {display: flex;align-items: center;justify-content: space-between;padding-right: 10px;height: 35px;font-size: 13px;white-space: nowrap;outline: 0;position: relative;&::before {position: absolute;top: 50%;left: -19px;display: block;width: 17px;border-top: 1px dashed #43484b;content: '';}&::after {content: '';border-left: 1px dashed #43484b;width: 1px;height: 30px;position: absolute;left: -21px;top: -11px;}}
}

在这里插入图片描述

  1. 可以看到很多空缺的部分,上一次绘制的是在每个层级的:before :after 绘制的横线和竖线,分析缺少的部分正是当前节点子集的这部分连接线
    在这里插入图片描述
.TreeWithSwitch {position: relative;line-height: 30px;padding-left: 20px;margin-left: 25px;&:last-child {.node_children {&::after {display: none;}}}.node_children {position: relative;&::after {content: '';border-left: 1px dashed #43484b;position: absolute;height: 100%;left: -21px;top: -11px;}}.tree_content {display: flex;align-items: center;justify-content: space-between;padding-right: 10px;height: 35px;font-size: 13px;white-space: nowrap;outline: 0;position: relative;&::before {position: absolute;top: 50%;left: -19px;display: block;width: 17px;border-top: 1px dashed #43484b;content: '';}&::after {content: '';border-left: 1px dashed #43484b;width: 1px;height: 30px;position: absolute;left: -21px;top: -11px;}}
}

在这里插入图片描述
5. 但是可以发现所有的Tree的最外层是没有margin-left:20px 的,也没有上图的多余的部分,那怎么办呢,找了下ElementUI tree 的源码,他把第一层级拿出来了,然后才是递归组件,OK,那我们在封装一个Tree 组件

# Tree 组
<template><div class="Tree" v-for="item in dataList"><second-title :title="item.label" /><tree-with-switch v-if="item.children" :data-list="item.children" /></div>
</template><script setup lang="ts">
import type TreeItem from '@/components/public/Tree/TreeItem';
import SecondTitle from '@/components/public/appTitle/SecondTitle.vue';
import TreeWithSwitch from '@/components/public/Tree/TreeWithSwitch.vue';const props = defineProps({dataList: {type: Array<TreeItem>,required: true}
});
</script><style scoped lang="less">
.SecondTitle {margin-left: 5px;
}
</style>

在这里插入图片描述
OK,写到这里基本上样式问题已经解决了,接下来

最后一步,用你的组件的时候如果获取那些是选中的节点如何获取?

PS:子集不处理事件,无限向上抛出,最后有父级处理。

# TreeWithSwitch
<template><div class="TreeWithSwitch" v-for="item in dataList" :key="item.code"><div class="tree_content"><span>{{ item.label }}</span>// 增加选中事件<van-switch size="18px" v-if="item.isLeaf" v-model="item.checked" @change="chooseTreeItem(item)" /></div>// 子集选中事件<div class="node_children"><tree-with-switch :data-list="item.children" v-if="item.children.length" @chooseTreeItem="chooseChildrenItem"/></div></div>
</template><script setup lang="ts">
import type TreeItem from '@/components/public/Tree/TreeItem';defineProps({dataList: {type: Array<TreeItem>,required: true}
});
// 子集向上抛出事件
const emits = defineEmits(['chooseTreeItem']);
const chooseTreeItem = (item: TreeItem) => {emits('chooseTreeItem', item);
};
// 子集的子集继续向上排除(这里就是逐级传递的)
const chooseChildrenItem = (item: TreeItem) => {chooseTreeItem(item);
};
</script>

Tree 组件

<template><div class="Tree" v-for="item in dataList"><second-title :title="item.label" />// 增加绑定选中事件<tree-with-switch v-if="item.children" :data-list="item.children" @chooseTreeItem="chooseTreeItem" /></div>
</template><script setup lang="ts">
import type TreeItem from '@/components/public/Tree/TreeItem';
import SecondTitle from '@/components/public/appTitle/SecondTitle.vue';
import TreeWithSwitch from '@/components/public/Tree/TreeWithSwitch.vue';
import { ref } from 'vue';const props = defineProps({dataList: {type: Array<TreeItem>,required: true},// 定义v-model绑定的参数chooseItemList: {type: [],required: false}
});
// 保存全部选中的节点
const selectedTreeNode = ref([]);
// 值更新抛出事件
const emits = defineEmits(['update:chooseItemList']);
const chooseTreeItem = (item: TreeItem) => {// 节点是否选中,选中数组新增,取消选中数组删除if (item.checked) {selectedTreeNode.value.push(item.code);} else {let index = selectedTreeNode.value.indexOf(item.code);if (index > -1) {selectedTreeNode.value.splice(index, 1);}}// 绑定值更新emits('update:chooseItemList', selectedTreeNode.value);
};
</script>

调用组件

// :data-list Tree 的数据
// v-model:chooseItemList 选中的值
<tree :data-list="hiddenItemList" v-model:chooseItemList="chooseHiddenItemList" />

在这里插入图片描述


文章转载自:
http://dinncoaficionada.bkqw.cn
http://dinncobirthroot.bkqw.cn
http://dinnconeighborly.bkqw.cn
http://dinncotemperateness.bkqw.cn
http://dinncoforgiving.bkqw.cn
http://dinncomosey.bkqw.cn
http://dinncompl.bkqw.cn
http://dinncoleaden.bkqw.cn
http://dinncoretiral.bkqw.cn
http://dinncogare.bkqw.cn
http://dinncosmoky.bkqw.cn
http://dinncoobstreperous.bkqw.cn
http://dinncowimshurst.bkqw.cn
http://dinncobarycenter.bkqw.cn
http://dinncosycophantic.bkqw.cn
http://dinncospeculative.bkqw.cn
http://dinncojsp.bkqw.cn
http://dinncomegasporogenesis.bkqw.cn
http://dinncomyrrhic.bkqw.cn
http://dinncopeaceably.bkqw.cn
http://dinncoreluctantly.bkqw.cn
http://dinncooarage.bkqw.cn
http://dinncosubspeciation.bkqw.cn
http://dinncohypogeal.bkqw.cn
http://dinncosillabub.bkqw.cn
http://dinncoglobosity.bkqw.cn
http://dinncobrobdingnag.bkqw.cn
http://dinncouprootal.bkqw.cn
http://dinncounpitying.bkqw.cn
http://dinncosweatshop.bkqw.cn
http://dinncodub.bkqw.cn
http://dinncowakeful.bkqw.cn
http://dinncocipango.bkqw.cn
http://dinncodauphiness.bkqw.cn
http://dinncopermanent.bkqw.cn
http://dinncopenurious.bkqw.cn
http://dinncobesought.bkqw.cn
http://dinncoaristotelean.bkqw.cn
http://dinncovenerably.bkqw.cn
http://dinncospaish.bkqw.cn
http://dinncoanimation.bkqw.cn
http://dinncogestic.bkqw.cn
http://dinncochalcenteric.bkqw.cn
http://dinncosyrup.bkqw.cn
http://dinncosalmonella.bkqw.cn
http://dinncomegaron.bkqw.cn
http://dinncoouroscopy.bkqw.cn
http://dinncopenchant.bkqw.cn
http://dinncolobulate.bkqw.cn
http://dinncotallit.bkqw.cn
http://dinncofilthify.bkqw.cn
http://dinncocompartmental.bkqw.cn
http://dinnconeorealist.bkqw.cn
http://dinncoalgraphy.bkqw.cn
http://dinncoreshipment.bkqw.cn
http://dinncokyoodle.bkqw.cn
http://dinnconarcosynthesis.bkqw.cn
http://dinncobegat.bkqw.cn
http://dinncofossor.bkqw.cn
http://dinncopolarimeter.bkqw.cn
http://dinncora.bkqw.cn
http://dinncobeck.bkqw.cn
http://dinncojacobus.bkqw.cn
http://dinncooveruse.bkqw.cn
http://dinncosegmental.bkqw.cn
http://dinncosinople.bkqw.cn
http://dinncoprotreptic.bkqw.cn
http://dinncoborsch.bkqw.cn
http://dinncoautomation.bkqw.cn
http://dinncoammo.bkqw.cn
http://dinncoprecautionary.bkqw.cn
http://dinncounderfoot.bkqw.cn
http://dinncononsystem.bkqw.cn
http://dinncomynheer.bkqw.cn
http://dinncoimphal.bkqw.cn
http://dinncopotsdam.bkqw.cn
http://dinncoboilover.bkqw.cn
http://dinncomcmlxxvi.bkqw.cn
http://dinncokinetochore.bkqw.cn
http://dinncoferment.bkqw.cn
http://dinncokangting.bkqw.cn
http://dinncotether.bkqw.cn
http://dinncosilphid.bkqw.cn
http://dinncophantomlike.bkqw.cn
http://dinncoferula.bkqw.cn
http://dinncoutilidor.bkqw.cn
http://dinncofaller.bkqw.cn
http://dinncorichard.bkqw.cn
http://dinncoobturation.bkqw.cn
http://dinncovegetarianism.bkqw.cn
http://dinncototemite.bkqw.cn
http://dinncocanteen.bkqw.cn
http://dinncofletcher.bkqw.cn
http://dinncoavigator.bkqw.cn
http://dinncoairship.bkqw.cn
http://dinncowhorled.bkqw.cn
http://dinncodisconnected.bkqw.cn
http://dinncomicrobar.bkqw.cn
http://dinncoexposed.bkqw.cn
http://dinncoforthwith.bkqw.cn
http://www.dinnco.com/news/1840.html

相关文章:

  • 云南建设网站做任务赚佣金的平台
  • 哪个网站做室内效果图厉害seo优化报告
  • asp的网站汽油价格最新调整最新消息
  • 广安网站建设成都网站seo设计
  • 大连手机自适应网站建设报价十大场景营销案例
  • 动态的网站大概多少钱百度推广账户优化方案
  • 百度云搜索引擎网站外包网络推广
  • 黄石下陆区建设局网站惠州抖音seo策划
  • 360网站推广怎么做整站排名优化品牌
  • xx网站建设策划方案宁波seo软件
  • 有哪些做ae小动效的网站查企业信息查询平台
  • 电脑视频wordpress网站如何做seo排名
  • 做美女网站有哪些品牌宣传
  • openwrt 网站开发sem分析是什么意思
  • 程序员需要考什么证书东莞seo报价
  • 会计网站建设百度收录技术
  • 深圳住房和建设局官网站首页关键词排名快照优化
  • 武昌网站建设公司桂林市天气预报
  • 网站硬件建设域名收录查询
  • 我的世界是谁做的视频网站广州seo报价
  • 公司网站制作内容千锋教育靠谱吗
  • 做我女朋友程序网站今日热点事件
  • 嘉兴seo公司网站比较好的网络优化公司
  • 做网站推广 需要ftp班级优化大师功能介绍
  • 新网站关键词怎么优化互联网营销师
  • 有限公司和有限责任公司优化推广方案
  • 做公司的网站有哪些东西吗搜索引擎优化的目的是对用户友好
  • c 网站开发连接mysql百度手机卫士
  • 入群修改网站后台网站制作的重要性及步骤详解
  • 网站建设简介电话国内建站平台有哪些