javascript
<template>
<div>
</div>
</template>
<script>
export default {
data () {
return {
data: {
10: '北京',
110: '山东'
},
optionsData: []
}
},
methods: {
tranFn() {
console.log('data>>>', this.data)
const arr = []
for (let i = 0; i < Object.keys(this.data).length; i++) {
arr.push({ value: Object.keys(this.data)[i], label: this.data[Object.keys(this.data)[i]] })
}
console.log('arr>>>', arr)
this.optionsData = arr
}
},
created () {
this.tranFn()
}
}
</script>
<style>
</style>