Merge branch 'main' into chore/plugins
This commit is contained in:
@@ -177,15 +177,15 @@ const computedProps = computed(() => {
|
||||
|
||||
// 自定义帮助信息
|
||||
const computedHelp = computed(() => {
|
||||
return help ? onHelpFunc : undefined;
|
||||
});
|
||||
|
||||
const onHelpFunc = () => {
|
||||
if (!help) {
|
||||
const helpContent = help;
|
||||
if (!helpContent) {
|
||||
return undefined;
|
||||
}
|
||||
return isFunction(help) ? help(values.value, formApi!) : help;
|
||||
};
|
||||
return () =>
|
||||
isFunction(helpContent)
|
||||
? helpContent(values.value, getFormApi())
|
||||
: helpContent;
|
||||
});
|
||||
|
||||
watch(
|
||||
() => computedProps.value?.autofocus,
|
||||
|
||||
@@ -12,7 +12,7 @@ import type {
|
||||
|
||||
import { computed, useAttrs } from 'vue';
|
||||
// @ts-expect-error - vue-json-viewer does not expose compatible typings for this import path
|
||||
import VueJsonViewer from 'vue-json-viewer';
|
||||
import VueJsonViewerImport from 'vue-json-viewer';
|
||||
|
||||
import { $t } from '@vben/locales';
|
||||
|
||||
@@ -42,6 +42,11 @@ const emit = defineEmits<{
|
||||
valueClick: [value: JsonViewerValue];
|
||||
}>();
|
||||
|
||||
/** CJS/UMD 在 Vite 下解析为 { default: Component },需解包否则会出现 missing template or render */
|
||||
const VueJsonViewer =
|
||||
(VueJsonViewerImport as { default?: typeof VueJsonViewerImport }).default ??
|
||||
VueJsonViewerImport;
|
||||
|
||||
const attrs: SetupContext['attrs'] = useAttrs();
|
||||
|
||||
function handleClick(event: MouseEvent) {
|
||||
|
||||
Reference in New Issue
Block a user