Skip to content

Instantly share code, notes, and snippets.

@Kaperskyguru
Last active July 20, 2020 12:58
Show Gist options
  • Save Kaperskyguru/660015e04f77d32211d6ac0aa461b3ea to your computer and use it in GitHub Desktop.
Save Kaperskyguru/660015e04f77d32211d6ac0aa461b3ea to your computer and use it in GitHub Desktop.
<script>
import { mapGetters } from "vuex";
import ErrorService from "../Services/ErrorService";
export default {
name: "HelloWorld",
props: {
todo: Object,
},
computed: {
...mapGetters(["getUser"]),
},
methods: {
getUserName(id) {
const user = this.getUser(id);
if (user) return user.username;
},
// Display Error with SweetAlert (when Name is Click)
displayAlert() {
ErrorService.displayErrorAlert("Testing message");
},
},
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment