当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript client.splitOnFirst函数代码示例

本文整理汇总了TypeScript中@servicestack/client.splitOnFirst函数的典型用法代码示例。如果您正苦于以下问题:TypeScript splitOnFirst函数的具体用法?TypeScript splitOnFirst怎么用?TypeScript splitOnFirst使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了splitOnFirst函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: toPascalCase

    newUser: (u: string) => {
        const $ = (sel:string) => document.querySelector(sel) as HTMLInputElement;

        const names = u.split('@');
        $("[name=displayName]").value = toPascalCase(names[0]) + " " + toPascalCase(splitOnFirst(names[1],'.')[0]); 
        $("[name=email]").value = u;
        $("[name=password]").value = $("[name=confirmPassword]").value = 'p@55wOrd';
    }
开发者ID:Formator,项目名称:ServiceStack,代码行数:8,代码来源:register.ts

示例2: queryString

const updateHistory = (id:string, description:string, key:string) => {
    if (!id) return;
    document.title = description;

    if (history.pushState && (!history.state || history.state[key] != id)) {
        let qs = queryString(location.href);
        var url = splitOnFirst(location.href, '?')[0];
        qs[key] = id;
        delete qs["s"]; //remove ?s=1 from /auth
        delete qs["clear"];
        delete qs["snapshot"];
        delete qs["expression"];
        delete qs["activeFileName"];
        url = appendQueryString(url, qs);
        history.pushState({ gist: qs["gist"], collection: qs["collection"], description }, description, url);
        ReactGA.pageview(url);
    }
};
开发者ID:ServiceStack,项目名称:Gistlyn,代码行数:18,代码来源:state.ts

示例3: catch

                        confirmPassword: this.confirmPassword,
                        autoLogin: this.autoLogin,
                    }));

                    location.href = '/validation/vuetify/';
                } catch (e) {
                    this.responseStatus = e.responseStatus || e;
                } finally {
                    this.loading = false;
                    form.resetValidation();
                }
            }
        },
        switchUser(email:string) {
            const names = email.split('@');
            this.displayName = toPascalCase(names[0]) + ' ' + toPascalCase(splitOnFirst(names[1], '.')[0]);
            this.email = email;
            this.password = this.confirmPassword = 'p@55wOrd';
        },
        errorResponse
    },
    data: () => ({
        loading: false,
        valid: true,
        displayName: "",
        email: "",
        password: "",
        confirmPassword: "",
        autoLogin: true,
        nameRules, emailRules, passwordRules, confirmPasswordRules,
        responseStatus: null
开发者ID:Formator,项目名称:ServiceStack,代码行数:31,代码来源:register.ts

示例4: splitOnFirst

 lines.forEach(line => {
     var parts = splitOnFirst(line, ":");
     if (parts.length !== 2) return;
     meta[parts[0].trim()] = parts[1].trim();
 });
开发者ID:ServiceStack,项目名称:Gistlyn,代码行数:5,代码来源:state.ts


注:本文中的@servicestack/client.splitOnFirst函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。