This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>GoCode</title> | |
| <script src="https://unpkg.com/redux@latest/dist/redux.min.js"></script> | |
| </head> | |
| <body> | |
| <div> | |
| <p> | |
| Counter: <span id="value">0</span> times |
This file contains hidden or 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> | |
| <div class="layout bg-gray-200 font-sans leading-normal tracking-normal"> | |
| <div | |
| class="w-full m-0 p-0 bg-cover bg-bottom" | |
| style="background-image:url('/cover.jpg'); height: 40vh; max-height:260px;" | |
| > | |
| <div | |
| class="container max-w-4xl mx-auto pt-16 md:pt-15 text-center break-normal" | |
| > | |
| <!--Title--> |
This file contains hidden or 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> | |
| <div class="layout bg-gray-200 font-sans leading-normal tracking-normal"> | |
| <div | |
| class="w-full m-0 p-0 bg-cover bg-bottom" | |
| style="background-image:url('/cover.jpg'); height: 40vh; max-height:260px;" | |
| > | |
| <div | |
| class="container max-w-4xl mx-auto pt-16 md:pt-15 text-center break-normal" | |
| > | |
| <!--Title--> |
This file contains hidden or 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> | |
| <div> | |
| <span>count is {{ count }}</span> | |
| <span>plusOne is {{ plusOne }}</span> | |
| <button @click="increment">count++</button> | |
| </div> | |
| </template> | |
| <script> | |
| import { value, computed, watch, onMounted } from 'vue' |
This file contains hidden or 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
| // ... | |
| <script> | |
| import { | |
| ref, | |
| watch, | |
| computed, | |
| onMounted, | |
| onUnmounted | |
| } from '@vue/composition-api' | |
| import { fetchUserPosts } from '@/api' |
This file contains hidden or 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
| // ... | |
| <script> | |
| import { | |
| value, | |
| watch, | |
| computed, | |
| onMounted, | |
| onUnmounted | |
| } from 'vue-function-api' | |
| import { fetchUserPosts } from '@/api' |
This file contains hidden or 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
| // ... | |
| <script> | |
| import { ref, onMounted, onUnmounted } from '@vue/composition-api' | |
| export default { | |
| setup(props) { | |
| const pageOffset = ref(0) | |
| const update = () => { | |
| pageOffset.value = window.pageYOffset | |
| } |
This file contains hidden or 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> | |
| <div id="app"> | |
| <PostsPage :id="currentUser" /> | |
| </div> | |
| </template> | |
| <script> | |
| import { fetchUserPosts } from '@/api' | |
| import PostsPage from '@/components/PostsPage' | |
| const withPostsHOC = (WrappedComponent) => ({ |
This file contains hidden or 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> | |
| <div class="container"> | |
| <p v-if="isLoading" class="loading">Posts loading...</p> | |
| <template v-else> | |
| <div class="topbar" :class="{ open: pageOffset > 120 }"> | |
| <div class="container content"> | |
| <h3>User #{{ id }} posts</h3> | |
| <span class="count">{{ count }} items</span> | |
| </div> | |
| </div> |
This file contains hidden or 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> | |
| <div class="container"> | |
| <p v-if="isLoading" class="loading">Posts loading...</p> | |
| <template v-else> | |
| <div class="topbar" :class="{ open: pageOffset > 120 }"> | |
| <div class="container content"> | |
| <h3>User #{{ id }} posts</h3> | |
| <span class="count">{{ count }} items</span> | |
| </div> | |
| </div> |