zoukankan      html  css  js  c++  java
  • 直接接入vue.js的项目应用挂载点、模板、实例之间的关系

    <!doctype html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport"
              content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Vue入门</title>
        <script src="../vue.js"></script>
    </head>
    <body>
    <!--
    挂载点、模板、实例之间的关系
    
    挂载点是指用来被vue接管的dom元素
    模板是指vue里template定义的将要应用于挂载点里的html元素
    实例是指定义完模板跟挂载点定义完后 vue自动将内容解析到挂载点里
    -->
    <div id="root">{{msg}}</div>
    
    <script>
        //创建vue对象
        new Vue({
            el: "#root",//挂载点,把页面中某个element交给vue接管
            template: "<h1>{{msg}}</h1>",//vue 的模板
            data: {
                //vue实例的数据
                msg: "hellow word!"
            }
        });
    </script>
    </body>
    </html>
  • 相关阅读:
    pecl install swoole 安装php扩展swoole
    RBAC
    mysql数据类型
    ES6——Proxy的this问题
    ES6——Proxy实现链式操作
    ES6——Symbol内置值
    ES6——yield例子
    ES6——Generator的next()方法
    ES6——Thunkify用法
    Linux学习day1
  • 原文地址:https://www.cnblogs.com/startingPoint/p/9396392.html
Copyright © 2011-2022 走看看