简体   繁体   English

Vue 如何实现双卷曲/小胡子语法?

[英]How does Vue implement the double curlys/mustache syntax?

How does a Javascript framework like Vue implement a new syntax that the browser is able to compile/parse???像 Vue 这样的 Javascript 框架如何实现浏览器能够编译/解析的新语法??? I am particularly wondering about the double curlies (or commonly known as mustach syntax).我特别想知道双卷曲(或通常称为 mustach 语法)。

The Vue syntax is indeed not understood by the browser.浏览器确实看不懂 Vue 语法。 the work is done by the Vue library that's imported in every Vue app.这项工作是由每个 Vue 应用程序中导入的 Vue 库完成的。

The original markup (with the curly braces showing up) can even be seen for a split second when the page is loading, and this is because Vue hasn't loaded up all the way yet.当页面加载时,原始标记(带有花括号)甚至可以在瞬间看到,这是因为 Vue 还没有完全加载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM