当前位置: 首页 > 工具软件 > Mustache > 使用案例 >

01-Mustache语法

萧心远
2023-12-01

01-Mustache语法

代码:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>mustache语法</title>
    </head>
    
    <body>
        <div id="app">
           <h2> {{message}}+李银河!</h2>
           <h2>{{firstname+lastname}}</h2>
           <h2>{{firstname+' '+lastname}}</h2>
           <h2>{{firstname}} {{lastname}}</h2>
           <h2>{{counter*2}}</h2>
        </div>

        <script src="../js/vue.js"></script>
        <script>
            const app=new Vue({
                el:'#app',
                data:{
                    messgae:"你好啊",
                    firstname:"rose",
                    lastname:"donson",
                    counter:100
                }
            })
        </script>
    </body>
</html>
 类似资料: