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.
vue-elementui-dialog-fun
Advanced tools
npm install vue-elementui-dialog-fun
import dialog from 'vue-elementui-dialog-fun'
Vue.use(dialog)
该函数有两个参数:
component: 是一个需要用弹窗打开的组件
options: 一个配置选项,对象格式
{
title:弹窗的一级标题,
preTitle:弹窗的二级标题,
width:弹窗的宽度, 字符串形式 , 例: '300px',
dialogParams: 一个对象数据,用于传递数据给弹窗组件 例: {ahe:12}, 则在对应的打开的组件可以从props中取,props:['dialogParams']
}
函数返回一个promise对象
this.$dialog(component,options).then((res)=>{
// 返回的数据 将弹窗的数据传递出来 res 就是 ok(params) 调用时的参数
consloe.log(res)
})
当使用Vue.use()注册该插件时,已经在全局混入
{
props: ['dialogParams'],
data(){
return {
model,
}
},
methods: {
//取消
cancel() {
},
//确定
ok(params) {
},
}
}
切勿变量冲突,
在需要打开的组件中 使用dialogParams来获取函数调用时传递过来的数据,使用 ok() 或者 cancel() 来关闭弹窗,并且ok()函数有一个参数用于返回数据
FAQs
基于element-ui dialog组件的函数化实现
We found that vue-elementui-dialog-fun demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.