• 01 Vue的起步和插值表达式


    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
    </head>
    <body>
        <div id="app">
            <h2>{{ msg }}</h2>
            <h3>{{ 3 }}</h3>
            <h1>{{ 'hello' }}</h1>
            <h3>{{ {id:1} }}</h3>
            <h3>{{ 1>2 ?'真的':'假的' }}</h3>
            <h3>{{ txt.split('').reverse().join('') }}</h3>
            <h3>{{ getContent() }}</h3>

        </div>


    <!--    1.引包-->
        <script src="vue.js"></script>
        <script>
            //2.初始化
            const vm = new Vue({
                //作用区域
                el:'#app',
                //数据属性
                data:{
                    msg:'hello vue',
                    txt:'hello',
                    msg2:'content'
                },
                //方法
                methods:{
                    getContent(){
                        return this.msg + ' ' + this.msg2
                    }
                }
            })


        </script>
    </body>
    </html>
  • 相关阅读:
    在页面生命周期执行时 Page 对象在 SaveState 阶段都发生了什么事?
    接收Firfox RESTClient #Post请求
    c# 单例模式[Singleton]之深夜闲聊
    JQuery 之 Ajax 异步和同步浅谈
    [模板]数学整合
    Yandex插件使用说明——Slager_Z
    模板练习(LUOGU)
    数学整合 新(LUOGU)
    [NOI.AC]DELETE(LIS)
    [NOI.AC]COUNT(数学)
  • 原文地址:https://www.cnblogs.com/wuhui1222/p/14202540.html
Copyright © 2020-2023  润新知