编程知识 cdmana.com

How to use vue.js

Create a new html page
Introducing our vue.js, for example :

//  <script src='/public/vue.js'></script>

I put it on the scaffold public Inside , Generally, static files are stored in the scaffold public In the file

//  <script src='/public/vue.js'></script>

The specific code is as follows :

//<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src='/public/vue.js'></script>
</head>

<body>
    <div class="app">

    </div>
</body>

</html>
<script>
    //  Create a Vue example 
    new Vue({
        el: '.app',   // here el  Namely element, If it is class Namely .  If it is id Namely #
        data: {},     // Put the data here ( Only in data The contents of it can be compared with html Templates have a relationship )
        methods: {},    // This is the place to write the method 
    })
</script>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src='/public/vue.js'></script>
</head>

<body>
    <div class="app">

    </div>
</body>

</html>
<script>
    //  Create a Vue example 
    new Vue({
        el: '.app',   // here el  Namely element, If it is class Namely .  If it is id Namely #
        data: {},     // Put the data here ( Only in data The contents of it can be compared with html Templates have a relationship )
        methods: {},    // This is the place to write the method 
    })
</script>

版权声明
本文为[osc_ j3111wl4]所创,转载请带上原文链接,感谢
https://cdmana.com/2020/12/20201225095044686L.html

Tags use vue.js vue js
Scroll to Top