aurelia-templating

    1熱度

    1回答

    試圖讓Aurelia撰寫ViewModel-less工作和有一些問題。 我在項目中遇到問題,所以爲了測試我克隆了skeleton-typescript項目。 我在src目錄中創建了一個test.html頁面,其內容爲<template><div>Hi I'm a test message</div></template>。 然後,在welcome.html頁面中,我在提交按鈕 <template>

    0熱度

    2回答

    我有模板,中繼器: ​​ 其中打印結果: 0 - 0 0 - 1 1 - 0 1 - 1 如果我使用自定義元素child-item用相同的模板: <template> <p>${ $parent.$index } - ${ $index }</p> </template> 並使用child-item寫我的原始示例: <template repeat.for="i of 2

    1熱度

    1回答

    我正在使用Aurelia。 我有一個post路線,顯示一個帖子給出通過id。 服務器編譯以前寫的帖子HTML的降價,和我使用的加載在我的模板此內容: <div innerHTML.bind="post.content"></div> // in the activate() function client .fetch(`api/post/${params.id}`) .

    0熱度

    2回答

    我有REF爲形式,其是自定義元件 <form ref="domRef" ...> 我有裁判用於現場太,這是另一個定製元素(被表單內使用) <input type="text" ref="domRef" .....> 但窗體的視圖模型裏面attach()我得到this.domRef是輸入的參考。 attached(){ console.log(this.domRef); }

    1熱度

    1回答

    在Aurelia中,我創建了一個作爲容器進行交互的自定義​​元素。此容器在子節點周圍創建一些UI元素。 這些自定義元素可以在任何視圖中使用如下: <wizard-container ref="container"> <wizard-step title="Step 1" view-model="step1"></wizard-step> <wizard-step title="

    1熱度

    1回答

    我想在我的視圖模板使用靜態類常量 的Javascript class FilterModel { static const FILTER_TYPE_STRING() { return 'string'; } } HTML <div show.bind="selectedFacet.type===FilterModel.FILTER_TYPE_STRING">

    2熱度

    1回答

    我想創建一個自定義元素,循環遍歷一個數組,並將其應用於數組中的每個項目。例如,定製元素的視圖模板將包含這樣的: <div repeat.for="i of items"> <div with.bind="i"> <slot></slot> </div> </div> 當我除去repeat.for和with.bind屬性,所述槽將顯示一個單一的時間。有沒有辦法讓列

    1熱度

    3回答

    我瞭解Aurelia自定義元素與<compose>的優缺點; Jeremy Danyow的blog post有幫助。但是,我想have my cake and eat it too。 我想創建自定義元素,我也可以動態編寫。因爲<compose>需要不同的實例化,所以使用它將意味着我需要爲每個元素創建兩個並行版本 - 一個用於<compose>,另一個用於靜態調用。例如,請考慮以下用例: <temp

    3熱度

    2回答

    是否可以在運行時動態定義自定義組件模板內的元素類型? 我想,以避免在下面的示例中的button和a元件的內部重複內容: <template> <button if.bind="!isLinkBtn"> <span class="btn-icon">${icon}</span> <span class="btn-text">${contentText}</span>

    0熱度

    1回答

    我非常清楚,我可以用消毒的innerHTML綁定的數據: <div innerhtml.bind="someData | sanitizeHTML"></div> 但是,根據我的觀察,這個消毒不僅能消除<script>標籤。它不保護從事件驅動的內容,例如用戶: "Hi! I am some HTML-formatted data from the server! <button onclick