Skip to content

Instantly share code, notes, and snippets.

@Aybee5
Forked from spemer/App.vue
Last active October 14, 2019 18:08
Show Gist options
  • Save Aybee5/a6f9cef26962dedc9bd79a8ad0524d22 to your computer and use it in GitHub Desktop.
Save Aybee5/a6f9cef26962dedc9bd79a8ad0524d22 to your computer and use it in GitHub Desktop.

Revisions

  1. Aybee5 revised this gist Oct 14, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions App.vue
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,7 @@
    <h1> {{ user.name }} </h1>
    <p> {{ user.email }} </p>
    <button> (@click="fetchUsers") Click me! </button>
    </div>
    </template>

    <script>
  2. Aybee5 revised this gist Oct 14, 2019. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions App.vue
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    <template lang="pug">
    div#app
    div(
    <div id="app">
    <div
    v-for="user in users"
    :key="users.id"
    )
    h1 {{ user.name }}
    p {{ user.email }}
    button(@click="fetchUsers") Click me!
    >
    <h1> {{ user.name }} </h1>
    <p> {{ user.email }} </p>
    <button> (@click="fetchUsers") Click me! </button>
    </template>

    <script>
  3. @spemer spemer revised this gist Aug 25, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion App.vue
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,7 @@ export default {
    methods: {
    fetchUsers: function () {
    const baseURI = 'https://jsonplaceholder.typicode.com/users'
    this.$http.get('${baseURI}')
    this.$http.get(baseURI)
    .then((result) => {
    this.users = result.data
    })
  4. @spemer spemer revised this gist Aug 16, 2018. 1 changed file with 6 additions and 4 deletions.
    10 changes: 6 additions & 4 deletions App.vue
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,9 @@
    <template lang="pug">
    div#app
    div(v-for="user in users" :key="users.id")
    div(
    v-for="user in users"
    :key="users.id"
    )
    h1 {{ user.name }}
    p {{ user.email }}
    button(@click="fetchUsers") Click me!
    @@ -16,10 +19,9 @@ export default {
    },
    methods: {
    fetchUsers: function () {
    let baseURI = 'https://jsonplaceholder.typicode.com'
    this.$http.get('${baseURI}/users')
    const baseURI = 'https://jsonplaceholder.typicode.com/users'
    this.$http.get('${baseURI}')
    .then((result) => {
    console.log(result)
    this.users = result.data
    })
    }
  5. @spemer spemer revised this gist Aug 4, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion App.vue
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,7 @@ export default {
    },
    methods: {
    fetchUsers: function () {
    const baseURI = 'https://jsonplaceholder.typicode.com'
    let baseURI = 'https://jsonplaceholder.typicode.com'
    this.$http.get('${baseURI}/users')
    .then((result) => {
    console.log(result)
  6. @spemer spemer renamed this gist Aug 4, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  7. @spemer spemer created this gist Aug 4, 2018.
    41 changes: 41 additions & 0 deletions app.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,41 @@
    <template lang="pug">
    div#app
    div(v-for="user in users" :key="users.id")
    h1 {{ user.name }}
    p {{ user.email }}
    button(@click="fetchUsers") Click me!
    </template>

    <script>
    export default {
    name: 'app',
    data () {
    return {
    users: []
    }
    },
    methods: {
    fetchUsers: function () {
    const baseURI = 'https://jsonplaceholder.typicode.com'
    this.$http.get('${baseURI}/users')
    .then((result) => {
    console.log(result)
    this.users = result.data
    })
    }
    }
    }
    <script>

    <style lang="scss">
    #app {
    font-family: 'Avenir', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: left;
    width: 640px;
    margin: 0 auto;
    color: #2c3e50;
    margin-top: 60px;
    }
    </style>