小编WEB*_*TER的帖子

vue单文件组件-自导入

是否有可能导入相同的 SFC?我的意思是:

测试.vue:

<template>
  <ul v-for="(item, index) in menuLevel">
    <li>
      {{item.name}}
      <test :data="item" v-if="item.children && item.children.length"></test>
    </li>
  </ul>
</template>
Run Code Online (Sandbox Code Playgroud)

vue.js

4
推荐指数
1
解决办法
3434
查看次数

如何创建与Thymeleaf和Spring一起使用的新表达式?


有人知道如何在百里香中扩展表达吗?(我在百里香中需要一个“品种”功能)。
克隆“数字”表达式是可行的,但是...
当我创建自己的表达式时,出现错误:

严重:路径为[]的Servlet [appServlet]的Servlet.service()抛出异常

  [Request processing failed;
   nested exception is   org.thymeleaf.exceptions.TemplateProcessingException: 
   Exception evaluating SpringEL expression:
   "Variety.Variety(review.usefulScore, 'osoba', 'osoby', 'osób')"
   (static:/cms/fragments/reviews:49)] with root cause
   org.springframework.expression.spel.SpelEvaluationException:
   EL1011E:(pos 8): Method call: 
  Attempted to call method  Variety(java.lang.Integer,java.lang.String,java.lang.String,java.lang.String) on null context object
Run Code Online (Sandbox Code Playgroud)

有什么建议么?

编辑(我的代码):包org.springframework.expression;

import org.springframework.expression.spel.support.StandardEvaluationContext;

public abstract class Variety extends StandardEvaluationContext {

    private boolean in_array(int needle, int[] haystack) {

        for(int i = 0; i < haystack.length; i++) {
            if(haystack[i] == needle) return true;
        }
        return false;
    }

    public String Variety(int number, String varietyFor1, …
Run Code Online (Sandbox Code Playgroud)

java spring thymeleaf

1
推荐指数
1
解决办法
3269
查看次数

thymeleaf - 脚本和 th:block

)有没有办法在“script”标签内使用“th:block”标签?像这样的东西:

<script type="text/javascript">
    <th:block>
        var test = 1;
    </th:block>
</script>
Run Code Online (Sandbox Code Playgroud)

javascript thymeleaf

0
推荐指数
1
解决办法
5728
查看次数

标签 统计

thymeleaf ×2

java ×1

javascript ×1

spring ×1

vue.js ×1