Skip to content

Instantly share code, notes, and snippets.

@ygmpkk
Created October 15, 2018 09:57
Show Gist options
  • Save ygmpkk/10dca4a411a351ba38a7bc2c77f4c059 to your computer and use it in GitHub Desktop.
Save ygmpkk/10dca4a411a351ba38a7bc2c77f4c059 to your computer and use it in GitHub Desktop.
map makers状态更新问题
<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