仿簡書頁面代碼示例(2)

這次為登陸后會顯示的幾個主要頁面

  • 關(guān)注頁面


    關(guān)注.png
<template>
    <b-row>
      <b-col cols="3">
        <v-jianyouquan></v-jianyouquan>
      </b-col>
      <b-col cols="8">
        <router-view></router-view>
      </b-col>
    </b-row>
</template>

<script>
  import vJianyouquan from '../common/Jianyouquan'
  import vTimeline from '../common/Timeline'
    export default {
        name: "Subscriptions",
      components:{
          vJianyouquan,
          vTimeline
      }
    }
</script>

<style scoped>

</style>

<v-jianyouquan></v-jianyouquan>部分

<template>
  <div class="main">
    <ul>
      <div class="guanzhu">全部關(guān)注
        <router-link to="/subscriptions/guanzhu">
          <a class="addguanzhu">
            添加關(guān)注
          </a>
        </router-link>
      </div>

      <router-link to="/subscriptions/timeline">
        <li class="beginhead">
              <img src="https://cdn2.jianshu.io/assets/web/jianyouquan-2fb0cd72e35147c79d6507c3a3a2591b.png">簡友圈
        </li>
      </router-link>
      <li v-for="friends in friendList"><div class="l1"><img v-bind:src="friends.img">{{friends.title}}<a>{{friends.guanzhu}}</a></div></li>
    </ul>
  </div>
</template>

<script>
    export default {
        name: "jianyouquan",
      data() {
          return {
            friendList:[
              {
                "img":"https://upload.jianshu.io/collections/images/16/computer_guy.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/120/h/120/format/webp",
                "title":"程序員",
                "guanzhu":88
              },
              {
                "img":"https://upload.jianshu.io/collections/images/16/computer_guy.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/120/h/120/format/webp",
                "title":"程序員",
                "guanzhu":88
              },
              {
                "img":"https://upload.jianshu.io/collections/images/16/computer_guy.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/120/h/120/format/webp",
                "title":"程序員",
                "guanzhu":88
              },
              {
                "img":"https://upload.jianshu.io/collections/images/16/computer_guy.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/120/h/120/format/webp",
                "title":"程序員",
                "guanzhu":88
              },
              {
                "img":"https://upload.jianshu.io/collections/images/16/computer_guy.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/120/h/120/format/webp",
                "title":"程序員",
                "guanzhu":88
              },
              {
                "img":"https://upload.jianshu.io/collections/images/16/computer_guy.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/120/h/120/format/webp",
                "title":"程序員",
                "guanzhu":88
              },{
                "img":"https://upload.jianshu.io/collections/images/16/computer_guy.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/120/h/120/format/webp",
                "title":"程序員",
                "guanzhu":88
              },
              {
                "img":"https://upload.jianshu.io/collections/images/16/computer_guy.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/120/h/120/format/webp",
                "title":"程序員",
                "guanzhu":88
              },
              {
                "img":"https://upload.jianshu.io/collections/images/16/computer_guy.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/120/h/120/format/webp",
                "title":"程序員",
                "guanzhu":88
              }
            ]
          }
      }
    }
</script>

<style scoped>
  img {
    width: 40px;
    height: 40px;
    border-radius: 5px;
  }
  li {
    list-style-type: none;
    height: 60px;
    cursor: pointer;
    margin-top: 5px;
  }
  li:hover {
    background: gainsboro;
  }
  a {
    margin-left: 100px;
    text-decoration: none;
  }
  a:link {
    color: black;
  }
  .addguanzhu {
    margin-left: 5px;
    cursor: pointer;
  }
  .addguanzhu:link {
    color: black;
  }
  .beginhead {
    border-top-style: solid;
    border-top-color: gainsboro;
    margin-bottom: -20px;
  }
  .guanzhu {
    height: auto;
  }
  ul {
    height: 550px;
    width: 300px;
    overflow-y: scroll;
  }
  .main {
    margin-top: 50px;
  }

</style>
  • 消息頁面


    消息.png
<template>
    <div class="container">
      <ul class="col-md-4">
          <li>
            <router-link to="/notifications/comments">
            <div class="1">
              <img src="../../../static/img/評論.png">
              <a class="info">評論</a>
            </div>
            </router-link>
          </li>

        <router-link to="/notifications/jianxin">
          <li>
            <img src="../../../static/img/信息.png">
            <a>簡信</a>
          </li>
        </router-link>
        <li>
          <img src="../../../static/img/上傳-互動.png">
          <a>投稿請求</a>
        </li>
        <li>
          <img src="../../../static/img/喜歡.png">
          <a>喜歡和贊</a>
        </li>
        <li>
          <img src="../../../static/img/已關(guān)注.png">
          <a>關(guān)注</a>
        </li>
        <li>
          <img src="../../../static/img/錢.png">
          <a>贊賞和付費</a>
        </li>
        <li>
          <img src="../../../static/img/更多.png">
          <a>其它提醒</a>
        </li>
      </ul>
      <div class="col-md-8">
        <router-view>

        </router-view>
      </div>
    </div>
</template>

<script>
    export default {
        name: "Notifications"
    }
</script>

<style scoped>
  .col-md-4 {
    list-style-type: none;
    float: left;
  }
  li {
    cursor: pointer;
    width: 263.2px;
    height: 50.71px;
    border-radius: 5px;
  }
  li:hover {
    background: gainsboro;
  }
  .container {
    margin-top: 50px;
    display: inline-block;
  }
  a {
    /*margin-left: 10px;*/
    list-style-type: none;
  }
  a:hover {
    text-decoration: none;
  }
  a:link {
    color: black;
  }
  img {
    margin-top: 10px;
  }
  .col-md-8 {
    float: right;
  }
</style>

二級路由

{
          //消息組件
          path: '/notifications',
          component: resolve => require(['../components/page/Notifications.vue'], resolve),
          meta: {title: '消息'},
          children: [
            {
              path: '/notifications/comments',
              component: Comments,
              meta: {title: '收到的評論'}
            },
            {
              path: '/notifications/jianxin',
              component: Jianxin,
              meta: {title: '簡信'}
            }
          ]
        },

更多代碼請見我的GitHub

https://github.com/1094064939/JianshuFrontEnd

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末番舆,一起剝皮案震驚了整個濱河市矗愧,隨后出現(xiàn)的幾起案子垫竞,更是在濱河造成了極大的恐慌,老刑警劉巖奇昙,帶你破解...
    沈念sama閱讀 217,509評論 6 504
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異敌完,居然都是意外死亡储耐,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,806評論 3 394
  • 文/潘曉璐 我一進(jìn)店門滨溉,熙熙樓的掌柜王于貴愁眉苦臉地迎上來什湘,“玉大人,你說我怎么就攤上這事晦攒∶龀罚” “怎么了?”我有些...
    開封第一講書人閱讀 163,875評論 0 354
  • 文/不壞的土叔 我叫張陵脯颜,是天一觀的道長哟旗。 經(jīng)常有香客問我,道長,這世上最難降的妖魔是什么闸餐? 我笑而不...
    開封第一講書人閱讀 58,441評論 1 293
  • 正文 為了忘掉前任饱亮,我火速辦了婚禮,結(jié)果婚禮上舍沙,老公的妹妹穿的比我還像新娘近上。我一直安慰自己,他們只是感情好拂铡,可當(dāng)我...
    茶點故事閱讀 67,488評論 6 392
  • 文/花漫 我一把揭開白布壹无。 她就那樣靜靜地躺著,像睡著了一般和媳。 火紅的嫁衣襯著肌膚如雪格遭。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,365評論 1 302
  • 那天留瞳,我揣著相機(jī)與錄音拒迅,去河邊找鬼。 笑死她倘,一個胖子當(dāng)著我的面吹牛璧微,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播硬梁,決...
    沈念sama閱讀 40,190評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼前硫,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了荧止?” 一聲冷哼從身側(cè)響起屹电,我...
    開封第一講書人閱讀 39,062評論 0 276
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎跃巡,沒想到半個月后危号,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,500評論 1 314
  • 正文 獨居荒郊野嶺守林人離奇死亡素邪,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,706評論 3 335
  • 正文 我和宋清朗相戀三年外莲,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片兔朦。...
    茶點故事閱讀 39,834評論 1 347
  • 序言:一個原本活蹦亂跳的男人離奇死亡偷线,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出沽甥,到底是詐尸還是另有隱情声邦,我是刑警寧澤,帶...
    沈念sama閱讀 35,559評論 5 345
  • 正文 年R本政府宣布摆舟,位于F島的核電站翔忽,受9級特大地震影響英融,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜歇式,卻給世界環(huán)境...
    茶點故事閱讀 41,167評論 3 328
  • 文/蒙蒙 一驶悟、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧材失,春花似錦痕鳍、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,779評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至旨别,卻和暖如春诗赌,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背秸弛。 一陣腳步聲響...
    開封第一講書人閱讀 32,912評論 1 269
  • 我被黑心中介騙來泰國打工铭若, 沒想到剛下飛機(jī)就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人递览。 一個月前我還...
    沈念sama閱讀 47,958評論 2 370
  • 正文 我出身青樓叼屠,卻偏偏與公主長得像,于是被迫代替她去往敵國和親绞铃。 傳聞我的和親對象是個殘疾皇子镜雨,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 44,779評論 2 354

推薦閱讀更多精彩內(nèi)容