Simple Modal window Vue.js component

栏目: IT技术 · 发布时间: 3年前

内容简介:Simple Modal window Vue.js component that takes care of overlay, centering, animation, outside click/Can be used for alerts, modals, dialogs etc.

Modal Window

Simple Modal window Vue.js component that takes care of overlay, centering, animation, outside click/ Escape key/ X-mark closing and allows you to concentrate on its content only

Simple Modal window Vue.js component

Can be used for alerts, modals, dialogs etc.

How to use

You can install it via npm

npm install @vuesence/modal-window --save

or just copy/paste ModalWindow.vue component code into your Vue.js project

Usage:

<template>
	<div id="app">
		<p>Click the button to open modal window</p>
		<button @click="showModal = true">Open Modal</button>		
		<modal-window
			:visible="showModal"
			:close-on-escape="true"
			:close-on-outside-click="true"
			:show-x-mark="true"
			@close="showModal = false"
		>
			<h2>Modal window</h2>
			<p>Here be content</p>
		</modal-window>
	</div>
</template>
import ModalWindow from "@vuesence/modal-window";
...
	data() {
		return {
			showModal: false
		};
	}

All the props ( close-on-escape , close-on-outside-click , show-x-mark ) are optional. Above listed their default values

showModal property is used to open\close the window

There can be several instances of the ModalWindow.vue

Styling and animation can be customized - check out ModalWindow.vue 's <style> section for CSS class names

Demo

https://altrusl.github.io/vuesence-modal-window/

Playground

Try it on codesandbox.io

Check out my other Vue.js components

  • Vuesence book - minimalistic Vue.js based documentation component
  • Sliding header - Vue.js component representing sliding header (or two different headers)
  • Cloud Sync Button - a button with cloud synchronization animation

You like Vuesence Modal Window? Star it and retweet it!

Troubleshooting

Any bugs, issues, feature and pull requests are welcome

Please use GitHub's issue reporter or send me an email

Contribution

Contribution is always welcome and recommended. Here is how:

  • Fork the repository
  • Clone to your machine
  • Make your changes
  • Create a pull request

License

@vuesence/modal-windowpackage is freely distributable under the terms of the MIT license .


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

百面机器学习

百面机器学习

诸葛越、葫芦娃 / 人民邮电出版社 / 2018-8-1 / 89.00元

人工智能领域正在以超乎人们想象的速度发展,本书赶在人工智能彻底占领世界之前完成编写,实属万幸。 书中收录了超过100道机器学习算法工程师的面试题目和解答,其中大部分源于Hulu算法研究岗位的真实场景。本书从日常工作、生活中各种有趣的现象出发,不仅囊括了机器学习的基本知识 ,而且还包含了成为出众算法工程师的相关技能,更重要的是凝聚了笔者对人工智能领域的一颗热忱之心,旨在培养读者发现问题、解决问......一起来看看 《百面机器学习》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换