<!-- 
1. 容器
2. 引入
3. new Vue
4. 选项
 -->
<!DOCTYPE html>
<html>

<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width,initial-scale=1.0'>
    <meta http-equiv='X-UA-Compatible' content='ie=edge'>
    <title>Document</title>
</head>

<body>
    <div id='app'>
        <!-- 指令: 
        代码位置: 开始标签位置
        特点: v- 开头
        作用: 增强/扩展了标签的功能
        -->
        <!-- 例子: 给p绑定事件 -->
        <!-- v-on:事件名="methods中的方法名()" -->
        <p v-on:click="fn()">内容</p>
    </div>
    <script src='./vue.js'></script>
    <script>
        new Vue({
            el: '#app',
            data: {
            },
            methods: {
                fn() {
                    console.log("fn-----");
                }
            }
        });
    </script>
</body>

</html>

12-基础-术语解释-指令

相关文章:

  • 2021-12-12
  • 2022-02-14
  • 2022-12-23
  • 2021-07-14
  • 2022-01-05
  • 2021-05-18
  • 2021-12-27
  • 2022-12-23
猜你喜欢
  • 2021-12-12
  • 2021-07-27
  • 2022-12-23
  • 2021-07-27
  • 2022-12-23
  • 2022-01-09
相关资源
相似解决方案