Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A simple style useful dialog component collection for Vue3
If you are using vue 2.x version, please use v-dialogs 2.x version instead
Documentation and examples please visit below sites
DialogModalBox
and DialogDrawerBox
component formChinese
, English
, Japanese
and Portuguese
# npm
npm i v-dialogs
# yarn
yarn add v-dialogs
# pnpm
pnpm add v-dialogs
type MessageContent = string | VNode
type ComponentResult = VNode | Component
type ComponentContent = ComponentResult | (() => ComponentResult)
function DialogAlert(message?: MessageContent, callback?: Function, options?: AlertOptions): Function
function DialogMessage(message?: MessageContent, callback?: Function, options?: MessageOptions): Function
function DialogToast(message?: MessageContent, callback?: Function, options?: ToastOptions): Function
function DialogMask(message?: MessageContent, callback?: Function, options?: MaskOptions): Function
function DialogModal(component: ComponentContent, options?: ModalOptions): Function
function DialogDrawer(component: ComponentContent, options?: DrawerOptions): Function
import { DialogAlert, DialogMessage } from 'v-dialogs'
function deleteUser (userId) {
DialogAlert('Deleted data cannot be recovered, are you sure?', () => {
executeDeleteUser(userId).then(() => {
DialogMessage('Delete complete.', { messageType: 'success' })
})
}, { messageType: 'confirm' })
}
import { DialogModal, DialogAlert } from 'v-dialogs'
import UserProfile from './UserProfile.vue'
DialogModal(UserProfile, {
width: 900,
height: 600,
title: 'User Profile',
params: {
userId: 1,
userName: 'Terry Zeng'
},
callback: data => {
DialogAlert(`Received message: ${data}`)
}
})
<template>
<div>
<DialogDrawerBox v-model:visible="visible" >
<UserProfile />
</DialogDrawerBox>
<button
type="button"
@click="openDialog"
>Open Drawer</button>
</div>
</template>
<script setup>
import { ref } from 'vue'
import { DialogDrawerBox } from 'v-dialogs'
import UserProfile from './UserProfile.vue'
const visible = ref(false)
function openDialog () {
visible.value = true
}
</script>
import { DialogMask, DialogMessage, DialogAlert } from 'v-dialogs'
function loadDataList () {
const destroy = DialogMask()
fetchData()
.then(data => {
list.value = data.list
// Dismiss mask overlay
destroy()
DialogMessage('Data loaded successfully', { messageType: 'success' })
})
.catch(() => {
DialogAlert('Data Load Failure', { messageType: 'error' })
})
}
Alert, Message and Toast types provides message type quick access function
import {
DialogMessage
DialogMessageSuccess
} from 'v-dialogs'
DialogMessageSuccess('Saved successfully!')
// Equivalent to
DialogMessage('Saved successfully!', { messageType: 'success' })
v-dialogs
also provides a globally instance to open dialogs, you can use it in any component
The default instance name is $dlg
import { createApp } from 'vue'
import dialogs from 'v-dialogs'
import App from 'App.vue'
createApp(App).use(dialogs).mount('#app')
The global instance are only supported as a feature and are not recommended for use
export default {
mounted () {
this.$dlg.message('Saved successfully!')
}
}
import { getCurrentInstance } from 'vue'
// const $dlg = getCurrentInstance().appContext.config.globalProperties.$dlg
const $dlg = getCurrentInstance().proxy.$dlg
$dlg.message('Saved successfully!')
3.0.0 (2024-07-06)
header
prop to set the display of the header, title
prop is only used to set the header text contentshake
prop to set whether to apply the shaking animation reminder for area operations outside the dialogcloseTime
rename to duration
colorfulShadow
prop to specify whether to display the corresponding color shadow for warning
、error
and success
message typespill
prop to set whether to apply pill style to content panelicon
prop to set whether display loading iconpanel
prop to set whether to display the content panel. If it is turned off, the content will be displayed directly on the maskappendTo
prop to specify the target area to be covered by the maskoffset
prop set the distance between the dialog box and the edge of the screenposition
rename to placement
, and removed two center placement optionsDialogModalBox
component form of useFAQs
A simple style useful dialog component collection for Vue3
The npm package v-dialogs receives a total of 83 weekly downloads. As such, v-dialogs popularity was classified as not popular.
We found that v-dialogs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.