继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

Electron开发实战之10-ChatList.vue

solso
关注TA
已关注
手记 15
粉丝 68
获赞 27

源码 j源码 j-step-c10

首先我们在renderer目录下创建components文件夹,在components文件夹下创建ChatList.vue

  • components/ChatList.vue

<template>
  <div id="chat-list">
    <div id="item-wrap">
      <div class="item item-2">
        <span>hm</span>
        <small>小白</small>
      </div>
      <div class="item item-1">
        <span>Joe</span>
        <small>自在</small>
      </div>
    </div>
  </div>
</template>

<style scoped>
#chat-list {
  display: flex;
  flex-direction: column;
}

#item-wrap {
  overflow-y: auto;
}

.item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 44px;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
}
.item:hover {
  background-color: #eaeaea;
}

.item-1 {
  color: #67c23a;
  background-color: #f0f9eb;
}

.item-2 {
  color: #999;
  background-color: #fff;
}
</style>
  • views/Chat.vue
<!-- 请添加高亮部分代码 -->
<!-- <template>
  <div id="chat">
    <el-tabs v-model="activeName">
      <el-tab-pane label="发消息" name="F">
        发消息
      </el-tab-pane>
      <el-tab-pane label="联系人" name="M"> -->
        <chat-list></chat-list>
      <!-- </el-tab-pane>
    </el-tabs>
  </div>
</template> -->

<script>
import ChatList from '@/components/ChatList.vue'
// export default {
  components: {
    'chat-list': ChatList
  },
  // data () {
    // return {
      // activeName: 'M'
    // }
  // }
// }
</script>
打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP