import QtQuick import QtQuick.Controls import QtQuick.Layouts import "./common" Rectangle { id: root // TabBar { // id: bar // width: parent.width // anchors.top: parent.top // currentIndex: 0 // TabButton { // text: qsTr("系统设置") // } // } gradient: Gradient { GradientStop { position: 0.0; color: "#ecf3fb" } // 左上角颜色 GradientStop { position: 1.0; color: "#b7d6fb" } // 右上角颜色 orientation: Gradient.Horizontal } Item { id: bar anchors.left: parent.left anchors.right: parent.right anchors.top: parent.top anchors.topMargin: 24 anchors.leftMargin: 10 anchors.rightMargin: 23 height: 45 property var currentIndex: 0 Row{ anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left spacing: 38 QxTitleButton { text: qsTr("接口管理") isSelected: bar.currentIndex == 0 textColor: isSelected ? "#262626" : "#979797" onClicked: bar.currentIndex = 0 } QxTitleButton { text: qsTr("数据库管理") isSelected: bar.currentIndex == 1 textColor: isSelected ? "#262626" : "#979797" onClicked: bar.currentIndex = 1 } } } StackLayout { id: layout anchors.top: bar.bottom anchors.bottom: parent.bottom anchors.left: parent.left anchors.right: parent.right currentIndex: bar.currentIndex PageInterface{} PageDatabase{} } }