vue学习-001

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="app">
        <h1>{{message}}</h1>
        <h1>{{tags}}</h1>
        <ul>
            <li v-for="tag in tags">{{tag}}</li>
        </ul>
        <h1>{{log}}</h1>
        <button v-on:click="bt1">bt1</button>
        <button @click="log='271'">bt2</button>
    </div>
    <script>
        //全局配置
        const HelloApp = {
            data() { //定义数据
                return {
                    message: 'hello door',
                    tags: ["mid","top","left"],
                    log: ''
                }
            },
            methods: {
                bt1() {
                    this.log='ppts'
                }
            }
        }

        //实例对象
        const app = Vue.createApp(HelloApp).mount('#app')
    </script>
</body>
</html>
上一篇:2021年PIE二次开发大赛桌面开发组作品展示


下一篇:IPC-J-STD-001H: 焊接的电气和电子组件要求 Requirements for Soldered Electrical and Electronic Assemblies