uni-app 选择框,uni-data-picker 电脑版发表于:2022/3/1 21:02 页面代码: ``` <template> <view> <uni-data-picker :localdata="items" popup-title="请选择班级" @change="onchange" @nodeclick="onnodeclick"></uni-data-picker> </view> </template> ``` JS: ``` <script> export default { data() { return { items: [{ text: "一年级", value: "1-0", children: [ { text: "1.1班", value: "1-1" }, { text: "1.2班", value: "1-2" } ] }, { text: "二年级", value: "2-0" }, { text: "三年级", value: "3-0" }] } }, methods: { onchange(e) { const value = e.detail.value }, onnodeclick(node) { } } } </script> ```