UNPKG

@cran/lib.vue.ref

Version:

Vue Reactivity Extensions

13 lines (12 loc) 348 B
import { computed } from "vue"; import { unwrap } from "../utility"; /** * @since 0.0.1 * @category Array * @inheritdoc Array#indexOf */ export function useIndexOf(values, searchElement, fromIndex) { return computed(function compute() { return unwrap(values).map(unwrap).indexOf(unwrap(searchElement), unwrap(fromIndex)); }); }