当前位置:网站首页>Moke, dynamic image resource package display
Moke, dynamic image resource package display
2022-08-04 21:09:00 【Delete your code in the middle of the night】
moke
Use mockjs to simulate the data interface (actually similar to ajax, mock is to specify a url path for our json data to request)
1. Prepare json data
2. Install mockjs
3、Use mockjs to simulate providing the interface address
4. Introduce mockServer.js in main
5. In ajax, modify the baseUrl in Ajax to /mock and change it to a new file mockAjax
Mock will intercept usThe ajax request will not actually send the request.(The request is sent locally, not sent to the backend, and the requested data is also local)
Dynamic image resource package display
If it is a static page, both div and img exist, and webpack will package div and img when packaging
And will find the corresponding static resource pictures according to the src of img and package them together, so there will be no problem
If it is a dynamic page, div and img are generated by traversing the dynamic data returned by the request, that is to say, webpack is in
When packaging, div and img do not exist, so after the packaging is completed, the image has no designated location to be packaged at all, so we need
I put the required static image resources in the packaged location, which is actually in the publick in the development stage
边栏推荐
- [TypeScript] In-depth study of TypeScript enumeration
- 数据仓库(1)什么是数据仓库,数仓有什么特点
- How to make good use of builder mode
- 知识分享|如何设计有效的帮助中心,不妨来看看以下几点
- 3. Byte stream and character stream of IO stream
- PCBA方案设计——厨房语音秤芯片方案
- 使用堡塔应用管理器配置laravel队列方法
- SAP ABAP OData 服务如何支持 $select 有选择性地仅读取部分模型字段值试读版
- [21天学习挑战赛——内核笔记](二)——设备树基础
- win10 uwp 使用 WinDbg 调试
猜你喜欢
PowerCLi batch configuration of NTP
【2022杭电多校5 1012题 Buy Figurines】STL的运用
漫画 | 老板裁掉我两周后,又把我请回去,工资翻番!
Oreo域名授权验证系统v1.0.6公益开源版本网站源码
Matlab画图2
STP基本配置及802.1D生成树协议的改进
[TypeScript] In-depth study of TypeScript enumeration
[Teach you to use the serial port idle interrupt of the STM32HAL library]
[2022 Hangzhou Electric Power Multi-School 5 1012 Questions Buy Figurines] Application of STL
五分钟入门文本处理三剑客grep awk sed
随机推荐
IPV6地址
帝国CMS仿核弹头H5小游戏模板/92game帝国CMS内核仿游戏网整站源码
27.降维
PRIMAL: Pathfinding via Reinforcement and Imitation Multi-Agent Learning Code Analysis
Comic | Two weeks after the boss laid me off, he hired me back and doubled my salary!
Uniapp微信雪糕刺客单页小程序源码
laravel whereDoesntHave
【debug】postgres数据存储错乱
[2022 Hangzhou Electric Multi-School 5 1003 Slipper] Multiple Super Source Points + Shortest Path
Hands-on Deep Learning_NiN
经验分享|盘点企业进行知识管理时的困惑类型
Some problems with passing parameters of meta and params in routing (can be passed but not passed, empty, collocation, click to pass multiple parameters to report an error)
js的new Function()常用方法
visual studio 2015 warning MSB3246
链路聚合技术及VRRP
LayaBox---TypeScript---首次接触遇到的问题
PowerCLi 批量配置NTP
Named routes, the role of name in components
JdbcTemplate概述和测试
88.(cesium之家)cesium聚合图