Instantly share code, notes, and snippets.
Front End Developer by day. Dad Joke developer by night.
-
novetta
- Washington, D.C.
- linktree.com/rammms
ramsaylanier
/ ui.js
Last active
November 21, 2017 04:14
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
const types = { | |
TOGGLE_SIDEBAR = 'TOGGLE_SIDEBAR' | |
} | |
// initial state | |
const state = { | |
sidebarOpen: false | |
} | |
// getters |
ramsaylanier
/ vue-tutorial-sidebar-store.js
Created
November 21, 2017 04:18
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 Vue from 'vue' | |
import Vuex from 'vuex' | |
import ui from './modules/ui' | |
Vue.use(Vuex) | |
const debug = process.env.NODE_ENV !== 'production' | |
export default new Vuex.Store({ | |
modules: { |
ramsaylanier
/ vue-tutorial-sidebar-main.js
Created
November 21, 2017 04:20
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 Vue from 'vue' | |
import App from './App' | |
import store from './store/index.js' | |
Vue.config.productionTip = false | |
/* eslint-disable no-new */ | |
new Vue({ | |
el: '#app', | |
store, |
ramsaylanier
/ vue-tutorial-sidebar-app.vue
Last active
November 21, 2017 04:27
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"> | |
<div :class="$style.container"> | |
</div> | |
<sidebar/> | |
<sidebar-toggle/> | |
</div> | |
</template> |
ramsaylanier
/ vue-tutorial-sidebar-sidebarToggle.vue
Last active
November 21, 2017 04:29
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> | |
<button :class="[open ? $style.active : '', $style.button]" @click="handleClick"> | |
<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"> | |
<path d="M0 0h24v24H0z" fill="none"/> | |
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 11h-4v4h-2v-4H7v-2h4V7h2v4h4v2z"/> | |
</svg> | |
</button> | |
</template> | |
<script> |
ramsaylanier
/ vue-tutorial-sidebar-sidebar.vue
Created
November 21, 2017 04:36
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="$style.sidebar"/> | |
</template> | |
<script> | |
import {TweenMax, Power4} from 'gsap' | |
export default { | |
name: 'sidebar', | |
mounted () { |
ramsaylanier
/ vue-tutorial-sidebar-dynamic-ui-module.js
Created
November 22, 2017 00:05
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 * as types from '../mutation-types' | |
// initial state | |
// shape: [{ id, quantity }] | |
const state = { | |
sidebarOpen: false, | |
sidebarComponent: null | |
} | |
// getters |
ramsaylanier
/ vue-tutorial-sidebar-dynamic-app.vue
Created
November 22, 2017 00:10
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"> | |
<div :class="$style.container"> | |
</div> | |
<sidebar/> | |
<div :class="$style.toggles"> | |
<sidebar-toggle :sidebarComponent="addForm" :icon="searchIcon"/> | |
<sidebar-toggle :sidebarComponent="searchForm" :icon="addIcon"/> |
ramsaylanier
/ vue-tutorial-sidebar-dynamic-sidebar-toggle.vue
Created
November 22, 2017 00:13
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> | |
<button :class="[open ? $style.active : '', $style.button]" @click="handleClick"> | |
<component :is="icon"/> | |
</button> | |
</template> | |
<script> | |
export default { | |
name: 'sidebar-toggle', | |
props: ['sidebarComponent', 'icon'], |
ramsaylanier
/ vue-tutorial-sidebar-dynamic-sidebar.vue
Created
November 22, 2017 00:21
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="$style.sidebar"> | |
<component :is="component"/> | |
</div> | |
</template> | |
<script> | |
import {TweenMax, Power4} from 'gsap' | |
export default { |