Function vueGetParamFromQuery

  • 从route.query中获取指定名称的参数信息,

    Parameters

    • query: Record<string, null | string | (null | string)[]>

      vue路由,route.query

    • param: string

      参数名

    Returns null | string

    const query = useRoute().query;
    const modelName = vueGetParamFromQuery(query, 'model');
    if (modelName) {
    // do something
    }