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

网站文件夹怎么做校园推广的方式有哪些

网站文件夹怎么做,校园推广的方式有哪些,保定最新消息发布,做英文网站2014树状数据展示,可以点击item 将点击数据给父组件 ,满足自己需求。不喜勿喷,很简单可以根据自己需求改哈,不要问,点赞收藏就好。其实可以和上一篇文章uni app 自定义 带popup弹窗的input组件-CSDN博客结合使用&#xff…

树状数据展示,可以点击item 将点击数据给父组件  ,满足自己需求。不喜勿喷,很简单可以根据自己需求改哈,不要问,点赞收藏就好。其实可以和上一篇文章uni app 自定义 带popup弹窗的input组件-CSDN博客结合使用,做成输入框带popup展示树状结构数据

<template><view><view v-for="(node, index) in treeData" :key="node.id"><view v-if="!node.ishow"><view v-if="uselast"><view v-if="node.children.length > 0"><view :style="'margin-left:'+(zjflag*30+32)+'rpx;'" class="item_name_ef"@tap.stop.prevent="item_click" :data-set="node" :id="index"><view><text v-if="node.children":style="'color:'+colors[zjflag]+';margin-right:10rpx'">{{title[zjflag]}}</text>{{ node.name }}</view><text style="margin-left: 32rpx;color:#f00" v-if="node.children&&node.children.length > 0"@tap.stop.prevent="open_item(index)">{{image[node.isopen?0:1]}}</text></view></view><view v-else><view :style="'margin-left:'+(zjflag*30+32)+'rpx;'" class="item_name"@tap.stop.preventclick="item_click" :data-set="node" :id="index"><view><text v-if="node.children":style="'color:'+colors[zjflag]+';margin-right:10rpx'">{{title[zjflag]}}</text>{{ node.name}}</view><text style="margin-left: 32rpx;color:#f00" v-if="node.children&&node.children.length > 0"@tap.stop.prevent="open_item(index)">{{image[node.isopen?0:1]}}</text></view></view></view><view v-else><view :style="'margin-left:'+(zjflag*30+32)+'rpx;'" class="item_name" @tap.stop.prevent="item_click":data-set="node" :id="index"><view><text v-if="node.children":style="'color:'+colors[zjflag]+';margin-right:10rpx'">{{title[zjflag]}}</text>{{ node.name }}</view><text style="margin-left: 32rpx;color:#f00" v-if="node.children&&node.children.length > 0"@tap.stop.prevent="open_item(index)">{{image[node.isopen?0:1]}}</text></view></view></view><view v-if="node.isopen"><TreeData v-if="node.children && node.children.length > 0" :tree-data="node.children"@callBack="mycallback" :uselast="uselast" :zjflag="zjflag+1" /></view></view></view>
</template><script>import TreeData from './TreeData.vue';export default {components: {TreeData},name: 'TreeData',props: {treeData: {type: Array,required: true,},uselast: {type: Boolean,default: false},callback: {type: String,default: ''},showkey: {type: String,default: ''},zjflag: {type: Number,default: 0}},data() {return {title: ["①", "②", "③", "④", "⑤", "⑥", "⑦", "⑧", "⑨", "⑩"],// image: ["🔺", "🔻"]image: ["关", "开"],colors: ['#ff0', '#f00', '#00f', '#0ff', '#f0f', '#0f0'],}},methods: {item_click: function(e) {// console.log("item_click", JSON.stringify(item.currentTarget.dataset.set))let id = e.currentTarget.idlet item = e.currentTarget.dataset.setif (this.uselast) {if (item.children.length == 0) {this.$emit('callBack', {mydetail: item});} else {this.treeData[id].isopen = !this.treeData[id].isopen}} else {this.$emit('callBack', {mydetail: item});}// if (item.isopen) {// 	this.treeData[id].isopen = false// } else {// 	this.treeData[id].isopen = true// }this.$forceUpdate()},open_item: function(id) {this.treeData[id].isopen = !this.treeData[id].isopenthis.$forceUpdate()},mycallback: function(item) {this.$emit('callBack', {mydetail: item});}},};
</script><style lang="scss" scoped>@function tovmin($rpx) {//$rpx为需要转换的字号@return #{$rpx * 100 / 750}vmin;}.item_name {display: flex;justify-content: space-between;font-size: 28;padding-top: 5rpx;padding-bottom: 5rpx;flex: 1;min-height: tovmin(80);align-items: center;text-align: left;margin-right: tovmin(64);color: #333;font-weight: 600;overflow-y: auto;overflow-x: scroll;border-bottom: solid #efefef 2rpx;white-space: normal;word-break: break-all;word-wrap: break-word;}.item_name_ef {font-size: 28;padding-top: 5rpx;padding-bottom: 5rpx;flex: 1;min-height: tovmin(80);display: flex;justify-content: space-between;align-items: center;text-align: left;margin-right: tovmin(64);color: #999;font-weight: 600;overflow-y: auto;overflow-x: scroll;border-bottom: solid #efefef 2rpx;white-space: normal;word-break: break-all;word-wrap: break-word;}
</style>

讲一下 

        treeData 树状数据

        uselast  只能使用末级

        showkey  列表要展示的字段

        zjflag        树状结构第几层默认0开始

使用  在父组件

引用组件

import TreeNode from './TreeNode.vue';

components: {
            
            TreeNode
        },

    <tree-node :tree-data="treeData" uselast="true" @callBack="tree_node_back"></tree-node>

treeData: [{
                        id: 1,
                        name: '节点1',
                        ishow: false,
                        isopen: true,
                        children: [{
                                id: 2,
                                name: '子1-节点1',
                                ishow: false,
                                isopen: true,
                                children: []
                            },
                            {
                                id: 3,
                                name: '子2-节点1',
                                ishow: false,
                                isopen: true,
                                children: [{
                                    id: 4,
                                    name: '孙1-子2-节点1',
                                    ishow: false,
                                    isopen: true,
                                    children: []
                                }]
                            },
                        ],
                    },
                    {
                        id: 5,
                        name: '节点2',
                        ishow: false,
                        isopen: true,
                        children: [{
                                id: 6,
                                name: '子1-节点2',
                                ishow: false,
                                isopen: true,
                                children: [{
                                    id: 8,
                                    name: '孙1-子1-节点2',
                                    ishow: false,
                                    isopen: true,
                                    children: [{
                                        id: 8,
                                        name: '重1-孙1-子1-节点2',
                                        ishow: false,
                                        isopen: true,
                                        children: [{
                                            id: 9,
                                            name: '曾1-重1-孙1-子1-节点2',
                                            ishow: false,
                                            isopen: true,
                                            children: [{
                                                id: 9,
                                                name: '僧1-曾1-重1-孙1-子1-节点2',
                                                ishow: false,
                                                isopen: true,
                                                children: []
                                            }]
                                        }]
                                    }]
                                }]
                            },
                            {
                                id: 7,
                                name: '子2-节点2',
                                ishow: false,
                                isopen: true,
                                children: [{
                                    id: 8,
                                    name: '孙1-子2-节点2',
                                    ishow: false,
                                    isopen: true,
                                    children: [{
                                        id: 8,
                                        name: '重1-孙1-子2-节点2',
                                        ishow: false,
                                        isopen: true,
                                        children: [{
                                            id: 9,
                                            name: '曾1-重1-孙1-子2-节点2',
                                            ishow: false,
                                            isopen: true,
                                            children: [{
                                                id: 9,
                                                name: '僧1-曾1-重1-孙1-子2-节点2',
                                                ishow: false,
                                                isopen: true,
                                                children: []
                                            }]
                                        }]
                                    }]
                                }]
                            },
                        ],
                    },

                ],

    tree_node_back: function(e) {
                if (e.mydetail) {
                    this.tree_node_back(e.mydetail)

                } else {
                    console.log("tree_node_back=222==", JSON.stringify(e))
                }

            },

注意  treedata 中  isshow 是翻着的 false 展示  true 隐藏  isopen 是正常  false 关闭  true 展开

http://www.hengruixuexiao.com/news/29679.html

相关文章:

  • 张家港做网站收费标准管理培训班
  • java如何做网站的教程的磁力搜索引擎
  • 网站建设优化外包无忧seo博客
  • 一 网站建设方案中国seo公司
  • 扬州门户网站开发公司买了500元黑科技引流靠谱吗
  • 老虎淘客系统可以做网站吗长春视频剪辑培训机构
  • 太原搭建网站的公司百度指数需求图谱
  • 公司做网站怎么做百度网盘搜索引擎官方入口
  • 做公司网站需要注意哪些网络营销这个专业怎么样
  • 山东省疫情防控政策西安优化seo托管
  • 自动生成网页的工具seo 优化
  • 网站代码组件武汉千锋教育培训机构怎么样
  • it培训机构包就业是啥套路福州seo博客
  • 天津设计网站公司最火的推广平台
  • 重庆seo优搜狗seo怎么做
  • 代加工厂都不做网站百度推广账户优化方案
  • 城乡建设官方网站百度收录网站要多久
  • 国外做问卷网站好seo短视频
  • 网站开发强制使用急速内核搜索引擎收录查询工具
  • 导游网站如何建设的优量汇广告平台
  • 2345网址导航官网下载安装seo服务哪家好
  • 物流网站怎么做的郑州seo哪家好
  • 用php做医药网站开题报告今日热搜头条
  • 商城网站支付端怎么做百度大搜推广开户
  • 企业网站banner大图搜索关键词怎么让排名靠前
  • 上海网站建设管理今日国际新闻头条15条简短
  • 环境保护部网站查询建设项目免费发布广告信息平台
  • wordpress reset api优化大师手机版
  • pc网站开发获取位置免费seo优化工具
  • app开发公司重庆seo外包顾问