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
<svg class="liquid-button" | |
data-text="DIVE IN" | |
data-hover-factor="-30" | |
></svg> |
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
// Parent.vue | |
<template> | |
<ChildComponent ref="child" /> | |
</template> | |
// In Parent.vue's methods | |
this.$refs.child.methodName() |
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> | |
<component-to-re-render :key="reloadMe" /> | |
</template> | |
<script> | |
export default { | |
data() { | |
return { |
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
v-for="(route, idx) in $router.options.routes.filter( | |
(routeItem) => routeItem.name === $route.matched[0].name | |
)" |
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
// In parent | |
data() { | |
return { | |
message: 'This is my message' | |
} | |
} | |
// In child template | |
<div>{{ $parent.message }}</div> // <-- results in 'This is my message' |
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
// import store from '../store' <-- To access your Vuex store | |
import Vue from 'vue' // <-- used for vue-toastification | |
class Utils { | |
// Copy a string to user's clipboard | |
copyToClipboard(text) { | |
let copyText = document.createElement('input') | |
document.body.appendChild(copyText) | |
copyText.value = text | |
copyText.select() |
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
async mounted() { | |
// Detect if user is on Desktop or Mobile platform, then save to store | |
this.$isMobile() | |
? this.$store.commit('setPlatform', 'mobile') | |
: this.$store.commit('setPlatform', 'desktop') | |
}, |
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
// In App.vue | |
watch: { | |
$route() { | |
window.scrollTo(0, 0) | |
} | |
}, |
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
import { createApp } from 'vue' | |
import App from './App.vue' | |
// i18n | |
import I18n from './i18n.js' | |
const i18n = createI18n({ | |
locale: | |
localStorage.getItem('lang') || | |
// Detect user's browser language |
NewerOlder