當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript builder.parse函數代碼示例

本文整理匯總了TypeScript中tns-core-modules/ui/builder.parse函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript parse函數的具體用法?TypeScript parse怎麽用?TypeScript parse使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了parse函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: getViews

 private getViews(template: string) {
     let root = parse(template);
     return {
         root,
         list: root.getViewById("repeater") as Repeater
     };
 };
開發者ID:m-abs,項目名稱:NativeScript,代碼行數:7,代碼來源:repeater-safe-area-tests.ts

示例2: getViews

 private getViews(template: string) {
     let root = parse(template);
     return {
         root,
         list: root.getViewById("webview") as WebView
     };
 };
開發者ID:m-abs,項目名稱:NativeScript,代碼行數:7,代碼來源:web-view-safe-area-tests.ts

示例3: test_MultiParserTemplate

export function test_MultiParserTemplate() {
    const file = fs.File.fromPath(fs.path.join(__dirname, "itemTemplates.xml"));
    const xml = file.readTextSync();

    const view: any = builder.parse(xml);
    TKUnit.assertNotNull(view.items)
    TKUnit.assertEqual(view.items.length, 1);
}
開發者ID:triniwiz,項目名稱:NativeScript,代碼行數:8,代碼來源:xml-parser-tests.ts

示例4: getViews

 private getViews(template: string) {
     let root = parse(template);
     return {
         root,
         list: root.getViewById("list") as ListView,
         cells: [
             [root.getViewById("cell00") as ListView, root.getViewById("cell01") as ListView, root.getViewById("cell02") as ListView],
             [root.getViewById("cell10") as ListView, root.getViewById("cell11") as ListView, root.getViewById("cell12") as ListView],
             [root.getViewById("cell20") as ListView, root.getViewById("cell21") as ListView, root.getViewById("cell22") as ListView]
         ]
     };
 };
開發者ID:m-abs,項目名稱:NativeScript,代碼行數:12,代碼來源:list-view-safe-area-tests.ts

示例5: getViews

 private getViews(template: string) {
     let root = parse(template);
     return {
         root,
         grid: root.getViewById("grid") as GridLayout,
         stack: root.getViewById("stack") as GridLayout,
         childFirst: root.getViewById("childFirst") as view.View,
         cells: [
             [root.getViewById("cell00") as view.View, root.getViewById("cell01") as view.View, root.getViewById("cell02") as view.View],
             [root.getViewById("cell10") as view.View, root.getViewById("cell11") as view.View, root.getViewById("cell12") as view.View],
             [root.getViewById("cell20") as view.View, root.getViewById("cell21") as view.View, root.getViewById("cell22") as view.View]
         ]
     };
 };
開發者ID:vchimev,項目名稱:NativeScript,代碼行數:14,代碼來源:scroll-view-safe-area-tests.ts


注:本文中的tns-core-modules/ui/builder.parse函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。