| <template> |
| <div> |
| <h1>你好!vue</h1> |
| <p>{{msg}}</p><br> |
| <span>传值:{{counter}}</span> |
| <button @click='btnClick'>你点击了{{count}}次</button> |
| </div> |
| </template> |
| |
| <script> |
| export default { |
| props: ['counter'], |
| data() { |
| return { |
| msg: '我的第一个vite项目', |
| count: 0 |
| } |
| }, |
| methods: { |
| btnClick() { |
| this.count++; |
| } |
| } |
| } |
| </script> |
| |
| <style> |
| </style> |
| <template> |
| <img alt="Vue logo" src="./assets/logo.png" /> |
| <hello-world counter=0 /> |
| <p>{{msg}}</p> |
| </template> |
| |
| <script> |
| import HelloWorld from './components/HelloWorld.vue' |
| export default { |
| components: { |
| HelloWorld |
| }, |
| data() { |
| return { |
| msg: "Hello! vue" |
| } |
| } |
| } |
| |
| </script> |
| |
| <style> |
| #app { |
| font-family: Avenir, Helvetica, Arial, sans-serif; |
| -webkit-font-smoothing: antialiased; |
| -moz-osx-font-smoothing: grayscale; |
| text-align: center; |
| color: #2c3e50; |
| margin-top: 60px; |
| } |
| </style> |
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决
· 提示词工程——AI应用必不可少的技术