Custom Quasar2 QSelect app ver01 2022_0401- April 25,2022
yarn
# or
npm installquasar devyarn lint
# or
npm run lintyarn format
# or
npm run formatquasar buildSee Configuring quasar.config.js.
version: "0.1.0" Notes;
Demonstrates how to create a qSelect child component using; vue 3 + Quasar 2 + v-model + Typescript + interface.
In my app, I have a dozen fixed rarely-changing selection lists. My database contains a table for each of these selections lists. My admin panel preform CRUD actions to these select database tables. These database tables always has the same three fields; id, label, and description. This simplifies the crud UI editors for the different select-tables, as I don't have to create a different ui for each select-database-table.
During the build process, the json optionsArr is generated as a static array + .vue file and the .vue file is auto-generated into specialized middleware select components. For example, one select is for allowed color-schemes, another select is a list of features, etc.
/src/pages/indexPage.vue - Parent Component /src/components/CustomQselectComponent.vue - custom qSelect child component /src/components/models.ts - an interface model used by both the parent and child via v-model
props.title: Heading on component
props.qsname: the name prop for the qselect
props.qslabel: The "type of select", like "address" or "Color Scheme" NOTE: The component changes the label on the qselect as follows; a) when mounted it is ('Select a ' + props.qslabel + '...') B) after the user has selected an item, it changes to: (props.qslabel + ':')
props.optionsArr: Array of objects for the select-list. To change the fields in each object, modify the models.ts file.
props.model: contains the results using vue3's v-model's two-way binding.
Create middleware select components that handles specific select types.