-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add copy of object in use-input-state.ts
- Loading branch information
Showing
8 changed files
with
128 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<template> | ||
<div> | ||
<input-field name = "X" label = "X"/> | ||
<input-field name = "Y" label = "Y"/> | ||
|
||
{{values}} | ||
</div> | ||
</template> | ||
|
||
<script setup lang = "ts"> | ||
import {InputField, useFormValues, useProxyState} from "../../../plugin"; | ||
const props = defineProps<{ | ||
name: string, | ||
}>() | ||
const {form} = useProxyState(props.name) | ||
const values = useFormValues(form) | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<template> | ||
<div class="container-input-file"> | ||
<p>UPLOADING FILE</p> | ||
<input class="widget-input-file" type="file" @change="onInput"/> | ||
{{modelValue}} | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
interface Props { | ||
modelValue: any | ||
} | ||
const props = defineProps<Props>() | ||
const emit = defineEmits<{ | ||
(event: 'update:modelValue', file: any):void | ||
}>(); | ||
function onInput(event: any) { | ||
const file = event.target.files[0]; | ||
console.log(file) | ||
emit('update:modelValue', Object.freeze(file)) | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.container-input-file { | ||
display: flex; | ||
background-color: red; | ||
} | ||
.button-upload-file { | ||
display: grid; | ||
place-content: center; | ||
border: 2px dashed gray; | ||
height: 35px; | ||
width: 100px; | ||
position: relative; | ||
cursor: pointer; | ||
border-radius: 4px; | ||
} | ||
.widget-input-file { | ||
opacity: 0; | ||
position: absolute; | ||
width: 100%; | ||
height: 100%; | ||
z-index: 1; | ||
cursor: pointer; | ||
} | ||
.widget-input-file::-webkit-file-upload-button { | ||
display: none; | ||
color: gray; | ||
} | ||
.button-upload-file__label { | ||
font-size: 14px; | ||
} | ||
.button-upload-file_wait { | ||
cursor: default; | ||
border-color: blue; | ||
} | ||
.button-upload-file_error { | ||
border-color: red; | ||
} | ||
.button-upload-file_wait:after { | ||
content: ""; | ||
position: absolute; | ||
z-index: 1; | ||
height: 100%; | ||
width: 100%; | ||
top: 0; | ||
left: 0; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters