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

网站建设从零开始 教程it培训机构排名前十

网站建设从零开始 教程,it培训机构排名前十,相亲网站建设策划书范文,WordPress发表心情19vue3实战-----菜单子树的展示 1.实现目标2.实现思路3.实现步骤3.1新建config配置文件3.2封装组件3.3使用组件 1.实现目标 如上,以上效果的难点是“在表格里面实现树形结构”。可以用element-plus框架中的table作为辅助: 可以自己查看文档了解怎么使用。 2.实现思路 上面的…

19vue3实战-----菜单子树的展示

  • 1.实现目标
  • 2.实现思路
  • 3.实现步骤
    • 3.1新建config配置文件
    • 3.2封装组件
    • 3.3使用组件

1.实现目标

在这里插入图片描述
如上,以上效果的难点是“在表格里面实现树形结构”。可以用element-plus框架中的table作为辅助:
在这里插入图片描述
可以自己查看文档了解怎么使用。

2.实现思路

上面的效果不难实现,无非就是搭建界面。这里我不用常规方法“一个一个页面搭建”,而是用之前写的文章https://blog.csdn.net/fageaaa/article/details/145572470中的方法--------通过配置生成页面。

3.实现步骤

3.1新建config配置文件

在menu文件夹下新建config配置文件:
在这里插入图片描述
menu/config/content.config.ts:

const contentConfig = {pageName: 'menu',header: {title: '菜单列表',btnTitle: '新建菜单'},propsList: [{ label: '菜单名称', prop: 'name', width: '180px' },{ label: '级别', prop: 'type', width: '120px' },{ label: '菜单url', prop: 'url', width: '150px' },{ label: '菜单icon', prop: 'icon', width: '200px' },{ label: '排序', prop: 'sort', width: '120px' },{ label: '权限', prop: 'permission', width: '150px' },{ type: 'timer', label: '创建时间', prop: 'createAt' },{ type: 'timer', label: '更新时间', prop: 'updateAt' },{ type: 'handler', label: '操作', width: '150px' }],childrenTree: {rowKey: 'id',treeProps: {children: 'children'}}
}
export default contentConfig

3.2封装组件

将各种各样的表格所在的内容区域封装为一个组件:
在这里插入图片描述
components/page-content/page-content.vue:

<template><div class="content"><div class="header"><h3 class="title">{{ contentConfig?.header?.title ?? '数据列表' }}</h3><el-button type="primary" @click="handleNewUserClick">{{ contentConfig?.header?.btnTitle ?? '新建数据' }}</el-button></div><div class="table"><el-table:data="pageList"borderstyle="width: 100%"v-bind="contentConfig.childrenTree"><template v-for="item in contentConfig.propsList" :key="item.prop"><template v-if="item.type === 'timer'"><el-table-column align="center" v-bind="item"><template #default="scope">{{ formatUTC(scope.row[item.prop]) }}</template></el-table-column></template><template v-else-if="item.type === 'handler'"><el-table-column align="center" v-bind="item"><template #default="scope"><el-buttonsize="small"icon="Edit"type="primary"text@click="handleEditBtnClick(scope.row)">编辑</el-button><el-buttonsize="small"icon="Delete"type="danger"text@click="handleDeleteBtnClick(scope.row.id)">删除</el-button></template></el-table-column></template><template v-else-if="item.type === 'custom'"><el-table-column align="center" v-bind="item"><template #default="scope"><slot:name="item.slotName"v-bind="scope":prop="item.prop"hName="why"></slot></template></el-table-column></template><template v-else><el-table-column align="center" v-bind="item" /></template></template></el-table></div><div class="pagination"><el-paginationv-model:current-page="currentPage"v-model:page-size="pageSize":page-sizes="[10, 20, 30]"layout="total, sizes, prev, pager, next, jumper":total="pageTotalCount"@size-change="handleSizeChange"@current-change="handleCurrentChange"/></div></div>
</template><script setup lang="ts">
...
interface IProps {contentConfig: {pageName: stringheader?: {title?: stringbtnTitle?: string}propsList: any[]childrenTree?: any}
}const props = defineProps<IProps>()
...
</script><style lang="less" scoped>
...
</style>

3.3使用组件

<template><div class="menu"><page-content :content-config="contentConfig" /></div>
</template><script setup lang="ts" name="menu">
import PageContent from '@/components/page-content/page-content.vue'
import contentConfig from './config/content.config'
</script><style scoped>
...
</style>
http://www.dtcms.com/wzjs/320684.html

相关文章:

  • 微信营销 网站建设市场营销案例
  • 购物网站开发步骤视频演示大专网络营销专业好不好
  • 淘宝客模板网站站长工具seo综合查询怎么使用的
  • 东莞市网站建设品牌广告图片
  • 做网站花钱么免费做网站的平台
  • 大设计师论坛网页设计百度词条优化工作
  • 网站建设优化推广教程网站流量分析
  • wordpress更改青岛网络seo公司
  • 网站首页没有权重网站技术外包公司
  • 网站建设方案功能企业推广是做什么的
  • 冷色调网站广州seo推广营销
  • 网站建设公司固定ip苏州网络推广seo服务
  • 快速搭建网站教程网络做推广公司
  • 电子商务网站建设需要哪些技术seo优化是什么意思
  • 做网站 java 怎么样成都私人做网站建设
  • 如何进行企业营销型网站建设规划千锋教育怎么样
  • 网站源码建站视频真实的优化排名
  • 许昌做网站建网站哪个平台好
  • 新网站的建设方案小红书关键词搜索量查询
  • 生产备案号怎么查询网站44555pd永久四色端口
  • dw可以做动态网站么杭州关键词自动排名
  • 有域名后怎样做网站简述常用的网络营销方法
  • 做网站上海关键词搜索爱站网
  • 上海网站建设企业2022年传销最新消息
  • 怎么做专题网站国家高新技术企业
  • 最少的钱做网站网站搜索引擎
  • 免费永久网站空间济南百度开户电话
  • 营销型网站建设用途购买seo关键词排名优化官网
  • 网站后台怎么做友情链接广州网站优化排名系统
  • 服务网站推广方案网络营销软文范例