vue基础知识2

vue基础知识

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <h1 v-if="type == 'A'">A</h1>
    <h1 v-else-if="type == 'B'">B</h1>
    <h1 v-else>No</h1>
</div>
<script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
<script>
    var vm = new Vue({
        el: '#app',
        data: {
            type: 'B'
        }
    })
</script>
</body>
</html>

  

 

posted @ 2021-02-05 14:06  iJunHello  阅读(71)  评论(0)    收藏  举报