Home / File/ app.js — vue Source File

app.js — vue Source File

Architecture documentation for app.js, a javascript file in the vue codebase.

Entity Profile

Source Code

var apiURL = 'https://api.github.com/repos/vuejs/vue/commits?per_page=3&sha='

/**
 * Actual demo
 */

new Vue({
  el: '#demo',

  data: {
    branches: ['main', 'dev'],
    currentBranch: 'main',
    commits: null
  },

  created: function () {
    this.fetchData()
  },

  watch: {
    currentBranch: 'fetchData'
  },

  filters: {
    truncate: function (v) {
      var newline = v.indexOf('\n')
      return newline > 0 ? v.slice(0, newline) : v
    },
    formatDate: function (v) {
      return v.replace(/T|Z/g, ' ')
    }
  },

  methods: {
    fetchData: function () {
      var self = this
      var xhr = new XMLHttpRequest()
      xhr.open('GET', apiURL + self.currentBranch)
      xhr.onload = function () {
        self.commits = JSON.parse(xhr.responseText)
        console.log(self.commits[0].html_url)
      }
      xhr.send()
    }
  }
})

Frequently Asked Questions

What does app.js do?
app.js is a source file in the vue codebase, written in javascript.
Where is app.js in the architecture?
app.js is located at examples/classic/commits/app.js (directory: examples/classic/commits).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free