This repository was archived by the owner on Jan 9, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +37
-54
lines changed Expand file tree Collapse file tree 4 files changed +37
-54
lines changed Original file line number Diff line number Diff line change 11<template >
22 <div >
3- <StyledDialog v- model =" model" />
3+ <slot : model =" model" :input = " onInput " />
44
5- <Btn @click =" open " >
6- Styled
5+ <Btn @click =" onInput(true) " >
6+ {{ label }}
77 </Btn >
88 </div >
99</template >
1010
1111<script lang="ts">
1212import { ref } from ' vue'
13-
1413import Btn from ' @/components/UI/Btn/Btn.vue'
15- import StyledDialog from ' ./StyledDialog.vue'
1614
1715export default {
18- name: ' StyledDialogWrapper ' ,
16+ name: ' DialogStateWrapper ' ,
1917 components: {
2018 Btn ,
21- StyledDialog ,
19+ },
20+
21+ props: {
22+ label: {
23+ type: String ,
24+ required: true ,
25+ },
2226 },
2327
2428 setup() {
2529 const model = ref (false )
2630
27- const open = () => {
28- model .value = true
31+ const onInput = (value : boolean ) => {
32+ model .value = value
2933 }
3034
3135 return {
3236 model ,
33- open ,
37+ onInput ,
3438 }
3539 },
3640}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ export default defineComponent({
4444 },
4545 },
4646
47+ emits: [' update:modelValue' ],
48+
4749 setup(props , { emit }) {
4850 const value = useModelWrapper (props , emit )
4951
Original file line number Diff line number Diff line change 11<template >
22 <div class =" flex wrap" >
3- <BaseDialogWrapper class =" mr-3" />
4- <StyledDialogWrapper />
3+ <DialogStateWrapper
4+ v-slot =" {model, input}"
5+ label =" Base"
6+ class =" mr-3"
7+ >
8+ <BaseDialog :model-value =" model" @update:model-value =" input" />
9+ </DialogStateWrapper >
10+
11+ <DialogStateWrapper
12+ v-slot =" {model, input}"
13+ label =" Styled"
14+ >
15+ <StyledDialog :model-value =" model" @update:model-value =" input" />
16+ </DialogStateWrapper >
517 </div >
618</template >
719
820<script lang="ts">
9- import BaseDialogWrapper from ' @/components/Dialogs/BaseDialog/BaseDialogWrapper.vue'
10- import StyledDialogWrapper from ' @/components/Dialogs/StyledDialog/StyledDialogWrapper.vue'
21+ import DialogStateWrapper from ' @/components/Dialog/DialogStateWrapper.vue'
22+ import BaseDialog from ' @/components/Dialogs/BaseDialog/BaseDialog.vue'
23+ import StyledDialog from ' @/components/Dialogs/StyledDialog/StyledDialog.vue'
1124
1225export default {
1326 name: ' DialogLayout' ,
1427 components: {
15- BaseDialogWrapper ,
16- StyledDialogWrapper ,
28+ DialogStateWrapper ,
29+ BaseDialog ,
30+ StyledDialog ,
1731 },
1832
19- setup() {
20- },
33+ setup() {},
2134}
2235 </script >
You can’t perform that action at this time.
0 commit comments