Title: 📦Template engine
Canonical: https://microi.net/en/doc/form-engine/model-engine.html
Page-Modified: 2026-10-12T10:49:46.000Z
Source: published HTML document body; page revision is not a capability verification date.
# 📦Template engine
Used to process the final rendered data, such as displaying a different colored background based on field values
---
## 📌Introduction
模板引擎Currently applied in表单属性in 【表格 V8 模板引擎】、【表单 V8 模板引擎]:
---
## 💡Example
Note
Here'sV8.FormYou can only access the value of the Query Column field configured in Module Engine. If the query column is set to null, you can access all the field values.
Expand to view JavaScript code (28 lines)
js
```
//使用bootstrap样式
var value = V8.Form.Zhuangtai;
if(V8.IsNull(value)){
V8.Result = '';
}else{
var classStr = 'badge-primary';
if(value == '禁用'){
classStr = `badge-danger`;
}
else if(value == '未通过'){
classStr = `badge-warning`;
}
else if(value == '待审核'){
classStr = `badge-info`;
}
var html = `${value}`;
V8.Result = html;
}
//使用style
if(V8.Form.XuqiuLX == '合并'){
V8.Result = `${V8.Form.XuqiuDDH}`;//显示蓝色
}
else if(V8.Form.HebingID){
V8.Result = `${V8.Form.XuqiuDDH}`;//显示灰色
}else{
V8.Result = V8.Form.XuqiuDDH;//默认
}
```
## Support 'bootstrap', 'element-ui style
Commonly usedbootstrapStyle:
[alt text: https://microi.net/doc/bootstrap.jpg]
html
```
Primary
Secondary
Success
Danger
Warning
Info
Light
Dark
```
## Single picture list display
js
```
var html = '';
var fileServer = V8.SysConfig.FileServer;
if(!V8.IsNull(V8.Form.GongsiLOGO)){
html = ``;
}
V8.Result = html;
```
## Multiple picture list display
js
```
var html = '';
var fileServer = V8.SysConfig.FileServer;
if(!V8.IsNull(V8.Form.TupianMS) && V8.Form.TupianMS.indexOf('[')!=-1){
var TupianMS = JSON.parse(V8.Form.TupianMS)
TupianMS.forEach(item=>{
//html = html + `
`;
html = html + `
`
})
html = `` + html + ``
}
V8.Result = html;
```
## Link redirection
js
```
if(V8.Form.SuoshuKH && V8.Form.SuoshuKH.KehuMC){
V8.Result = `${V8.Form.SuoshuKH.KehuMC}`;
}
```