All Projects → alexsasharegan → Vue Flex

alexsasharegan / Vue Flex

A reusable flexbox component using functional css and functional Vue components.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Vue Flex

Vue Flexboxgrid
Vue components made with Flexboxgrid
Stars: ✭ 37 (-39.34%)
Mutual labels:  vuejs2, flexbox
Zaneperfor
前端性能监控系统,消息队列,高可用,集群等相关架构
Stars: ✭ 1,085 (+1678.69%)
Mutual labels:  vuejs2
Vue Image Loader
Vue progressive image loader plugin like Medium
Stars: ✭ 47 (-22.95%)
Mutual labels:  vuejs2
Bulrush
A Bulma-based Pelican blog theme; clean, flexible and responsive.
Stars: ✭ 53 (-13.11%)
Mutual labels:  flexbox
Vue Form Wizard
Vue.js 2 wizard
Stars: ✭ 1,053 (+1626.23%)
Mutual labels:  vuejs2
Vue Social Sharing
A renderless Vue.js component for sharing links to social networks, compatible with SSR
Stars: ✭ 1,071 (+1655.74%)
Mutual labels:  vuejs2
Willshop
基于 Laravel5.4 + vue.js2.x 的小网店系统
Stars: ✭ 46 (-24.59%)
Mutual labels:  vuejs2
Vue Todo List
vue2.0+vuex+localStorage 待办事项
Stars: ✭ 61 (+0%)
Mutual labels:  vuejs2
Vue Vscode Snippets
These snippets were built to supercharge my workflow in the most seamless manner possible.
Stars: ✭ 1,083 (+1675.41%)
Mutual labels:  vuejs2
Mdi Vue
Material design icons for vue.js
Stars: ✭ 53 (-13.11%)
Mutual labels:  vuejs2
My Bnb Memories
Remember your past travels from Airbnb, your data : your memories...
Stars: ✭ 52 (-14.75%)
Mutual labels:  vuejs2
Lemon
🍋 Minimal and responsive CSS framework for fast building websites.
Stars: ✭ 51 (-16.39%)
Mutual labels:  flexbox
Vuejs Carousel
Complete photo carousel build with VueJS and web standards in mind
Stars: ✭ 53 (-13.11%)
Mutual labels:  vuejs2
Ticket Conductor
A free and open-source Laravel 5.5 and VueJS (SPA) Ticket system
Stars: ✭ 48 (-21.31%)
Mutual labels:  vuejs2
Vuejs Aspnetcore Ssr
🆙 VueJS 2.5 Server Side Rendering on ASP.NET Core 2 and more
Stars: ✭ 57 (-6.56%)
Mutual labels:  vuejs2
Vue Lottie
Render After Effects animations on Vue based on Bodymovin
Stars: ✭ 1,037 (+1600%)
Mutual labels:  vuejs2
Vue Pomo
A progressive web app for the Pomodoro Technique, built with Vue 2.0, Vuex and Firebase.
Stars: ✭ 51 (-16.39%)
Mutual labels:  vuejs2
Tra Info
快速地查詢臺鐵時刻表,沒有廢話。
Stars: ✭ 53 (-13.11%)
Mutual labels:  vuejs2
Stf Vue Select
stf vue select - most flexible and customized select
Stars: ✭ 61 (+0%)
Mutual labels:  vuejs2
Livro Sem Apego
📚 Um site de doação de livros, sem fins lucrativos! o/
Stars: ✭ 58 (-4.92%)
Mutual labels:  vuejs2

vue-flex

npm version npm downloads GitHub issues GitHub stars GitHub forks Twitter

A Vue.js functional component to wrap anything in flexbox. (1.8kb gzipped js+css, or 1.2k js & .6k css)

Getting Started

import Vue from "vue";
// imports the ESM module by default
import VueFlex from "vue-flex";
// Already autoprefixed for vendor prefixes.
// Also namespaced to avoid collisions.
import "vue-flex/dist/vue-flex.css";

Vue.use(VueFlex);

Dist Varieties

The main export is an es2015 module, but commonjs and umd modules are also available:

  • Commonjs: "vue-flex/dist/vue-flex.common.js"
  • UMD: "vue-flex/dist/vue-flex.js"
<main>
    <my-navbar></my-navbar>
    <flex-row tag="section">
        <my-sidebar></my-sidebar>
        <flex-col
              tag="main"
              align-v="center"
              align-h="center"
              grow
              wrap
              @click="handleClick"
        >
            <my-content></my-content>
            <my-content></my-content>
            <my-content></my-content>
        </flex-col>
    </flex-row>
</main>

Component Props

Prop Type Default Description
tag String "div" Element tagName (any valid HTML tag name)
inline Boolean false display: inline-flex
column Boolean false flex-direction: column (row is default)
reverse Boolean false `flex-direction: row-reverse
wrap Boolean false flex-wrap: wrap
noWrap Boolean false flex-wrap: nowrap
grow Boolean false Applies to all child nodes: {flex-grow:1;flex-shrink:1;flex-basis:0;}
justify String null One of [ "start", "end", "center", "between", "around" ]
align String null One of [ "start", "end", "center", "baseline", "stretch" ]
alignV String null One of [ "start", "end", "center", ["between", "baseline",] "stretch" ]
alignH String null One of [ "start", "end", "center", ["between", "baseline",] "stretch" ]

* alignV and alignH just use align & justify under the hood, but when using the directional flex components, they handle the confusion of which axis is vertical/horizontal.

v2

Version 2 brings two new components <flex-row> & <flex-col>. In general, these just wrap the column property and make your markup more declarative. I've also added alignV & alignH props to all the components. These will use align-items & justify-content to determine the correct axis to apply your settings. Remembering which axis is vertical when in column direction is a classic confusion for me, so this abstracts that into a much more declarative api.

Flexbox all the things!

While building a large Vue.js application, I found myself constantly repeating the usage of various CSS flexbox utility classes, so I wrapped all the classes in a simple Vue component. This worked beautifully! But for two problems:

  • How do I listen for native events on the <flex> component? Do I really have to re-emit all the native events to enable v-on:event?
  • How am I supposed to find anything in the Vue devtools component tree if so many of my components are wrapped in these <flex> tags?
    • If you have a <ul> with a bunch of <flex> wrapped <li>'s, it's annoying. If you use flexbox heavily, it legitimately wastes time performing a vnode scavenger hunt whenever you need to debug a particular item.

Functional Vue Components

Functional Vue components are a real game changer here. Not only does the modifier-less v-on:event syntax work again to bind to native events (when the root element of the component is an HTML Element), but functional components do not appear in Vue devtools. Beyond the debugging experience, there is a performance boost to be had as well. Functional components are stateless (no data) and instanceless (no this context). This removes the initial overhead of observation and is very beneficial when a component is likely to be rendered many times in your app (think list items in a large list).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].