IT行业中模仿的案例

模仿在IT行业中也是常见的,模仿并不是全盘照搬照抄模仿一定结合实际情况灵活应变。模仿并不排斥创新。先有模仿的基础,在模仿的基础上,因地制宜,才能活下来,活下来后,在根据实际情况的发展变化,逐步地、尝试性创新,有时一小小的创新就会有新天地,就会有意向不到的惊喜和收获,当然也有小小的创新,带来巨大的损失。创新一定伴随着风险。在游戏中,模仿是常见到的,从最开始的qq飞车,到最后的跑跑卡丁车,还有好多关于跑车一类的游戏也越来越多。

转载于:https://www.cnblogs.com/lq195128/p/5316030.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个简单的 Vue.js 实现微信聊天单机版的示例代码: ``` <template> <div class="chat-room"> <div class="chat-container"> <div class="chat-msg" v-for="(msg, index) in messages" :key="index"> <div class="chat-avatar"> <img :src="msg.avatar" alt="avatar" /> </div> <div class="chat-content"> <div class="chat-info"> <span class="chat-name">{{ msg.name }}</span> <span class="chat-time">{{ msg.time }}</span> </div> <div class="chat-text">{{ msg.text }}</div> </div> </div> </div> <div class="chat-input"> <input type="text" v-model="inputText" @keyup.enter="sendMessage" /> <button @click="sendMessage">发送</button> </div> </div> </template> <script> export default { name: "ChatRoom", data() { return { inputText: "", messages: [ { avatar: "https://i.pravatar.cc/50?img=1", name: "小明", time: "2021-10-01 12:00", text: "你在干嘛?", }, { avatar: "https://i.pravatar.cc/50?img=2", name: "小红", time: "2021-10-01 12:05", text: "我在看电影,你呢?", }, { avatar: "https://i.pravatar.cc/50?img=3", name: "小明", time: "2021-10-01 12:10", text: "我在写代码", }, ], }; }, methods: { sendMessage() { if (this.inputText.trim() === "") return; const time = new Date().toLocaleString(); const newMessage = { avatar: "https://i.pravatar.cc/50?img=4", name: "我", time, text: this.inputText, }; this.messages.push(newMessage); this.inputText = ""; }, }, }; </script> <style> .chat-room { height: 100vh; display: flex; flex-direction: column; } .chat-container { height: calc(100% - 50px); overflow-y: scroll; padding: 10px; } .chat-msg { display: flex; margin-bottom: 10px; } .chat-avatar { margin-right: 10px; } .chat-avatar img { width: 50px; height: 50px; border-radius: 50%; } .chat-info { display: flex; justify-content: space-between; margin-bottom: 5px; } .chat-name { font-weight: bold; } .chat-time { color: #999; } .chat-text { word-wrap: break-word; } .chat-input { display: flex; justify-content: space-between; align-items: center; height: 50px; background-color: #fafafa; padding: 10px; } .chat-input input { flex: 1; height: 30px; border: none; border-radius: 5px; padding: 5px; } .chat-input button { height: 30px; margin-left: 10px; } </style> ``` 这段代码实现了一个简单的聊天室界面,包括消息列表、发送消息输入框和发送按钮。其,消息列表使用 `v-for` 指令遍历 `messages` 数组,每个消息包括头像、昵称、时间和文本内容。发送消息时,通过 `v-model` 指令绑定输入框的值,通过 `@keyup.enter` 监听回车键事件或者点击发送按钮时调用 `sendMessage` 方法,将新消息添加到 `messages` 数组

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值