当前位置:网站首页>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
边栏推荐
- 【2022杭电多校5 1012题 Buy Figurines】STL的运用
- PowerCLi 导入License到vCenter 7
- Pinduoduo open platform order information query interface [pdd.order.basic.list.get order basic information list query interface (according to transaction time)] code docking tutorial
- 项目难管理?先学会用好甘特图(内附操作方法及实用模板)
- 知识分享|如何设计有效的帮助中心,不妨来看看以下几点
- Oreo domain name authorization verification system v1.0.6 public open source version website source code
- bracket matching
- 路由中的meta、params传参的一些问题(可传不可传,为空,搭配,点击传递多次参数报错)
- PowerCLi import license to vCenter 7
- ue unreal 虚幻 高分辨率无缩放 编辑器字太小 调整编辑器整体缩放
猜你喜欢
随机推荐
DSPE-PEG-Aldehyde,DSPE-PEG-CHO,磷脂-聚乙二醇-醛基一种疏水18碳磷脂
嵌入式分享合集28
文章复现:超分辨率网络-VDSR
[TypeScript] In-depth study of TypeScript enumeration
Uniapp微信雪糕刺客单页小程序源码
使用堡塔应用管理器配置laravel队列方法
[2022 Nioke Duo School 5 A Question Don't Starve] DP
buu web
Cryptography Series: PEM and PKCS7, PKCS8, PKCS12
二叉搜索树解决硬木问题
dotnet delete read-only files
【1403. 非递增顺序的最小子序列】
How to train a deep learning model?
C语言之实现扫雷小游戏
Oreo domain name authorization verification system v1.0.6 public open source version website source code
Using Baidu EasyDL to realize forest fire early warning and identification
laravel whereDoesntHave
PowerCLi 导入License到vCenter 7
[21 days learning challenge - kernel notes] (2), based in the device tree
推荐系统_刘老师