Skip to content

QSelect no-option template does not work with Typescript #14669

Discussion options

You must be logged in to vote

Here is a clean TypeScript version for anyone that may need it.

import { defineComponent, ref, Ref } from "vue";
import { QSelect, QSelectProps } from "quasar";

const stringOptions = [
  "quasarframework/quasar",
  "quasarframework/quasar-awesome"
];

interface INavbarSearchOptions {
  label: string;
}
interface INavbarSearchFilteredOptions extends INavbarSearchOptions {
  type: string;
}

export default defineComponent({
  name: "NavbarSearch",
  setup: () => {
    const search = ref(null) as Ref<QSelect | null>;
    const searchText = ref("");
    const options = ref<string[] | null>(null);
    const filteredOptions = ref<Array<INavbarSearchOptions | INavbarSearchFilteredOptions>>([]);

Replies: 5 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@pdanpdan
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@engineertdog
Comment options

@engineertdog
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by engineertdog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants
Converted from issue

This discussion was converted from issue #14666 on October 20, 2022 14:24.