Ming 4 éve
szülő
commit
2d88b0a664
1 módosított fájl, 36 hozzáadás és 0 törlés
  1. 36 0
      pages/test/test-select-picker.vue

+ 36 - 0
pages/test/test-select-picker.vue

@@ -0,0 +1,36 @@
+<template>
+    <view>
+        <view class="uni-title uni-common-pl">地区选择器</view>
+        <view class="uni-list">
+            <view class="uni-list-cell">
+                <view class="uni-list-cell-db">
+                    <picker @change="bindPickerChange" :value="index" :range="array">
+                        <view class="uni-input">{{array[index]}}</view>
+                    </picker>
+                </view>
+            </view>
+        </view>
+    </view>
+</template>
+
+<script>
+	export default {
+    data() {
+        return {
+            array: ['中国', '美国', '巴西', '日本'],
+            index: 0,
+        }
+    },
+    computed: {
+    },
+    methods: {
+        bindPickerChange: function(e) {
+            console.log('picker发送选择改变,携带值为', e.target.value)
+            this.index = e.target.value
+        },
+    }
+}
+</script>
+
+<style>
+</style>