首页 > 其他分享 >低开开发笔记(七): 换引擎,点击跳转模板样式

低开开发笔记(七): 换引擎,点击跳转模板样式

时间:2024-05-17 23:11:31浏览次数:26  
标签:map index 低开 点击 let 跳转 模板 问卷

好家伙,

 

完整代码已开源

https://github.com/Fattiger4399/ph-questionnaire.git

 

1.思路

现在,我们的需求是,点击对应的模板,更换对应的模板数据

 

 

 2.上代码

<el-menu default-active="2" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose"
                    :default-openeds="openeds" @select="handleMenuItemClick">
                    <el-submenu index="0">
                        <template slot="title">
                            <i class="el-icon-monitor" style="color: #409EFF ;font-size: 30px;padding-right: 13px;"></i>
                            <span>工作台</span>
                        </template>
                    </el-submenu>
                    <el-submenu index="1">
                        <template slot="title">
                            <i class="el-icon-question"
                                style="color: #409EFF ;font-size: 30px;padding-right: 13px;"></i>
                            <span>问卷模板</span>
                        </template>
                        <el-menu-item-group>
                            <template slot="title">
                                分组一</template>

                            <el-menu-item index="1-1">
                                <template>
                                    <i class="el-icon-edit"></i>
                                    饮食偏好调查问卷
                                </template>
                            </el-menu-item>
                            <el-menu-item index="1-2">
                                <template>
                                    <i class="el-icon-edit"></i>
                                    学业完成情况调查问卷
                                </template>
                            </el-menu-item>
                        </el-menu-item-group>
                    </el-submenu>
                    <el-submenu index="2">
                        <template slot="title">
                            <i class="el-icon-location" style="color: brown ;font-size: 30px;padding-right: 13px;"></i>
                            <span>订单模板</span>
                        </template>
                        <el-menu-item-group>
                            <template slot="title">
                                分组一</template>

                            <el-menu-item index="2-1">
                                <template>
                                    <i class="el-icon-edit"></i>
                                    汽车销售订单
                                </template>
                            </el-menu-item>
                            <el-menu-item index="2-2">
                                <template>
                                    <i class="el-icon-edit"></i>
                                    文具销售订单
                                </template>
                            </el-menu-item>
                        </el-menu-item-group>
                    </el-submenu>
                    <el-submenu index="3">
                        <template slot="title">
                            <i class="el-icon-document"
                                style="color: #409EFF ;font-size: 30px;padding-right: 15px;"></i>
                            <span>报表模板</span>
                        </template>
                        <el-menu-item-group>
                            <template slot="title">
                                分组一</template>

                            <el-menu-item index="3-1">
                                <template>
                                    <i class="el-icon-edit"></i>
                                    公司财务统计报表
                                </template>
                            </el-menu-item>
                            <el-menu-item index="3-2">
                                <template>
                                    <i class="el-icon-edit"></i>
                                    耗材报销模板
                                </template>
                            </el-menu-item>
                        </el-menu-item-group>
                    </el-submenu>
                </el-menu>

 

对于饿了么组件的el-menu,是可以直接使用

<el-menu default-active="2" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose"
                    :default-openeds="openeds" @select="handleMenuItemClick">
@select来获取
<el-menu-item index="1-1">
                                <template>
                                    <i class="el-icon-edit"></i>
                                    饮食偏好调查问卷
                                </template>
                            </el-menu-item>

el-menu-item中的index

 

目录结构

handleMenuItemClick

 handleMenuItemClick(index) {
            const map =require('./examplejson/map.js')
            let __dirname = './examplejson/'
            let path = map.default[index]
            const jsonData = require(`${__dirname + path}`);
            this.formTemplate = jsonData
        },

 

在这里我们做一个简单的映射表

let map = {
    '1-1': 'DietaryhabitsSouth',
};

这样,就可以实现点击对应项,导入对应的json

 

 

标签:map,index,低开,点击,let,跳转,模板,问卷
From: https://www.cnblogs.com/FatTiger4399/p/18198843

相关文章

  • Django自定义模板标签与过滤器
    title:Django自定义模板标签与过滤器date:2024/5/1718:00:02updated:2024/5/1718:00:02categories:后端开发tags:Django模版自定义标签过滤器开发模板语法Python后端前端集成Web组件Django模板系统基础1.Django模板语言概述Django模板语言(DTL)是一种用......
  • JAVA KMP 纯模板
    纯模板记忆使用~classMain{staticchar[]s1;staticchar[]s2;staticint[]next;publicstaticvoidmain(String[]args){Scannerin=newScanner(System.in);s1=in.nextLine().toCharArray();s2=in.nextLine().to......
  • 界面组件DevExpress WPF中文教程 - 如何从CRTX模板文件导入图表设置
    DevExpressWPF 拥有120+个控件和库,将帮助您交付满足甚至超出企业需求的高性能业务应用程序。通过DevExpressWPF能创建有着强大互动功能的XAML基础应用程序,这些应用程序专注于当代客户的需求和构建未来新一代支持触摸的解决方案。无论是Office办公软件的衍伸产品,还是以数据为中......
  • CrushFTP服务器端模板注入
    漏洞描述由于CrushFTP存在服务器端模板注入漏洞,未经身份验证的远程攻击者可以逃避虚拟文件系统(VFS)沙箱,绕过身份验证获得管理访问权限,泄露敏感信息或执行代码。Fofa:server="CrushFTP"||header="/WebInterface/login.html"||banner="/WebInterface/login.html"||header="......
  • 字典树模板
    码:点击查看代码structNode{boolisend;intson[26];intnum;}tir[N];inttircnt=1;voidtir_insert(strings){intnow=0;for(inti=0;i<s.size();i++){intch=s[i]-'a';if(tir[now].son[ch]==0)......
  • 逆向 | 驱动IRP通信模板
    逆向|驱动IRP通信模板踩了很多坑,比如说IoCreateDevice以后要删除,符号链接也要在卸载的时候删除啥的。反正存个模板在这儿下次就能套了:#include<ntddk.h>#include<stdio.h>#include<stdlib.h>//0-2047是保留的,可以用2048-4095#defineOPER1CTL_CODE(FILE_DEVICE_UN......
  • 微信开发-主动推送模板消息给特定用户
    其实也比较简单,设置模板后推送即可,具体官方说明文档如下:接口调用请求说明http请求方式:POSThttps://api.weixin.qq.com/cgi-bin/template/del_private_template?access_token=ACCESS_TOKENPOST数据说明如下:{"template_id":"Dyvp3-Ff0cnail_CDSzk1fIc6-9lOkxsQE7ex......
  • C++模板编程-enable_if
    std::enable_if的使用对于重载的函数或者函数模板的选择上,编译器内部有一个自己的规则,并不是简单粗暴的对函数就优先选择,对函数模板就靠后选择替换失败并不是一个错误(SFINAE):SubstitutionFailureIsNotAnError,SFINAE看成是C++语言的一种特性或者说一种模板设计中要遵循的......
  • ansible自定义模板部署apache服务
    使用Ansible来部署Apache服务是一个很好的选择,因为它可以自动化部署过程,确保所有的服务器上都有相同的配置。以下是一个简单的步骤指南,展示如何使用Ansible来部署Apache服务:1创建角色目录首先,在/etc/ansible/roles下创建apache目录:mkdir-p/etc/ansible/roles/apache2......
  • Ubuntu 24.04 LTS x86_64 OVF (sysin) - VMware 虚拟机模板
    Ubuntu24.04LTSx86_64OVF(sysin)-VMware虚拟机模板Ubuntu24.04LTS(GNU/Linux6.8.0-31-genericx86_64)请访问原文链接:Ubuntu24.04LTSx86_64OVF(sysin)-VMware虚拟机模板,查看最新版。原创作品,转载请保留出处。作者主页:sysin.orgUbuntu24.04LTS(GNU/Li......