基于vue2.x实现的即时通讯程序仿微信聊天3配置tabbar以

2022-10-23  本文已影响0人  风中凌乱的男子
const whiteList = ['/login','/home'] // no redirect whitelist
http://localhost:9020/#/home
 tabbars: [
        {
          title: '通讯录',
          to: {
            name: 'Home'
          },
          icon: 'chat-o'
        },
        {
          title: '群聊',
          to: {
            name: 'GroupChat'
          },
          icon: 'friends-o'
        },
        {
          title: '我的',
          to: {
            name: 'About'
          },
          icon: 'user-o'
        }
      ]
<template>
  <div>首页</div>
</template>

<script>
export default {}
</script>

<style lang="scss" scoped>
</style>
image.png
import { NavBar, Search, NoticeBar } from 'vant';

Vue.use(NavBar);
Vue.use(Search);
Vue.use(NoticeBar);
<template>
  <div>
    <van-nav-bar title="回信(0)" left-text="">
      <template #right>
        <van-icon name="add-o" size="20" color="#333" />
      </template>
    </van-nav-bar>
    <van-search v-model="value" placeholder="请输入搜索关键词" />
    <van-notice-bar left-icon="volume-o" text="在代码阅读过程中人们说脏话的频率是衡量代码质量的唯一标准。" />
  </div>
</template>
<script>
export default {
  data() {
    return {
      value: ''
    }
  }
}
</script>
<style lang="scss" scoped>
</style>
image.png
image.png
<div class="cell">
      <ul>
        <li v-for="(item,index) in 12" :key="index">
          <div class="left">
            <van-image
              fit="cover"
              class="avatar"
              src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201606%2F07%2F20160607213049_SAfEL.thumb.700_0.png&refer=http%3A%2F%2Fb-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1661607257&t=85d7505d9327024d5bfd5350cf0c1259"
            />
          </div>
          <div class="right">
            <div class="top">
              <span>钱多多 </span>
              <span></span>
              <span>12:00</span>
            </div>
            <div class="bottom">你好啊,小朋友你好啊,小朋友你好啊,小朋友你好啊,小朋友你好啊,小朋友你好啊,小朋友你好啊,小朋友你好啊,小朋友你好啊,小朋友你好啊,小朋友你好啊,小朋友你好啊,小朋友你好啊,小朋友</div>
          </div>
        </li>
      </ul>
    </div>
.cell {
  padding-top: 10px;
  background: #fff;
  ul {
    li {
      display: flex;
      font-size: 24px;
      padding: 20px 12px;
      border-bottom: 2px solid #eee;
      margin-bottom: 12px;
      .left {
        width: 92px;
        height: 92px;
        margin-right: 12px;
        ::v-deep .van-image{
          width: 100%;
          height: 100%;
        }
      }
      .right{
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        .top{
          display: flex;
          justify-content: space-between;
          span{
            &:first-child{
              font-size: 28px;
            }
          }
        }
        .bottom{
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
          width: calc(100vw - 150px);
          color: #999;
        }
      }
    }
  }
}
image.png
上一篇下一篇

猜你喜欢

热点阅读