Created
September 28, 2018 11:17
-
-
Save ygmpkk/1361d7af9167b0b434da1de7f961b835 to your computer and use it in GitHub Desktop.
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> | |
<view> | |
父组件 | |
</view> | |
<view> | |
{{ data.today.format('YYYY-MM-DD') }} | |
</view> | |
<view> | |
{{ today.format('YYYY-MM-DD') }} | |
</view> | |
<view> | |
{{ formatted }} | |
</view> | |
</view> | |
<play :data="data" :today="today" :formatted="formatted" /> | |
</view> | |
</template> | |
<style></style> | |
<script> | |
import play from '../components/play' | |
import dayjs from 'dayjs' | |
export default { | |
components: { | |
play, | |
}, | |
data() { | |
return { | |
today: dayjs('2018-09-28'), | |
formatted: '2018-09-28', | |
data: { | |
today: dayjs('2018-09-28') | |
}, | |
}; | |
}, | |
mounted() { | |
console.log('delay change state') | |
this.data = {today: dayjs('2018-10-08')} | |
this.today = dayjs('2018-10-08') | |
this.formatted = '2018-10-08' | |
}, | |
methods: { | |
}, | |
}; | |
</script> |
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> | |
<view> | |
父组件 | |
</view> | |
<view> | |
{{ data.today.format('YYYY-MM-DD') }} | |
</view> | |
<view> | |
{{ today.format('YYYY-MM-DD') }} | |
</view> | |
<view> | |
{{ formatted }} | |
</view> | |
</view> | |
<play :data="data" :today="today" :formatted="formatted" /> | |
</view> | |
</template> | |
<style></style> | |
<script> | |
import play from '../components/play' | |
import dayjs from 'dayjs' | |
export default { | |
components: { | |
play, | |
}, | |
data() { | |
return { | |
today: dayjs('2018-09-28'), | |
formatted: '2018-09-28', | |
data: { | |
today: dayjs('2018-09-28') | |
}, | |
}; | |
}, | |
mounted() { | |
console.log('delay change state') | |
this.data = {today: dayjs('2018-10-08')} | |
this.today = dayjs('2018-10-08') | |
this.formatted = '2018-10-08' | |
}, | |
methods: { | |
}, | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment