当前位置:网站首页>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
边栏推荐
猜你喜欢

After encountering MapStruct, the conversion between PO, DTO and VO objects is no longer handwritten
![[Data Mining] Written Exam Questions for Sohu Data Mining Engineers](/img/d9/450eeecd5c7835d40ac38da41fc08e.png)
[Data Mining] Written Exam Questions for Sohu Data Mining Engineers

使用堡塔应用管理器配置laravel队列方法

stm32mp157系统移植 | 移植ST官方5.10内核到小熊派开发板

无代码平台字段设置:基础设置入门教程
![[Teach you to use the serial port idle interrupt of the STM32HAL library]](/img/9e/88a11727e1452315edc2c8ac74690e.png)
[Teach you to use the serial port idle interrupt of the STM32HAL library]

【C语言】指针和数组的深入理解(第三期)

xss课堂内容复现

proe和creo的区别有哪些

Web3时代的战争
随机推荐
LayaBox---TypeScript---Problems encountered at first contact
PowerCLi 批量配置NTP
mdk5.14无法烧录
bracket matching
moke、动态图片资源打包显示
无代码平台字段设置:基础设置入门教程
dotnet 删除只读文件
大势所趋之下的nft拍卖,未来艺术品的新赋能
Five Minutes Introductory Text Processing Three Musketeers grep awk sed
[TypeScript] In-depth study of TypeScript enumeration
【手把手教你使用STM32HAL库的串口空闲中断】
JWT actively checks whether the Token has expired
Oreo域名授权验证系统v1.0.6公益开源版本网站源码
PCBA方案设计——厨房语音秤芯片方案
xss课堂内容复现
[2022 Hangzhou Electric Power Multi-School 5 1012 Questions Buy Figurines] Application of STL
LayaBox---知识点
3、IO流之字节流和字符流
dotnet delete read-only files
【PCBA方案设计】握力计方案