import QtQuick import QtQuick.Layouts import QtQuick.Controls import FluentUI.Controls import FluentUI.impl import Gallery Item { property var pro_title: "" id: control Connections{ target: window function onInit(arg){ console.log("初始化。。。") } } ColumnLayout { spacing: 20 anchors.centerIn: parent width: 260 Label { elide: Label.ElideRight text: "新建目录" Layout.fillWidth: true font.pointSize: 15 horizontalAlignment: Text.AlignHCenter } TextField { id: tb_title focus: true placeholderText: "名称" Layout.fillWidth: true text: control.pro_title } Item{ implicitHeight: 40 Layout.fillWidth: true Button{ text: "取消" anchors{ left: parent.left verticalCenter: parent.verticalCenter } onClicked: { window.close() } } FilledButton{ text: "确认" anchors{ right: parent.right verticalCenter: parent.verticalCenter } onClicked: { window.setResult({title: tb_title.text}) window.close() } } } } }