-
Notifications
You must be signed in to change notification settings - Fork 26
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
I have integrated the core version to Naive UI
I hope this helps.
<script setup lang="ts">
import { computed } from "vue"
const props = defineProps<{
cron: string
}>()
const emit = defineEmits<{
(event: "update:cron", arg: string): void
}>()
const val = computed({
get() {
return props.cron
},
set(value) {
emit("update:cron", value)
},
})
</script>
<template>
<cron-core v-model="val" v-slot="{ fields, period }">
<n-space align="center">
<!-- period selection -->
{{ period.prefix }}
<n-space>
<n-select
:options="period.items"
:value="period.attrs.modelValue"
label-field="text"
value-field="id"
@update:value="(_: any, $value: typeof period) => period.events['update:model-value']($value.id)"
style="width: 200px"
/>
</n-space>
{{ period.suffix }}
<!-- cron expression fields -->
<template v-for="f in fields" :key="f.id">
{{ f.prefix }}
<n-space>
<n-select
:options="f.items"
:value="f.attrs.modelValue"
label-field="text"
value-field="value"
multiple
@update:value="($e: typeof f) => f.events['update:model-value']($e)"
style="width: 200px"
:placeholder="f.selectedStr"
/>
</n-space>
{{ f.suffix }}
</template>
</n-space>
</cron-core>
</template>
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request