当前位置:网站首页>Define attribute of UMI
Define attribute of UMI
2022-07-24 05:34:00 【Plum blossom three】
meaning :
Used to provide variables available in the code .
such as :
export default {
define: {
FOO: 'bar',
},
};
// You can get it directly from the page FOO Variable , To use
// console.log(FOO) --> bar
Call mode :process.env.xxx
Built in define attribute :
process.env.NODE_ENV, The value is development or production
process.env.NODE_ENV === ‘development’ // development environment
process.env.NODE_ENV === ‘production’ // Production environment
Apply to document.ejs
stay document.ejs in , call process.env , Get the current is Shell All environment variables of , contain .NODE_ENV. But I can't get umi define Properties in .
here , Must pass context.config To get define .
context.config Can get .umi.js All variables of the configuration file .
Call mode :<%=context.config.xxx %>
边栏推荐
猜你喜欢

What is the function of key

Pycharm configures LAN access, and the LAN cannot access the solution

Geoserver自动化上传Shapefile

关于作为行业人从业人员的一点思考

模板数据的二次加工

如何强制卸载Google浏览器,不用担心Google打开为白板,亲测有效。

Mapboxgl + GeoServer configuration local map tutorial

Latex learning notes (I) - installation configuration

Some experience of using D2L package and related environment configuration

登录 页面 + 总结心得
随机推荐
Promise_ Async and await
如何强制卸载Google浏览器,不用担心Google打开为白板,亲测有效。
网页播放rtsp视频流
jsp标签02
3. Draw a five sided cone with a square bottom on the screen. The bottom of the cone is on the xoz plane and the top of the cone is on the Y axis. Use the following figure to map the texture of the fo
函数_this关键字
[DP] number triangle
Pycharm configures LAN access, and the LAN cannot access the solution
special effects - 鼠标点击,出现随机设置的文字
微信小程序报错request:fail -2:net::ERR_FAILED
作用域与作用域链
数据类型概括
响应式页面
Draw a circle and a square on the screen. The square is in front and the circle is behind. You can move the square through the keyboard. In the following cases, the square can only move within the cir
key的作用是什么
4. Draw a red triangle and a yellow square on the screen. Triangle in the back, small; Square in front, big. Using the fusion technology, the triangle can be seen through the square, and the source an
XML解析
自定义MVC 3.0
special effects - 鼠标移动,出现自定义的表情拖尾
Opengl在屏幕上绘制一个锥体,该锥体有四个面,每个面都是三角形。为该锥体添加光照和纹理效果