/
githubmirror
/
taro
Обзор
Документация
Войти
/
githubmirror
/
taro
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/taro-framework-solid/src/runtime/utils.ts
30 строк
596 B
phy-lei
feat: 将taro-plugin-solid与taro-plugin-react分离 (#15595)
03 июн 2024, 19:10
Не верифицирован
03 июн 2024, 19:10
324842a
Код
Авторство
О чём код?
import { Current } from '@tarojs/runtime' import { isArray } from '@tarojs/shared' export function ensureIsArray<T> (item: T | T[]): T[] { if (isArray(item)) { return item } else { return item ? [item] : [] } } /** * set writable, enumerable to true */ export function setDefaultDescriptor (obj: Record<string, any>) { obj.writable = true obj.enumerable = true return obj } /** * 设置入口的路由参数 * @param options 小程序传入的参数 */ export function setRouterParams (options) { Current.router = { params: options?.query, ...options, } }