是否有可能导入相同的 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)
有人知道如何在百里香中扩展表达吗?(我在百里香中需要一个“品种”功能)。
克隆“数字”表达式是可行的,但是...
当我创建自己的表达式时,出现错误:
严重:路径为[]的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) )有没有办法在“script”标签内使用“th:block”标签?像这样的东西:
<script type="text/javascript">
<th:block>
var test = 1;
</th:block>
</script>
Run Code Online (Sandbox Code Playgroud)