budibase/packages/builder/src/components/userInterface/ScreenSelect.svelte

22 lines
507 B
Svelte
Raw Normal View History

<script>
import { createEventDispatcher } from "svelte"
import { store } from "builderStore"
import OptionSelect from "./OptionSelect.svelte"
const dispatch = createEventDispatcher()
export let value = ""
function handleSelect(selected) {
value = selected
dispatch("change", value)
}
let options = $store.allScreens.map(s => ({
value: s.route,
label: s.props._instanceName,
}))
</script>
<OptionSelect {options} {value} onChange={handleSelect} />