We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SelectionAreaInstance
I want to get the current SelectionArea-instance in Vue3. My code is exactly the same as the sample code:
SelectionArea
<template> <SelectionArea class="container" :options="{selectables: '.selectable'}" ref="selectionAreaRef" > <div v-for="id of 42" class="selectable" :key="id" :data-key="id" :class="{selected: selected.has(id)}" /> </SelectionArea> </template> <script lang="ts" setup> import type {SelectionAreaInstance} from '@viselect/vue'; import {ref, reactive, onMounted} from 'vue'; const selected = reactive<Set<number>>(new Set()); const selectionAreaRef = ref<SelectionAreaInstance>() onMounted(() => { // log current selection console.log(selectionAreaRef.value?.selection) }) </script>
Cannot resolve symbol SelectionAreaInstance
Successfully imported type SelectionAreaInstance without error
Toolset (vite@5.4.1 vue@3.4.38): Version (@viselect/vanilla": "^3.5.1): Browser: Chrome 127.0.6533.120 OS: Windows11
The text was updated successfully, but these errors were encountered:
My bad, the correct way would be to use const selectionAreaRef = ref<InstanceType<typeof SelectionArea>>();
const selectionAreaRef = ref<InstanceType<typeof SelectionArea>>();
Sorry, something went wrong.
561fe26
Improve and update docs
860c3fc
Closes #232
simonwep
No branches or pull requests
What is the problem?
I want to get the current
SelectionArea
-instance in Vue3.My code is exactly the same as the sample code:
What is the current behavior?
Cannot resolve symbol
SelectionAreaInstance
Please provide the steps to reproduce and create a CodeSandbox.
What is the expected behavior?
Successfully imported type
SelectionAreaInstance
without errorYour environment:
The text was updated successfully, but these errors were encountered: