Created
October 15, 2018 09:57
-
-
Save ygmpkk/10dca4a411a351ba38a7bc2c77f4c059 to your computer and use it in GitHub Desktop.
map makers状态更新问题
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<view class="container"> | |
<view @click='handleRandom'> | |
更新状态: {{ current }} | |
</view> | |
<view v-if='house'> | |
<map | |
:longitude='house.location.longitude' | |
:latitude='house.location.latitude' | |
:makers='house.location.makers' | |
:scale='scale' | |
/> | |
</view> | |
</view> | |
</template> | |
<style></style> | |
<script> | |
import dayjs from 'dayjs' | |
export default { | |
data() { | |
return { | |
current: '', | |
house: null, | |
}; | |
}, | |
created() { | |
this.house = { | |
location: { | |
longitude: 114.187751, | |
latitude: 22.306628, | |
makers: [ | |
{ | |
position: [114.187751, 22.306628], | |
title: '何文田', | |
}, | |
], | |
}, | |
} | |
}, | |
methods: { | |
handleRandom() { | |
this.current = dayjs().format('YYYY-MM-DD HH:mm:ss') | |
}, | |
}, | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment