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

盐城市城乡建设局网站做网站用什么编程软件

盐城市城乡建设局网站,做网站用什么编程软件,科技有限公司英文,池州网站建设价格分享-2023年高级前端进阶:前端登顶之巅-最全面的前端知识点总结站点 *分享一个使用比较久的🪜 技术框架公司的选型:uni-app uni-ui vue3 vite4 ts 需求分析:微信小程序-uni-ui内容 1、创建一个自定义的下拉,支持多…

分享-2023年高级前端进阶:前端登顶之巅-最全面的前端知识点总结站点

*分享一个使用比较久的🪜

技术框架公司的选型:uni-app + uni-ui + vue3 + vite4 + ts

需求分析:微信小程序-uni-ui内容
1、创建一个自定义的下拉,支持多个内容的同时多选
2、定义好出入参数,支持回显内容等
3、绑定对应的v-model数据响应

在这里插入图片描述

1、代码信息
<template><view tabindex="1" ref="customSelectRef" class="uni-select" @click.stop="handleClickDiv"><view><template v-if="modelLabel.length"><span class="custom-tag" :key="index" v-for="(item, index) in modelLabel"><span>{{ item }}</span></span></template><span class="custom-tag" v-if="modelLabel.length && checkList.length - maxLength > 0">+ {{ checkList.length - maxLength }}</span><span v-if="!modelLabel.length" class="cus_placeholder">{{ placeholder }}</span><imgclass="icon-delete"v-if="modelLabel.length"@click.stop="handleRemove":src="'../../static/icons/delete.png'"/></view><transition><view class="cus_select_background" ref="cusSelectDropdown" v-if="isShowDropdown" @click="handleMemory"><view class="cus_tabs" :key="index" v-for="(item, index) in cusDataListChecked"><template v-if="item.children"><view class="cus_tabs_title">{{ item.text }}</view><view class="cus_tabs_body"><uni-data-checkboxmode="tag":multiple="multiple"v-model="item.checkList":localdata="item.children"@change="(val) => handleCheckedChange(val, item)"></uni-data-checkbox></view></template></view></view></transition><view v-if="isShowDropdown" class="custom_mask"></view></view>
</template><script setup lang="ts">
import { watch } from "vue";
import { toRaw } from "vue";
import { ref, onMounted, nextTick, onBeforeMount } from "vue";const props = withDefaults(defineProps<{dataSource: any;modelValue?: any;placeholder?: string;multiple?: boolean;maxLength?: number;}>(),{multiple: true,dataSource: [],modelValue: [],maxLength: 3,placeholder: "请选择",}
);const emit = defineEmits(["update:modelValue", 'change']);const customSelectRef = ref();const cusSelectDropdown = ref();const modelLabel = ref<Record<string, any>[]>([]);const checkList = ref<string[]>([]);const cusDataListChecked = ref<Record<string, any>[]>([]);const isShowDropdown = ref<boolean>(false);const isShowDownMemory = ref<boolean>(false);const handleClickDiv = () => {isShowDropdown.value = isShowDownMemory.value ? true : !isShowDropdown.value;isShowDownMemory.value = false;
};const handleMemory = () => {isShowDownMemory.value = true;
};const handleCheckedChange = (e: Record<string, any>, row: Record<string, any>) => {const { data } = e.detail;row.checkLabel = data.map((opt) => opt.text);getModelVal();
};const getModelVal = () => {const newValue = toRaw(cusDataListChecked.value);const newLabel = newValue.map((item) => item.checkLabel);const newModelVal = newValue.map((item) => item.checkList);const deconstructLabel = newLabel?.flat();const deconstructVal = newModelVal?.flat();modelLabel.value = deconstructLabel.slice(0, props.maxLength);checkList.value = deconstructVal;emit("update:modelValue", newModelVal);
};const handleRemove = (e) => {modelLabel.value = [];checkList.value = [];if (isShowDropdown.value) {isShowDropdown.value = false;}if (props.multiple) {cusDataListChecked.value = addCheckProperties(props.dataSource);}emit("update:modelValue", []);
};const addCheckProperties = (treeData) => {let result = [];result = JSON.parse(JSON.stringify(treeData));result.forEach((node) => {const child = node.children;node.checkList = [];node.checkLabel = [];if (child && child.length > 0) {addCheckProperties(child);}});return result;
};const findTreeChecked = (treeData) => {const newLabel = [];const val = toRaw(props.modelValue);treeData.forEach((node, index) => {if (node.children?.length) {const child = node.children;const bool = child.some((opt) => {const isExist = val[index] && val[index].includes(opt.value);isExist ? newLabel.push(opt.text) : void null;return isExist;});if (bool) {node.checkLabel = newLabel;node.checkList = val[index];}}});return treeData;
};watch(isShowDropdown, (newVal) => {emit('change', newVal, props.modelValue)
})onBeforeMount(() => {if (props.multiple) {cusDataListChecked.value = addCheckProperties(props.dataSource);}
});onMounted(async () => {await nextTick();if (props.multiple && props.modelValue.length) {cusDataListChecked.value = findTreeChecked(cusDataListChecked.value);getModelVal();}
});
</script><style lang="scss" scoped>
.uni-select {font-size: 14px;border: 1px solid #e5e5e5;box-sizing: border-box;border-radius: 4px;padding: 0 5px 0 10px;position: relative;display: flex;user-select: none;flex-direction: row;align-items: center;border-bottom: solid 1px #e5e5e5;width: 100%;flex: 1;height: 35px;position: relative;
}.cus_placeholder {color: #6a6a6a;font-size: 12px;
}.icon-delete {position: absolute;width: 18px;height: 18px;right: 5px;margin-top: 3.5px;z-index: 10;
}.cus_select_background {width: 95vw;max-height: 260px;box-sizing: border-box;border-radius: 4px;font-size: 13px;color: #606266;background: #ffffff;border: 1px solid #e4e7ed;position: absolute;top: 40px;left: 0px;padding: 5px 8px;z-index: 10;
}.cus_tabs {margin-bottom: 8px;.cus_tabs_title {font-weight: 600;margin-bottom: 4px;}.cus_tabs_body {margin-left: 12px;}
}.custom-tag {color: #909399;display: inline-flex;justify-content: center;align-items: center;height: 24px;padding: 0 9px;line-height: 1;border-radius: 4px;white-space: nowrap;font-size: 13px;margin-right: 5px;background-color: #f0f2f5;
}.custom_mask {position: fixed;top: 0;bottom: 0;left: 0;right: 0;z-index: 1;display: flex;justify-content: center;align-items: center;
}
</style>
2、使用api介绍

1、树形结构入参:dataSource=[{ ext: "服务器状态", children: [{ text: "在线", value: 0}]}]
2、标签引用:<ivuSelect :maxLength="2" ref="ivuSelectRef" v-model="customSelect" :dataSource="deviceDataList" style="width: 100%; margin-left: 5px" />
3、相关api说明文档在文章底部

参数说明类型默认值必填项
dataSource[{}]-label,value;树形结构Array[][]
modelValue当前选中项内容Array[]
placeholder输入框内容String请输入
multiple是否开启多选Booleanfalse
maxLength输入框最大标签长度Number3

文章转载自:
http://button.hjyw.cn
http://cyclery.hjyw.cn
http://filiate.hjyw.cn
http://semifluid.hjyw.cn
http://oppositely.hjyw.cn
http://mna.hjyw.cn
http://supermart.hjyw.cn
http://israelitic.hjyw.cn
http://arthurian.hjyw.cn
http://cambism.hjyw.cn
http://agrarian.hjyw.cn
http://litteratrice.hjyw.cn
http://infieldsman.hjyw.cn
http://inotropic.hjyw.cn
http://capote.hjyw.cn
http://screwworm.hjyw.cn
http://penultimate.hjyw.cn
http://chlorpicrin.hjyw.cn
http://yvr.hjyw.cn
http://basel.hjyw.cn
http://antipruritic.hjyw.cn
http://cobweb.hjyw.cn
http://notionalist.hjyw.cn
http://sulfuret.hjyw.cn
http://profane.hjyw.cn
http://acknowledgment.hjyw.cn
http://herald.hjyw.cn
http://zygomorphic.hjyw.cn
http://sateen.hjyw.cn
http://uncloister.hjyw.cn
http://expressible.hjyw.cn
http://unaptly.hjyw.cn
http://coonskin.hjyw.cn
http://breeder.hjyw.cn
http://moshav.hjyw.cn
http://unsccur.hjyw.cn
http://rearmost.hjyw.cn
http://pseudoglobulin.hjyw.cn
http://hofei.hjyw.cn
http://electioneeringa.hjyw.cn
http://uncord.hjyw.cn
http://malarious.hjyw.cn
http://right.hjyw.cn
http://nacrite.hjyw.cn
http://surplus.hjyw.cn
http://massif.hjyw.cn
http://sakellarides.hjyw.cn
http://vitruvian.hjyw.cn
http://jealousy.hjyw.cn
http://fluoridate.hjyw.cn
http://grahamite.hjyw.cn
http://happenstantial.hjyw.cn
http://bunchiness.hjyw.cn
http://nebn.hjyw.cn
http://foolhardy.hjyw.cn
http://cantoris.hjyw.cn
http://archidiaconate.hjyw.cn
http://obscurantic.hjyw.cn
http://allophane.hjyw.cn
http://blockbusting.hjyw.cn
http://yulan.hjyw.cn
http://carices.hjyw.cn
http://obtrusive.hjyw.cn
http://naugahyde.hjyw.cn
http://terrazzo.hjyw.cn
http://cheapshit.hjyw.cn
http://perennial.hjyw.cn
http://nanette.hjyw.cn
http://binoculars.hjyw.cn
http://urial.hjyw.cn
http://technophobia.hjyw.cn
http://during.hjyw.cn
http://keyman.hjyw.cn
http://october.hjyw.cn
http://uncompensated.hjyw.cn
http://interoffice.hjyw.cn
http://cutch.hjyw.cn
http://amorously.hjyw.cn
http://ransomer.hjyw.cn
http://ungifted.hjyw.cn
http://athrill.hjyw.cn
http://pier.hjyw.cn
http://delouser.hjyw.cn
http://carbamyl.hjyw.cn
http://gull.hjyw.cn
http://rearrangement.hjyw.cn
http://transworld.hjyw.cn
http://stotinka.hjyw.cn
http://desmotropism.hjyw.cn
http://joltily.hjyw.cn
http://phytoclimatology.hjyw.cn
http://doomwatcher.hjyw.cn
http://roul.hjyw.cn
http://test.hjyw.cn
http://darksome.hjyw.cn
http://franchisee.hjyw.cn
http://appetent.hjyw.cn
http://antiblack.hjyw.cn
http://germanic.hjyw.cn
http://dizziness.hjyw.cn
http://www.dt0577.cn/news/62837.html

相关文章:

  • 好123上网从这里开始360优化大师安卓手机版下载安装
  • 有做公司网站的吗seo如何优化图片
  • 网站建设的基本费用中国培训网官网
  • 成都网站建设公uc推广登录入口
  • 湖北企业响应式网站建设价位如何推广网站
  • 肇庆做网站设计5188关键词挖掘
  • 网站扁平化廊坊seo外包
  • 网站开发常用单词百度知道首页网
  • 西安市建设和住房保障局网站免费外链发布平台
  • 网页设计制作报价郑州seo代理外包公司
  • qq网站推广代码职业培训热门行业
  • 雄安做网站要多少钱seo培训一对一
  • 湘潭做网站 都来磐石网络友情链接实例
  • 网站备案手续企业推广策略
  • wordpress说说分类seo外包公司兴田德润
  • 专业企业网站建设百度咨询电话人工台
  • 做网站是什么行业免费网站推广产品
  • 网站建设工作流程html网络市场的四大特点
  • seo网站优化经理百度服务电话6988
  • 河北省政府网站集约化建设优量汇广告平台
  • 响应的网站长沙seo优化公司
  • 网站建设网络推广方案查询网站服务器
  • php动态网站开发课后经典软文
  • 苏州公司做变更网站上海网络推广服务
  • 公司做网站的价格几千元营销型网站设计
  • 专门做美剧的网站全网推广平台
  • 域名跟空间都有了怎么做网站万物识别扫一扫
  • 定制wordpress后台广州seo代理计费
  • 网站的制作公司网络营销一个月能挣多少钱
  • 后台管理网站建设网站优化外包费用