@xizs/nuxt-antui 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ import zhCN from 'ant-design-vue/es/locale/zh_CN';
2
+
3
+ export const useAntLocale = () => useState(() => {
4
+ return zhCN
5
+ })
@@ -1,6 +1,8 @@
1
1
  import { createVNode, render } from "vue"
2
2
  import Form from "../components/global/Form"
3
- import { AModal } from "#components"
3
+ import { AConfigProvider, AModal } from "#components"
4
+
5
+ import zhCN from 'ant-design-vue/es/locale/zh_CN';
4
6
 
5
7
  export const NormalModal = (el) => {
6
8
  let control = { close: () => { } }
@@ -12,27 +14,29 @@ export const NormalModal = (el) => {
12
14
  control.close = () => {
13
15
  open.value = false
14
16
  }
15
- return () => h(el, {
16
- open: open.value, // 等价于 v-model:open
17
- 'onUpdate:open': (val: boolean) => {
18
- open.value = val
19
- if (!val) {
20
- setTimeout(() => {
21
- render(null, container) // 卸载组件
22
- if (container.parentNode) {
23
- container.parentNode.removeChild(container) // 移除 DOM
24
- }
25
- }, 1000);
26
- }
27
- },
28
- })
17
+ return () => h(AConfigProvider, { locale: useAntLocale().value }, [
18
+ h(el, {
19
+ open: open.value, // 等价于 v-model:open
20
+ 'onUpdate:open': (val: boolean) => {
21
+ open.value = val
22
+ if (!val) {
23
+ setTimeout(() => {
24
+ render(null, container) // 卸载组件
25
+ if (container.parentNode) {
26
+ container.parentNode.removeChild(container) // 移除 DOM
27
+ }
28
+ }, 1000);
29
+ }
30
+ },
31
+ })
32
+ ])
29
33
  }
30
34
  })
31
35
 
32
36
  const vnode = h(com)
33
37
  vnode.appContext = useNuxtApp().vueApp._context
34
38
  render(vnode, container)
35
- document.body.appendChild(container)
39
+ // document.getElementById('aaaa')!.appendChild(container)
36
40
 
37
41
  return control
38
42
 
@@ -55,32 +59,6 @@ export const FormModal = (params: FormModalParamsType) => {
55
59
 
56
60
  let submit: () => void
57
61
 
58
- // let control = NormalModal(h(AModal,{
59
- // title: params.title,
60
- // okText: '提交'+loading?.value,
61
- // cancelText: '取消',
62
- // onOk: async ()=>{
63
- // await submit()
64
- // control.close()
65
- // }
66
-
67
- // },h(defineComponent({
68
- // setup(){
69
- // let formRef = ref(null)
70
-
71
- // onMounted(()=>{
72
- // submit = formRef.value.submit
73
- // loading = formRef.value.loading
74
- // })
75
-
76
- // return ()=>h(Form,{
77
- // ref: formRef,
78
- // form: params.form,
79
- // submit:params.submit,
80
- // showSubmit: false
81
- // })
82
- // }
83
- // }))))
84
62
 
85
63
  let control = NormalModal(h(defineComponent({
86
64
  setup() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xizs/nuxt-antui",
3
3
  "type": "module",
4
- "version": "0.0.7",
4
+ "version": "0.0.8",
5
5
  "main": "./nuxt.config.ts",
6
6
  "scripts": {
7
7
  "dev": "nuxi dev .playground",