IDEA-项目文件缩略问题(官方文档解析项目文件夹类别)

问题:
在学习项目的时候,不知道点了啥,pom.xml和sources文件都隐藏了。
在这里插入图片描述
项目结构中的倒是没有问题。
在这里插入图片描述

尝试1: 删除.idea,重新启动IDEA
在这里插入图片描述
无用~

尝试2: Project Structure设置资源类型
在这里插入图片描述
如上图红圈所示,我们可以对项目中的文件进行任意类型的标注。根据官方文档介绍,首先了解一下这五种标注都表示什么:

  • Sources
    This folder contains production code that should be compiled.
    文件中包含应编译的开发代码。

  • Test Sources
    These folders keep code related to testing separately from production code. Compilation results for sources and test sources are normally placed into different folders.
    将测试代码与开发代码分开保存,并且源代码(即Sources)和测试源代码的编译结果放在不同的文件夹中。

  • Resources
    (Java only) Resource files used in your application: images, configuration XML and properties files, and so on. During the build process, resource files are copied to the output folder as is by default. You can Change the output path for resource files in your project.
    Similarly to sources, you can specify that your resources are generated. You can also specify which folder within the output folder your resources should be copied to.
    程序中使用的资源文件,包含映像、XML配置和属性文件等。在生成过程中,资源文件将按默认值复制到输出文件夹中(可以修改资源文件的输出路径)。与源类似,您可以指定生成资源。您还可以指定应将资源复制到输出文件夹中的哪个文件夹。

  • Test Resources
    These folders are for resource files associated with your test sources.
    与测试源关联的资源文件。

  • Excluded
    Files in excluded folders are ignored by code completion, navigation and inspection. That is why, when you exclude a folder that you don’t need at the moment, you can increase the IDE performance. Normally, compilation output folders are marked as excluded.
    Apart from excluding the entire folders, you can also exclude specific files.
    这个文件夹的作用主要是排除不需要的文件,文件将被代码完成、导航和检查忽略,以提高IDE的性能。

试着把src作为sources,结果如下:
在这里插入图片描述
做了几次尝试之后,似乎这不是我们想要的结果。

正确解决方法:
在这里插入图片描述
在开发的时候不小心点到了Packages,“只展示包”。修改为“Project Files”,恢复到了原来的文件目录结构。
在这里插入图片描述
同时我们也可以学到一件事,当项目结构较为复杂时,当想要看关键的开发代码部分时,可以设置项目结构为Packages。
ok,以上就是全部问题及解决方案啦~
参考:官网提供的详细使用文档

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
对于 el-upload 组件来说,要实现文件缩略图的功能,你可以通过以下步骤进行操作: 1. 首先,确保你已经安装了 element-ui 组件库。如果没有安装,可以通过 npm 或 yarn 进行安装。 2. 在你的组件中,引入 el-upload 组件,并设置相应的属性和事件。例如: ```vue <template> <el-upload :action="uploadUrl" :on-success="handleSuccess" :file-list="fileList" :list-type="'picture-card'" > <i class="el-icon-plus"></i> </el-upload> </template> <script> export default { data() { return { uploadUrl: 'your_upload_url', fileList: [], }; }, methods: { handleSuccess(response, file, fileList) { // 处理上传成功后的回调逻辑 // 在这里可以获取到上传成功后的文件信息,例如缩略图地址 console.log(response); // 上传成功后服务端返回的数据 console.log(file); // 当前上传的文件对象 console.log(fileList); // 已上传的文件列表 // 将缩略图地址存储到 fileList 中 file.url = response.thumbnailUrl; this.fileList = fileList; }, }, }; </script> ``` 3. 在 handleSuccess 方法中,你可以获取到上传成功后的文件信息。你可以在这里将缩略图地址存储到 fileList 中,并更新组件的 fileList 数据。 4. 最后,你可以通过遍历 fileList 数组,在 el-upload 组件中展示缩略图。例如: ```vue <template> <el-upload :action="uploadUrl" :on-success="handleSuccess" :file-list="fileList" :list-type="'picture-card'" > <i class="el-icon-plus"></i> </el-upload> <div v-for="file in fileList" :key="file.uid"> <img :src="file.url" alt="缩略图" /> </div> </template> ``` 这样,当你选择文件上传后,会显示上传成功的缩略图。请注意,此示例中的 uploadUrl 为上传文件的接口地址,你需要根据实际情况进行修改。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

疯狂java杰尼龟

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值