Skip to content

Instantly share code, notes, and snippets.

@SpencerCooley
Created January 27, 2018 03:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SpencerCooley/cafdc4c607b727983a048e8e9cf5b5de to your computer and use it in GitHub Desktop.
Save SpencerCooley/cafdc4c607b727983a048e8e9cf5b5de to your computer and use it in GitHub Desktop.
<template>
<div class="col-md-12">
<h1>Email crud</h1>
<div v-if="loading" class="animated-loader">Loading...</div>
</div>
</template>
<script>
export default {
props:{
options:{
type: Object,
required: true
},
},
data () {
return {
detail:this.options.detail,
loading:true,
errors:[],
}
},
methods: {
load(){
this.loading = true;
},
stopLoad(){
this.loading = false;
},
postSuccess(){
//what do you want to happen on a successful creation?
},
postFailure(){
//what do you want to happen on a failed creation?
},
putSuccess(){
//what do you want to happen on a successful update?
},
putFailure(){
//what do you want to happen on a failed update?
},
deleteSuccess(){
//what do you want to happen on a successful deletion?
},
deleteFailure(){
//what do you want to happen on a failed deletion?
},
createInfos(){
//implement axios to create an infos record
},
deleteInfos(){
//implement axios to delete an infos record
},
updateInfos(){
//implement axios to update an infos record
},
handleCorrectMethod(){
//based on what the action is set to, run the correct axios function.
if(this.options.action == 'create'){
this.createInfos();
}
if(this.options.action == 'delete'){
this.deleteInfos();
}
if(this.options.action == 'update'){
this.updateInfos();
}
},
submitContact(){
//simply test that this is triggered when it needs to be.
}
}
}
</script>
<style lang="scss">
@import '../colors';
.animated-loader,
.animated-loader:before,
.animated-loader:after {
background: $primary-contrast;
-webkit-animation: load1 1s infinite ease-in-out;
animation: load1 1s infinite ease-in-out;
width: 1em;
height: 4em;
}
.animated-loader {
color: $primary-contrast;
text-indent: -9999em;
margin: 88px auto;
position: relative;
font-size: 11px;
-webkit-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
-webkit-animation-delay: -0.16s;
animation-delay: -0.16s;
}
.animated-loader:before,
.animated-loader:after {
position: absolute;
top: 0;
content: '';
}
.animated-loader:before {
left: -1.5em;
-webkit-animation-delay: -0.32s;
animation-delay: -0.32s;
}
.animated-loader:after {
left: 1.5em;
}
@-webkit-keyframes load1 {
0%,
80%,
100% {
box-shadow: 0 0;
height: 4em;
}
40% {
box-shadow: 0 -2em;
height: 5em;
}
}
@keyframes load1 {
0%,
80%,
100% {
box-shadow: 0 0;
height: 4em;
}
40% {
box-shadow: 0 -2em;
height: 5em;
}
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment