当前位置:网站首页>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
边栏推荐
- Spss-系统聚类手算实操
- 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)
- Web3安全风险令人生畏,应该如何应对?
- bracket matching
- 【PCBA方案设计】握力计方案
- 工龄10年的测试员从大厂“裸辞”后...
- Cryptography Series: PEM and PKCS7, PKCS8, PKCS12
- STP基本配置及802.1D生成树协议的改进
- JWT主动校验Token是否过期
- DSPE-PEG-Aldehyde,DSPE-PEG-CHO,磷脂-聚乙二醇-醛基一种疏水18碳磷脂
猜你喜欢
随机推荐
顺序队列
[2022 Hangzhou Electric Multi-School 5 1003 Slipper] Multiple Super Source Points + Shortest Path
PRIMAL: Pathfinding via Reinforcement and Imitation Multi-Agent Learning Code Analysis
如何用好建造者模式
深度解析:为什么跨链桥又双叒出事了?
[AGC] Build Service 1 - Cloud Function Example
命名路由、组件中name的作用
laravel whereDoesntHave
简述@RequestParam与@RequestBody参数注解
3. Byte stream and character stream of IO stream
Debug locally and start the local server in vs code
LayaBox---TypeScript---Example
C语言之实现扫雷小游戏
知识分享|如何设计有效的帮助中心,不妨来看看以下几点
帝国CMS仿核弹头H5小游戏模板/92game帝国CMS内核仿游戏网整站源码
1.读写点云文件
Retrofit的使用及原理详解
Web3安全风险令人生畏,应该如何应对?
文章复现:超分辨率网络-VDSR
27.降维