💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
>[success] # 快速使用 通过 `CDN ` 的方式使用 引入`https://unpkg.com/vue@next` ~~~ <!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> </head> <body> <div id="app"></div> <!-- 通过cdn 引入 --> <script src="https://unpkg.com/vue@next"></script> <script> const app = Vue.createApp({ template: ` <h2> {{ title }}</h2> <div>{{count}} </div> <button @click="add">+</button> <button @click="sub">-<span> `, data() { return { title: '测试数据', count: 1, } }, methods: { add() { this.count++ }, sub() { this.count-- }, }, }) app.mount('#app') </script> </body> </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> </head> <body> <div id="app"> <h2>当前计数: {{counter}}</h2> <button @click="increment">+1</button> <button @click="decrement">-1</button> </div> <script src="./lib/vue.js"></script> <script> const app = Vue.createApp({ data: function() { return { counter: 0 } }, methods: { increment: function() { this.counter++ }, decrement: function() { this.counter-- } } }) app.mount("#app") </script> </body> </html> ~~~