Compare commits

...

1 Commits

Author SHA1 Message Date
Ahmed Darrazi
01c0996c71 fix(vue): add lang attrs, fix ESLint issues in Vue components
Some checks failed
tests / ci (pull_request) Failing after 5m27s
linter / quality (pull_request) Successful in 58s
2026-01-03 05:15:04 +01:00
4 changed files with 14 additions and 11 deletions

View File

@ -4,7 +4,7 @@
</div> </div>
</template> </template>
<script setup> <script setup lang="ts">
import { ref, onMounted, onBeforeUnmount, watch } from 'vue'; import { ref, onMounted, onBeforeUnmount, watch } from 'vue';
const props = defineProps({ const props = defineProps({
@ -23,7 +23,7 @@ const height = 800;
let isPanning = false; let isPanning = false;
let start = { x: 0, y: 0 }; let start = { x: 0, y: 0 };
let offset = { x: 0, y: 0 }; const offset = { x: 0, y: 0 };
let scale = 1; let scale = 1;
let pinchActive = false; let pinchActive = false;
let lastDistance = 0; let lastDistance = 0;
@ -186,7 +186,7 @@ onMounted(() => {
drawGrid(); drawGrid();
}); });
c.addEventListener('pointerup', (e) => { c.addEventListener('pointerup', () => {
if (selecting && selection) { if (selecting && selection) {
// finalize selection and emit one last time // finalize selection and emit one last time
const relX = selection.x - offset.x; const relX = selection.x - offset.x;

View File

@ -9,7 +9,9 @@
</aside> </aside>
</template> </template>
<script setup> <script setup lang="ts">
import { computed } from 'vue';
const props = defineProps({ const props = defineProps({
cellCount: { type: Number, default: 0 }, cellCount: { type: Number, default: 0 },
pricePerCell: { type: Number, default: 0 }, pricePerCell: { type: Number, default: 0 },

View File

@ -14,17 +14,18 @@
</div> </div>
</template> </template>
<script setup> <script setup lang="ts">
import { ref } from 'vue'; import { ref } from 'vue';
const props = defineProps({ selection: { type: Object, default: null } }); defineProps({ selection: { type: Object, default: null } });
const preview = ref(null); const preview = ref<string | null>(null);
function onFile(e) { function onFile(e: Event) {
const file = e.target.files && e.target.files[0]; const input = e.target as HTMLInputElement | null;
const file = input && input.files ? input.files[0] : null;
if (!file) return; if (!file) return;
const reader = new FileReader(); const reader = new FileReader();
reader.onload = (ev) => { reader.onload = (ev) => {
preview.value = ev.target.result; preview.value = ev.target && (ev.target as FileReader).result as string | null;
}; };
reader.readAsDataURL(file); reader.readAsDataURL(file);
} }

View File

@ -19,7 +19,7 @@
</div> </div>
</template> </template>
<script setup> <script setup lang="ts">
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
import GridCanvas from '@/components/GridCanvas.vue'; import GridCanvas from '@/components/GridCanvas.vue';
import SelectionSidebar from '@/components/SelectionSidebar.vue'; import SelectionSidebar from '@/components/SelectionSidebar.vue';