options
Description
specifies a set of data items that will be used as rich select optionsType
array
Example
<script>
const dataset = [
{id:1, name:"First option"},
{id:2, name:"Second option"},
{id:3, name:"Third option"}
]
</script>
<RichSelect options={dataset} value={1} />
Details
It is also possible to put data in a separate file and specify the name of the data set as a value of the options property of RichSelect:
userlist.js
export const users = [
{id:1, name:"name1"},
{id:2, name:"name2"}
]
App.svelte
<script>
import { RichSelect } from "wx-svelte-core";
import { users } from "../your_data/userlist";
</script>
<RichSelect options={users} value={1}/>
Related article: Loading options
Related sample: RichSelect