File: app/components/hackernews/userview/UserView.vue

Recommend this page to a friend!
  Classes of Sergey Beskorovayniy  >  Hackernews Vue  >  app/components/hackernews/userview/UserView.vue  >  Download  
File: app/components/hackernews/userview/UserView.vue
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Hackernews Vue
View information from Hackernews using Vue.js
Author: By
Last change:
Date: 5 years ago
Size: 1,339 bytes


Class file image Download
  <div class="user-view" v-show="user">
      <li><span class="label">user:</span> {{}}</li>
      <li><span class="label">created:</span> {{user.created | fromNow}} ago</li>
      <li><span class="label">karma:</span> {{user.karma}}</li>
        <span class="label">about:</span>
        <div class="about">
    <p class="links">
      <a :href="'' +">submissions</a><br>
      <a :href="'' +">comments</a>

import store from '../store'

export default {

  name: 'UserView',

  data () {
    return {
      user: {}

  route: {
    data ({ to }) {
      // Promise sugar syntax: return an object that contains Promise fields.
      document.title = 'Profile: ' + + ' | Vue.js HN Clone'
      return {
        user: store.fetchUser(

<style lang="stylus">
@import "../variables.styl"

  color $gray
    margin 5px 0
    display inline-block
    min-width 60px
    margin-top 1em
  .links a
    text-decoration underline