fix: 完成首页静态展示内容

This commit is contained in:
MTrun
2021-12-19 19:19:46 +08:00
parent c1daa231b6
commit f37ed1f3d3
29 changed files with 565 additions and 138 deletions
+38 -1
View File
@@ -1,4 +1,4 @@
import { h, DefineComponent } from 'vue'
import { h } from 'vue'
import { NIcon } from 'naive-ui'
/**
@@ -18,6 +18,43 @@ export const renderIcon = (icon: any) => {
return () => h(NIcon, null, { default: () => h(icon) })
}
/**
* * render 弹出确认框
* @param { Function } dialogFn dialog函数,暂时必须从页面传过来
* @param { Object} params 配置参数
*/
export const goDialog = (
dialogFn: Function,
params: {
// 基本
type: 'delete'
message?: string
onPositiveCallback?: Function
onNegativeCallback?: Function
// 渲染函数
render?: boolean
contentFn?: Function
actionFn?: Function
}
) => {
const { type, message, onPositiveCallback, onNegativeCallback } = params
const tip = {
delete: '是否删除此数据'
}
dialogFn({
title: '提示',
content: message || tip[type] || '',
positiveText: '确定',
negativeText: '取消',
onPositiveClick: () => {
onPositiveCallback && onPositiveCallback()
},
onNegativeClick: () => {
onNegativeCallback && onNegativeCallback()
}
})
}
/**
* * 处理 vite 中无法使用 require 的问题
* @param name