Created
August 31, 2019 05:03
-
-
Save jsdecena/791a2cf88bb4639ea83240a6a4efec3f to your computer and use it in GitHub Desktop.
All
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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