| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <template>
- <view>
- <u-dropdown v-if="options != null" style="width:100%; display: flex;">
- <u-dropdown-item height="450" @change="changitem" v-model="value" :title="ctitle" :options="options"></u-dropdown-item>
- </u-dropdown>
- </view>
- </template>
- <script>
- export default {
- props: {
- title: {
- type: String,
- },
- options: {
- type: Array
- },
- },
- data() {
- return {
- ctitle: "",
- value:''
- }
- },
- created() {
- this.ctitle = this.title
- },
-
- methods: {
- changitem(val) {
- let item = this.itemfind(val)
- this.ctitle = item.label
- this.$emit("getroomList", val,-1)
- },
- //查找标题
- itemfind(index) {
- return this.options.find(e => e.value == index)
- },
- }
- }
- </script>
- <style>
- .u-dropdown {
- display: flex;
- }
- .u-dropdown__menu{
- border: 1px solid red;
- }
- </style>
|