其中的关键是输出js上的纯文本内容,让浏览器解析为其中的js代码
<script>
BUI.use('common/main',function(){
var config = [
{
id: '1',
menu:
[
@{
int ruiyalel = (int)Session["ruiyaLev"];
int happyfamilylel = (int)Session["happyfamilyLev"];
if (ruiyalel > 0) {
<text>
{
text: '瑞亚官网', items: [{ id: '3', text: '瑞亚新闻', href: 'DBSystem/ruiya/News' }, ]
},
</text>