Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- props: {
- alertType: {
- validator: function (value) {
- return [ "success", "info", "warning", "danger" ].indexOf(value) >= 0;
- },
- default: "danger"
- },
- // Some more things
- computed: {
- classes: { //Compute the correct classes for the alert type
- var classesObj ={
- 'alert-dismissible': this.dismissable
- };
- classesObj["alert-"+this.alertType]=true; //Problem if invalid
- return classesObj;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement