Skip to content

Instantly share code, notes, and snippets.

@jsdecena
Created August 31, 2019 05:03
Show Gist options
  • Save jsdecena/791a2cf88bb4639ea83240a6a4efec3f to your computer and use it in GitHub Desktop.
Save jsdecena/791a2cf88bb4639ea83240a6a4efec3f to your computer and use it in GitHub Desktop.
All
<script>
import SystemInformation from './LandingPage/SystemInformation'
export default {
name: 'landing-page',
components: { SystemInformation },
data () {
return {
posts: [],
success: null
}
},
created () {
this.getPosts()
},
methods: {
open (link) {
this.$electron.shell.openExternal(link)
},
getPosts () {
const posts = JSON.parse(localStorage.getItem('posts'))
this.posts = posts
},
onDelete (id) {
this.posts.splice(id, 1)
localStorage.setItem('posts', JSON.stringify(this.posts))
this.success = 'Successfully deleted the post!'
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment