Vue timeout button
npm install vue-timeout-button
import VueTimeoutButton from 'vue-timeout-button';
Vue.use(VueTimeoutButton);
Simple:
<TimeoutButton class="red-button"
@click="submitButton"
duration="2">
Submit
</TimeoutButton>
Advanced:
<TimeoutButton class="red-button"
@click="submitButton"
@interrupting="clickedWhile"
@completed="buttonCompleted"
duration="3.5"
loading-text="Loading...">
Submit
</TimeoutButton>
Example style of the button
.red-button {
padding : 24px 24px;
background-color : #e74c3c;
color : #fff;
font-weight : 700;
width : 200px;
text-align : center;
}
.red-button:focus {
outline : none;
}
.red-button.loading {
cursor : default;
}
pascalhesselink.nl · GitHub PascalHesselink