天天看點

PowerApps Component Framework PCF 部署

PowerApps PCF 可以滿足複雜的功能, 我們可以使用PCF來建立複雜的PowerApps。

這裡附上微軟的package code componet 教程(https://docs.microsoft.com/en-us/powerapps/developer/component-framework/import-custom-controls)

步驟

1. 首先我們需要建立solution檔案夾,并且進入到建立的solution檔案夾中

mkdir GoogleMapSolution

cd c://xxx/xxx/GoogleMapSolution

PowerApps Component Framework PCF 部署

2.. 其次我們需要建立publisher 和 prefix

pac solution init --publisher-name PCFGMap --publisher-prefix PCFGMap

PowerApps Component Framework PCF 部署

3. 我們需要把solution檔案夾和code 檔案夾做關聯

pac solution add-reference --path C:\Projects\GitHub\PowerApps\PCF\Controls\PCFGoogleMap

PowerApps Component Framework PCF 部署

4. 接下來需要運作 MS Build

msbuild /t:build /restore

ps: 建議直接使用“Developer Command Prompt for VS 2017” 來運作 MSBuild

/restore 隻是第一次使用, 随後的build不需要。

如果需要release:sbuild /p:configuration=Release

PowerApps Component Framework PCF 部署
PowerApps Component Framework PCF 部署
PowerApps Component Framework PCF 部署

5. 接下來我們需要把生成的zip檔案上傳到PowerApps中的solution

PowerApps Component Framework PCF 部署

6. 接下來需要進入admin.powerplatform.com 中打開PowerApps component framework 功能

ps: 切記這個步驟不能省略, 如果省略則不能添加code component 到 PowerApps canvas中

PowerApps Component Framework PCF 部署

 7. 接下來我們進入到canvas app中。

在insert -> Custom 中import component. 并且切換到code中選擇剛才import的component.

PowerApps Component Framework PCF 部署

8. 添加code component到screen中

PowerApps Component Framework PCF 部署