日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 前端技术 > vue >内容正文

vue

vue 动态组件组件复用_真正的动态声明性组件

發布時間:2023/12/3 vue 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 vue 动态组件组件复用_真正的动态声明性组件 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

vue 動態組件組件復用

在這篇簡短的文章中,我將重點介紹ADF動態聲明性組件。 我的意思是一個眾所周知的ADF標簽af:declarativeComponent 。 它可以用作將頁面設計為頁面片段和組件組成的一種非常便捷的方法。 例如,我們的頁面可以包含以下代碼片段:

<af:declarativeComponent viewId="PageFragment.jsff" id="dc1"><f:facet name="TheFacet"><af:button text="button 1" id="b1"/></f:facet>??????????????????? </af:declarativeComponent>

PageFragment.jsff是像這樣的普通頁面片段:

<?xml version='1.0' encoding='UTF-8'?> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"xmlns:af="http://xmlns.oracle.com/adf/faces/rich"><af:panelGroupLayout id="pgl1"><af:outputText value="This is a page fragment. You can add your content to the following facet:"id="ot1"/><af:facetRef facetName="TheFacet"/></af:panelGroupLayout> </jsp:root>

如果我們需要將一些參數傳遞給頁面片段,可以將片段定義為組件:

<?xml version='1.0' encoding='UTF-8'?> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"xmlns:af="http://xmlns.oracle.com/adf/faces/rich"> <af:componentDef var="attrs"><af:xmlContent><component xmlns="http://xmlns.oracle.com/adf/faces/rich/component"><facet><facet-name>TheFacet</facet-name></facet><attribute><attribute-name>Title</attribute-name></attribute></component></af:xmlContent><af:panelGroupLayout id="pgl1"><af:outputText value="This is a component #{attrs.Title}.You can add your content to the following facet:" id="ot1"/><af:facetRef facetName="TheFacet"/></af:panelGroupLayout></af:componentDef> </jsp:root>

在此示例中,我們可以傳遞如以下代碼片段所示的Title屬性的值:

<af:declarativeComponent viewId="ComponentFragment.jsff"id="dc2"Title="Buttom Container">??????????????????? <f:facet name="TheFacet"><af:button text="button 2" id="b2"/></f:facet>??????????????????? </af:declarativeComponent>

這項技術最酷的地方是viewId屬性不僅可以接受靜態字符串,而且還可以接受EL表達式:

<af:declarativeComponent viewId="#{TheBean.fragmentViewID}"id="dc1"><f:facet name="TheFacet"><af:button text="button 1" id="b1"/></f:facet>??????????????????? </af:declarativeComponent>public String getFragmentViewID() {return "PageFragment.jsff"; }

實際上,這就是為什么這種構造稱為dynamic的原因,因此可以將此功能視為構建結構良好,靈活而動態的UI的強大工具。

而已!

翻譯自: https://www.javacodegeeks.com/2014/09/really-dynamic-declarative-components.html

vue 動態組件組件復用

總結

以上是生活随笔為你收集整理的vue 动态组件组件复用_真正的动态声明性组件的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。