宮格導航--純血鴻蒙組件庫AUI

摘要:

宮格導航(A_GirdNav):可設置導航數據,建議導航項超過16個,可設置“更多”圖標指向的頁面路由。最多顯示兩行,手機每行最多顯示4個圖標,折疊屏每行最多6個圖標,平板每行最多8個圖標。多余圖標通過“更多”圖標跳轉。

一、組件調用方式

宮格導航組件的調用非常簡單,只需要輸入A_GirdNav ,然后給屬性 data(導航數據)和 moreRouter(“更多”圖標指向的頁面路由)賦值即可。在 data 當中需要給文字、圖標和跳轉的路由賦值。如下圖所示:

頁面調用代碼如下:

import { A_TitleBar } from '../aui/basic/A_TitleBar'
import { A_GirdNav } from '../aui/navigation/A_GirdNav'
import { ColorConstants } from '../constants/ColorConstants'
import { FloatConstants } from '../constants/FloatConstants'
import { GirdConstants } from '../constants/GirdConstants'
import { WindowUtils } from '../utils/WindowUtils'@Component
export struct Sample2 {@StorageLink('pageInfo') pageInfo: NavPathStack = new NavPathStack()@StorageLink('primaryColor') primaryColor: ResourceStr = ColorConstants.INFO@StorageLink('deviceType') deviceType: string = GirdConstants.DEVICE_SMaboutToAppear() {WindowUtils.getInstance()?.setFullScreen()}build() {Row() {Column() {// 標題欄A_TitleBar({ text: '調用示例二' })// 下拉容器Scroll() {GridRow({columns: { sm: GirdConstants.GRID_COLUMNS[0], md: GirdConstants.GRID_COLUMNS[1], lg: GirdConstants.GRID_COLUMNS[2] },gutter: { x: GirdConstants.GRID_GUTTER, y: GirdConstants.GRID_GUTTER },breakpoints: { reference: BreakpointsReference.WindowSize } }) {GridCol({ span: 12 }) {A_GirdNav({data: [{ text: 'Java', icon: 'mdi-language-java', router: 'OrderDetail/2' },{ text: 'Python', icon: 'mdi-language-python', router: '' },{ text: 'Vuetify', icon: 'cast-variant', router: '' },{ text: '純血鴻蒙', icon: 'mdi-tablet-cellphone', router: 'AccountPage' },{ text: 'Java', icon: 'mdi-language-java', router: 'OrderDetail/2' },{ text: 'Python', icon: 'mdi-language-python', router: '' },{ text: 'Vuetify', icon: 'cast-variant', router: '' },{ text: '純血鴻蒙', icon: 'mdi-tablet-cellphone', router: 'AccountPage' },{ text: 'Java', icon: 'mdi-language-java', router: 'OrderDetail/2' },{ text: 'Python', icon: 'mdi-language-python', router: '' },{ text: 'Vuetify', icon: 'cast-variant', router: '' },{ text: '純血鴻蒙', icon: 'mdi-tablet-cellphone', router: 'AccountPage' },{ text: 'Java', icon: 'mdi-language-java', router: 'OrderDetail/2' },{ text: 'Python', icon: 'mdi-language-python', router: '' },{ text: 'Vuetify', icon: 'cast-variant', router: '' },{ text: '純血鴻蒙', icon: 'mdi-tablet-cellphone', router: 'AccountPage' },{ text: 'Java', icon: 'mdi-language-java', router: 'OrderDetail/2' },{ text: 'Python', icon: 'mdi-language-python', router: '' },{ text: 'Vuetify', icon: 'cast-variant', router: '' },{ text: '純血鴻蒙', icon: 'mdi-tablet-cellphone', router: 'AccountPage' }],moreRouter: 'MoreNavigation'})}.margin({top: FloatConstants.SPACE_TOP})}.padding({ bottom:this.deviceType === GirdConstants.DEVICE_LG ? GirdConstants.ZERO : FloatConstants.SPACE_S })}.scrollBar(BarState.Off)}.height(GirdConstants.FULL_PERCENT)}.alignItems(VerticalAlign.Top).padding({top: FloatConstants.SPACE_TOP,left:FloatConstants.SPACE_LEFT,right:FloatConstants.SPACE_RIGHT,bottom:this.deviceType === GirdConstants.DEVICE_LG ? GirdConstants.GRID_BOTTOM : FloatConstants.SPACE_BOTTOM}).width(GirdConstants.FULL_PERCENT).backgroundColor(ColorConstants.APP_BG)}
}

本地模擬器下淺色模式和深色模式運行效果如下:

二、在線排版

在會員頁面或管理后臺的頁面當中選擇一個頁面,比如“首頁”,然后點擊“頁面設計”。如下圖所示:

現在“首頁”是一個空頁面,還沒有任何組件。展開左側組件庫中的“導航組件”分組,將“宮格導航組件”拖拽到頁面中,如下圖所示:

選擇右側“組件設置”下的“宮格導航”組件,點擊“配置數據”按鈕,可以根據自己的業務需要,新增、刪除或修改每一項配置,如下圖所示:

現在,切換到代碼魔法頁面,我們可以在側欄菜單這里選擇“純血鴻蒙”,(可以切換為深色模式,看代碼更舒適),然后點擊“生成代碼”,如下圖所示:

在生成的鴻蒙項目中,展開特性層(features),選擇 home 模塊,找到 /src/main/ets/view 目錄下的 HomeView.ets 頁面,查看生成的代碼,如下圖所示:

三、源碼解析

宮格導航組件支持兩個屬性,一個是 data(導航數據,建議導航項超過16個),另外一個是 moreRouter(“更多”圖標指向的頁面路由):

卡片導航數據 data 是一個數組 Array<NavigationModel>,其中導航Model的數據結構如下,含三個字段:導航的文字(text)、導航圖標(icon)和跳轉頁面的路由(router)。

繼續分析宮格導航組件 A_GirdNav 的源碼,在 aboutToAppear() 這個生命周期當中,對設備為折疊屏、平板和手機時的導航數據做了差異化的處理,以實現“一多”適配。其中,設備為折疊屏時,一行最多顯示6個圖標,最多顯示兩行。當總的圖標數(每個圖標對應一項導航數據)小于等于6個時,將所有圖標放入一組數據;當總圖標數大于6個時分為兩組數據,第一組數據取前六項導航數據,第二組數據分兩種情況:當總圖標數大于12個時(超過兩行),則將第7-11個圖標放入第二組數據,然后加上一個“更多”圖標;如果總圖標數不超過12個圖標,則將第7個到最后的圖標放入第二組數據。如下圖所示:

設備為平板時,一行最多顯示8個圖標,最多顯示兩行。當總的圖標數小于等于8個時,將所有圖標放入一組數據;當總圖標數大于8個時分為兩組數據,第一組數據取前八項導航數據,第二組數據分兩種情況:當總圖標數大于16個時(超過兩行),則將第9-15個圖標放入第二組數據,然后加上一個“更多”圖標;如果總圖標數不超過16個圖標,則將第9個到最后的圖標放入第二組數據。如下圖所示:

設備為手機時,一行最多顯示4個圖標,最多顯示兩行。當總的圖標數小于等于4個時,將所有圖標放入一組數據;當總圖標數大于4個時分為兩組數據,第一組數據取前四項導航數據,第二組數據分兩種情況:當總圖標數大于8個時(超過兩行),則將第5-7個圖標放入第二組數據,然后加上一個“更多”圖標;如果總圖標數不超過8個圖標,則將第5個到最后的圖標放入第二組數據。如下圖所示:

最后,將原始導航數據中的圖標數據做了預處理,變為符合鴻蒙資源命名規則的方式,如下代碼所示:

 this.compData.forEach(element => {element.icon = 'app.media.' + (element.icon.startsWith('mdi-') || element.icon.startsWith('mdi_') ? '' : 'mdi_') + element.icon.replaceAll('-', '_')})this.compData2.forEach(element => {element.icon = 'app.media.' + (element.icon.startsWith('mdi-') || element.icon.startsWith('mdi_') ? '' : 'mdi_') + element.icon.replaceAll('-', '_')})

使用自定義構建函數buildGirdNavigation展示兩組導航數據,如下圖所示:

ArkUI提供了一種輕量的UI元素復用機制@Builder,其內部UI結構固定,僅與使用方進行數據傳遞,開發者可以將重復使用的UI元素抽象成一個方法,在build方法里調用。為了簡化語言,我們將@Builder裝飾的函數也稱為“自定義構建函數”。使用@Builder裝飾自定義構建函數buildGirdNavigation,通過ForEach循環每一組導航數據,內部通過Image組件包裝圖標,Text組件包裝文字,使用點擊事件實現頁面路由跳轉,如下圖所示:

宮格導航組件的完整源碼如下:

/** Copyright (c) 2024 AIGCoder.com(AI極客)* Licensed under the Apache License, Version 2.0 (the "License");* you may not use this file except in compliance with the License.* You may obtain a copy of the License at**     http://www.apache.org/licenses/LICENSE-2.0** Unless required by applicable law or agreed to in writing, software* distributed under the License is distributed on an "AS IS" BASIS,* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.*//**調用示例一:A_GirdNav({data: [{ text: 'Java', icon: 'mdi-language-java', router: 'OrderDetail/2' },{ text: 'Python', icon: 'mdi-language-python', router: '' },{ text: 'Vuetify', icon: 'cast-variant', router: '' },{ text: '純血鴻蒙', icon: 'mdi-tablet-cellphone', router: 'AccountPage' },{ text: 'Java', icon: 'mdi-language-java', router: 'OrderDetail/2' },{ text: 'Python', icon: 'mdi-language-python', router: '' },{ text: 'Vuetify', icon: 'cast-variant', router: '' },{ text: '純血鴻蒙', icon: 'mdi-tablet-cellphone', router: 'AccountPage' },{ text: 'Java', icon: 'mdi-language-java', router: 'OrderDetail/2' },{ text: 'Python', icon: 'mdi-language-python', router: '' },{ text: 'Vuetify', icon: 'cast-variant', router: '' },{ text: '純血鴻蒙', icon: 'mdi-tablet-cellphone', router: 'AccountPage' },{ text: 'Java', icon: 'mdi-language-java', router: 'OrderDetail/2' },{ text: 'Python', icon: 'mdi-language-python', router: '' },{ text: 'Vuetify', icon: 'cast-variant', router: '' },{ text: '純血鴻蒙', icon: 'mdi-tablet-cellphone', router: 'AccountPage' }]})調用示例二:“更多”圖標指向頁面路由A_GirdNav({data: [{ text: 'Java', icon: 'mdi-language-java', router: 'OrderDetail/2' },{ text: 'Python', icon: 'mdi-language-python', router: '' },{ text: 'Vuetify', icon: 'cast-variant', router: '' },{ text: '純血鴻蒙', icon: 'mdi-tablet-cellphone', router: 'AccountPage' },{ text: 'Java', icon: 'mdi-language-java', router: 'OrderDetail/2' },{ text: 'Python', icon: 'mdi-language-python', router: '' },{ text: 'Vuetify', icon: 'cast-variant', router: '' },{ text: '純血鴻蒙', icon: 'mdi-tablet-cellphone', router: 'AccountPage' },{ text: 'Java', icon: 'mdi-language-java', router: 'OrderDetail/2' },{ text: 'Python', icon: 'mdi-language-python', router: '' },{ text: 'Vuetify', icon: 'cast-variant', router: '' },{ text: '純血鴻蒙', icon: 'mdi-tablet-cellphone', router: 'AccountPage' },{ text: 'Java', icon: 'mdi-language-java', router: 'OrderDetail/2' },{ text: 'Python', icon: 'mdi-language-python', router: '' },{ text: 'Vuetify', icon: 'cast-variant', router: '' },{ text: '純血鴻蒙', icon: 'mdi-tablet-cellphone', router: 'AccountPage' },{ text: 'Java', icon: 'mdi-language-java', router: 'OrderDetail/2' },{ text: 'Python', icon: 'mdi-language-python', router: '' },{ text: 'Vuetify', icon: 'cast-variant', router: '' },{ text: '純血鴻蒙', icon: 'mdi-tablet-cellphone', router: 'AccountPage' }],moreRouter: 'MoreNavigation'})*/import { ColorConstants } from "../../constants/ColorConstants"
import { FloatConstants } from "../../constants/FloatConstants"
import { GirdConstants } from "../../constants/GirdConstants"
import { NavigationModel } from "../../models/NavigationModel"/*** 【宮格導航】* data:導航數據(建議導航項超過16個)* moreRouter:“更多”圖標指向的頁面路由*/
@Component
export struct A_GirdNav {@Prop data: Array<NavigationModel>@Prop moreRouter?: string@StorageLink('pageInfo') pageInfo: NavPathStack = new NavPathStack()@StorageLink('deviceType') deviceType: string = GirdConstants.DEVICE_SM@State compMore: NavigationModel = {text: '更多',icon: 'dots-horizontal-circle-outline',router: this.moreRouter}@State compBlank: NavigationModel = {text: '',icon: '',router: ''}@State compPadding: Length = '16vp'private compMarginTop: Length = '36vp'private compMarginBottom: Length = '12vp'private compCardHeight: Length = '136vp'private compData: Array<NavigationModel> = []private compData2: Array<NavigationModel> = []aboutToAppear(): void {switch (this.deviceType){case GirdConstants.DEVICE_MD:if(this.data.length > 6){this.compData = this.data.slice(0, 6)if(this.data.length > 12){this.compData2 = this.data.slice(6, 11)this.compData2.push(this.compMore)}else{this.compData2 = this.data.slice(6, this.data.length)for (let i = 0; i < 12-this.data.length; i++) {this.compData2.push(this.compBlank)}}}else{this.compData = this.data.slice(0, this.data.length)}this.compCardHeight = this.compData2.length > 0 ? '144vp' : '80vp'breakcase GirdConstants.DEVICE_LG:if(this.data.length > 8){this.compData = this.data.slice(0, 8)if(this.data.length > 16){this.compData2 = this.data.slice(8, 15)this.compData2.push(this.compMore)}else{this.compData2 = this.data.slice(8, this.data.length)for (let i = 0; i < 16-this.data.length; i++) {this.compData2.push(this.compBlank)}}}else{this.compData = this.data.slice(0, this.data.length)}this.compPadding = '24vp'this.compMarginBottom = '16vp'this.compCardHeight = this.compData2.length > 0 ? '160vp' : '96vp'breakcase GirdConstants.DEVICE_SM:default:if(this.data.length > 4){this.compData = this.data.slice(0, 4)if(this.data.length > 8){this.compData2 = this.data.slice(4, 7)this.compData2.push(this.compMore)}else{this.compData2 = this.data.slice(4, this.data.length)for (let i = 0; i < 8-this.data.length; i++) {this.compData2.push(this.compBlank)}}}else{this.compData = this.data.slice(0, this.data.length)}this.compCardHeight = this.compData2.length > 0 ? '136vp' : '80vp'break}this.compData.forEach(element => {element.icon = 'app.media.' + (element.icon.startsWith('mdi-') || element.icon.startsWith('mdi_') ? '' : 'mdi_') + element.icon.replaceAll('-', '_')})this.compData2.forEach(element => {element.icon = 'app.media.' + (element.icon.startsWith('mdi-') || element.icon.startsWith('mdi_') ? '' : 'mdi_') + element.icon.replaceAll('-', '_')})}build() {Column() {this.buildGirdNavigation(this.compData)this.buildGirdNavigation(this.compData2)}.backgroundColor(ColorConstants.CARD_BG).width(GirdConstants.FULL_PERCENT).justifyContent(FlexAlign.SpaceBetween).borderRadius(FloatConstants.RADIUS_CARD).padding(this.compPadding).margin({top: this.compMarginTop,bottom: this.compMarginBottom}).height(this.compCardHeight)}@BuilderbuildGirdNavigation(list: NavigationModel[]) {Row() {ForEach(list, (item: NavigationModel) => {Column({ space: GirdConstants.EIGHT }) {Image($r(item.icon)).width(FloatConstants.IMAGE_SIZE5).height(FloatConstants.IMAGE_SIZE5).fillColor(ColorConstants.FG_LEVEL1)Text(item.text).fontSize(FloatConstants.FONT_SIZE_BODY_S).fontColor(ColorConstants.FG_LEVEL1)}.onClick(() => {if (item.router) {// 跳轉到新頁面const router = item.routerif (router.includes("/")) {this.pageInfo.pushPathByName(router.substring(0, router.indexOf("/")),router.substring(router.indexOf("/") + 1))} else {this.pageInfo.pushPathByName(router, null)}}}).width(FloatConstants.IMAGE_SIZE10)}, (item: NavigationModel, index: number) => index + JSON.stringify(item))}.justifyContent(FlexAlign.SpaceBetween).width(GirdConstants.FULL_PERCENT)}
}

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/web/81366.shtml
繁體地址,請注明出處:http://hk.pswp.cn/web/81366.shtml
英文地址,請注明出處:http://en.pswp.cn/web/81366.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

調試的按鈕

在Debug的時候&#xff0c;會有一些按鈕&#xff0c;我們需要知道它們各自的作用。 注&#xff1a;調試器本身并沒有一個直接的、可以撤銷已執行代碼效果的“返回上一步&#xff08;Undo Last Step&#xff09;”或“逆向執行&#xff08;Reverse Debugging&#xff09;”按鈕…

人工智能如何協助老師做課題

第一步&#xff1a;在騰訊元寶對話框中輸入如何協助老師做課題&#xff0c;通過提問&#xff0c;我們了解了老師做課題的步驟和建議。 第二步&#xff1a;開題報告提問&#xff0c;騰訊元寶對話框中&#xff0c;輸入“大單元視域下小學數學教學實踐研究課題開題報告。”......…

OpenGL Chan視頻學習-5 Vertex Attributes and Layouts in OpenGL

bilibili視頻鏈接&#xff1a; 【最好的OpenGL教程之一】https://www.bilibili.com/video/BV1MJ411u7Bc?p5&vd_source44b77bde056381262ee55e448b9b1973 一、知識點整理 1.1.OpenGL管線工作流程 為顯卡提供繪制的所有數據&#xff0c;并將數據存儲在GPU內存使用著色器&…

Linux_編輯器Vim基本使用

?? 歡迎大家來到小傘的大講堂?? &#x1f388;&#x1f388;養成好習慣&#xff0c;先贊后看哦~&#x1f388;&#x1f388; 所屬專欄&#xff1a;LInux_st 小傘的主頁&#xff1a;xiaosan_blog 制作不易&#xff01;點個贊吧&#xff01;&#xff01;謝謝喵&#xff01;&a…

MyBatis 高級映射功能詳解:處理復雜數據庫關系

MyBatis 的高級映射功能是其強大特性之一&#xff0c;它允許開發者輕松處理數據庫中的復雜關系&#xff0c;如一對一、一對多和多對多關系。本文將深入探討這些高級映射功能&#xff0c;包括映射配置方法、嵌套查詢和關聯查詢的使用&#xff0c;并通過示例代碼進行演示。 1.數據…

Halo:一個強大易用的國產開源建站工具

Halo 是一款國產開源的建站工具&#xff0c;適合快速搭建博客、論壇、知識庫、公司官網等多種類型的網站&#xff0c;目前在 GitHub 上已經獲得了 35.6k Star。 功能特性 Halo 核心功能與優勢包括&#xff1a; 插件架構&#xff1a;Halo 采用可插拔架構&#xff0c;功能模塊之…

Java-ArrayList集合的遍歷方式詳解

Java-ArrayList集合的遍歷方式詳解 二、ArrayList概述三、ArrayList的遍歷方式1. 普通for循環遍歷2. 增強for循環遍歷3. 迭代器遍歷4. ListIterator遍歷5. Java 8 Stream API遍歷 四、性能對比與分析性能測試結果分析 五、遍歷方式的選擇建議六、常見遍歷陷阱與注意事項1. 并發…

華為網路設備學習-23(路由器OSPF-LSA及特殊詳解 二)

OSPF動態路由協議要求&#xff1a; 1.必須有一個骨干區域&#xff08;Area 0&#xff09;。有且僅有一個&#xff0c;而且連續不可分割。 2.所有非骨干區域&#xff08;Area 1-n&#xff09;必須和骨干區域&#xff08;Area 0&#xff09;直接相連&#xff0c;且所有區域之間…

基于大模型的急性腐蝕性胃炎風險預測與診療方案研究報告

目錄 一、引言 1.1 研究背景與意義 1.2 研究目的 1.3 國內外研究現狀 二、急性腐蝕性胃炎概述 2.1 定義與發病機制 2.2 病因分析 2.3 臨床表現與分型 2.4 診斷方法 三、大模型技術介紹 3.1 大模型原理 3.2 常用大模型及在醫療領域應用案例 3.3 選擇用于急性腐蝕性…

泰迪杯特等獎案例深度解析:基于三維點云與深度學習的復雜零件裝配質量檢測系統設計

一、案例背景與行業痛點 1.1 工業裝配質檢的現狀與挑戰 在精密制造領域(如航空航天發動機、新能源汽車電池模組),復雜零件的裝配質量直接影響產品性能與安全性。傳統人工質檢存在效率低(單件檢測耗時>3分鐘)、漏檢率高(約15%)等問題,而現有自動化方案面臨以下技術…

離散傅里葉變換DFT推導及理解

DTFT到DFT的推導 關于DTFT的相關推導已經做過總結&#xff0c;詳見《DTFT及其反變換的直觀理解》&#xff0c;每一個離散的頻率分量都是由時域中的復指數信號累加得到的&#xff0c;DTFT得到的頻譜時頻率的連續函數 。 離散時間傅里葉變換公式&#xff0c;式1&#xff1a; 將…

欣佰特科技|工業 / 農業 / AR 場景怎么選?Stereolabs ZED 雙目3D相機型號對比與選型建議

Stereolabs ZED 相機系列為視覺感知領域提供了多種創新解決方案&#xff0c;適用于不同應用場景。選擇合適的 ZED 相機型號&#xff0c;需綜合考慮分辨率、深度感知范圍、接口類型等因素。 Stereolabs ZED 相機產品系列概覽 ZED&#xff1a;首款立體視覺相機&#xff0c;專為高…

黑馬點評Reids重點詳解(Reids使用重點)

目錄 一、短信登錄&#xff08;redisseesion&#xff09; 基于Session實現登錄流程 &#x1f504; 圖中關鍵模塊解釋&#xff1a; 利用seesion登錄的問題 設計key的具體細節 整體訪問流程 二、商戶查詢緩存 reids與數據庫主動更新的三種方案 緩存穿透 緩存雪崩問題及…

【Pandas】pandas DataFrame add_suffix

Pandas2.2 DataFrame Reindexing selection label manipulation 方法描述DataFrame.add_prefix(prefix[, axis])用于在 DataFrame 的行標簽或列標簽前添加指定前綴的方法DataFrame.add_suffix(suffix[, axis])用于在 DataFrame 的行標簽或列標簽后添加指定后綴的方法 pandas…

解鎖MCP:AI大模型的萬能工具箱

摘要&#xff1a;MCP&#xff08;Model Context Protocol&#xff0c;模型上下文協議&#xff09;是由Anthropic開源發布的一項技術&#xff0c;旨在作為AI大模型與外部數據和工具之間溝通的“通用語言”。它通過標準化協議&#xff0c;讓大模型能夠自動調用外部工具完成任務&a…

nginx性能調優與深度監控

目錄 nginx性能調優 更改進程數與連接數 進程數 連接數 靜態緩存功能設置 日志切割 配置網頁壓縮 nginx 的深度監控 GoAccess 簡介 GoAccess安裝 ?編輯 配置中文環境 GOAccess生成中文報告 測試訪問 nginx vts 簡介 nginx vts 安裝 nginx配置開啟vts 測試訪問…

【時時三省】Python 語言----牛客網刷題筆記

目錄 1,常用函數 1,input() 2,map() 3,split() 4,range() 5, 切片 6,列表推導式 山不在高,有仙則名。水不在深,有龍則靈。 ----CSDN 時時三省 1,常用函數 1,input() 該函數遇到 換行停止接收,返回類型為字符串 2,map() 該函數出鏡率較高,目的是將一個可迭…

docker compose yml 啟動的容器中,如何使用linux環境變量賦值

在 Docker Compose 中&#xff0c;可以通過環境變量&#xff08;${VAR} 或 $VAR&#xff09;來動態配置容器。以下是幾種常見的使用方式 - 使用 env_file 加載變量文件 可以單獨定義一個環境變量文件&#xff08;如 app.env&#xff09;&#xff0c;然后在 docker-compose.y…

深入解析Kafka JVM堆內存:優化策略與監控實踐

&#x1f49d;&#x1f49d;&#x1f49d;歡迎蒞臨我的博客&#xff0c;很高興能夠在這里和您見面&#xff01;希望您在這里可以感受到一份輕松愉快的氛圍&#xff0c;不僅可以獲得有趣的內容和知識&#xff0c;也可以暢所欲言、分享您的想法和見解。 推薦&#xff1a;「storms…

git常用操作命令

本文介紹git常用的操作命令&#xff0c;供大家參考。 1、開始 # 初始化本地git git init# 在初始化的目錄中&#xff0c;創建readme.txt&#xff0c;添加到git庫中 git add readme.txt git commit -m "寫了一個readme.txt文件"2、版本回退 2.1、git reset git lo…