File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
packages/vue-vuetify/src/controls/components Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 17
17
</v-badge >
18
18
</template >
19
19
20
- <p >{{ t('Validation Errors', 'Validation Errors') }}</p >
20
+ <p >
21
+ {{
22
+ t ? t('Validation Errors', 'Validation Errors') : 'Validation Errors'
23
+ }}
24
+ </p >
21
25
<p
22
26
v-for =" (message, index) in tooltipMessages"
23
27
:key =" `${tooltipMessages.length}-${index}`"
31
35
</template >
32
36
33
37
<script lang="ts">
34
- import { defineComponent , type PropType } from ' vue' ;
38
+ import { defineComponent , inject , type PropType } from ' vue' ;
35
39
import { VBadge , VTooltip } from ' vuetify/components' ;
36
40
import type { ErrorObject } from ' ajv' ;
37
41
import findIndex from ' lodash/findIndex' ;
38
42
import {
39
43
createControlElement ,
40
44
createLabelDescriptionFrom ,
45
+ type JsonFormsSubStates ,
41
46
type JsonSchema ,
42
47
} from ' @jsonforms/core' ;
43
48
import { useTranslator } from ' @/util' ;
@@ -118,8 +123,13 @@ export default defineComponent({
118
123
},
119
124
},
120
125
setup() {
121
- const t = useTranslator ();
126
+ // allow using the ValidationBadge outside the jsonforms like in the ExampleView in the demo app
127
+ const jsonforms = inject <JsonFormsSubStates | undefined >(
128
+ ' jsonforms' ,
129
+ undefined ,
130
+ );
122
131
132
+ const t = jsonforms !== undefined ? useTranslator () : null ;
123
133
return { t };
124
134
},
125
135
});
You can’t perform that action at this time.
0 commit comments