Meituan-Dianping/mpvue · error
class="${staticClass}": Interpolation inside attributes has
Error message
class="${staticClass}": Interpolation inside attributes has been deprecated. Use v-bind or the colon shorthand instead. What it means
Dev-only compiler warning from the class module's transformNode: a static class attribute contains mustache interpolation (class="foo {{ bar }}"), which is deprecated in Vue 2. Mixed static+interpolated class cannot be handled by the static/dynamic split, so the author must switch to v-bind:class.
Source
Thrown at packages/weex-template-compiler/build.js:3443
optimize(ast, options);
var code = generate(ast, options);
return {
ast: ast,
render: code.render,
staticRenderFns: code.staticRenderFns
}
});
/* */
function transformNode (el, options) {
var warn = options.warn || baseWarn;
var staticClass = getAndRemoveAttr(el, 'class');
var ref = parseStaticClass(staticClass, options);
var dynamic = ref.dynamic;
var classResult = ref.classResult;
if (process.env.NODE_ENV !== 'production' && dynamic && staticClass) {
warn(
"class=\"" + staticClass + "\": " +
'Interpolation inside attributes has been deprecated. ' +
'Use v-bind or the colon shorthand instead.'
);
}
if (!dynamic && classResult) {
el.staticClass = classResult;
}
var classBinding = getBindingAttr(el, 'class', false /* getStatic */);
if (classBinding) {
el.classBinding = classBinding;
} else if (dynamic) {
el.classBinding = classResult;
}
}
function genData$1 (el) {
var data = '';View on GitHub (pinned to 6c5d78ee04)
Solutions
- Use v-bind:class (or :class) for the dynamic part, e.g. :class="bar" alongside class="foo"
- Split static and dynamic classes: class="static-cls" :class="{ dyn: cond }"
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at packages/weex-template-compiler/build.js:3443 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Meituan-Dianping/mpvue@6c5d78ee04 (2026-09-02).
Data as JSON: /api/errors/f0a1a37b160f50e3.
Report an issue: GitHub.