Vue - Alerts

Developer
Size
2,398 Kb
Views
34,408

How do I make an vue - alerts?

What is a vue - alerts? How do you make a vue - alerts? This script and codes were developed by Kevin Sherman on 14 September 2022, Wednesday.

Vue - Alerts Previews

Vue - Alerts - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Vue - Alerts</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <alert>	<strong>General!</strong> Your account has been updated.
</alert>
<alert type="error">	<strong>Error!</strong> Your account has been updated.
</alert>
<alert type="success">	<strong>Success!</strong> Your account has been updated.
</alert>
<template id="alert-template">	<div :class="alertClasses" v-show="show">	<slot></slot>	<span class="alert__close" @click="show = false">X</span	<div>
</template> <script src='https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.26/vue.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Vue - Alerts - Script Codes CSS Codes

.alert { padding: 2rem; background-color: #eee; border: 1px solid #bbbbbb; position: relative; margin-bottom: 0.5rem;
}
.alert--error { background: #f5d6d6; border: 2px solid #d65c5c;
}
.alert--success { background: #e6ffe6; border: 2px solid #00b300;
}
.alert__close { position: absolute; top: 0.75rem; right: 1rem; font-size: 1.15rem; cursor: pointer; padding: 0.5rem;
}

Vue - Alerts - Script Codes JS Codes

Vue.component('alert', {	template: '#alert-template',	props: ['type'],	data: function() {	return {	show: true	};	},	computed: {	alertClasses: function() {	var type = this.type;	return {	'alert': true,	'alert--success': type == 'success',	'alert--error': type == 'error',	}	}	}
});
new Vue({	el: 'body',
})
Vue - Alerts - Script Codes
Vue - Alerts - Script Codes
Home Page Home
Developer Kevin Sherman
Username ksherman
Uploaded September 14, 2022
Rating 3
Size 2,398 Kb
Views 34,408
Do you need developer help for Vue - Alerts?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Kevin Sherman (ksherman) Script Codes
Create amazing sales emails with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!