Giter Site home page Giter Site logo

aoaob / vue-block Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 0067ed/vue-block

0.0 2.0 0.0 4 MB

A Vue plugin helping you build CSS grid like layout system with the support of old browser like IE9.

Home Page: https://0067ed.github.io/vue-block/

License: MIT License

JavaScript 74.43% HTML 7.06% Vue 18.51%

vue-block's Introduction

vue-block

A Vue plugin helping you build CSS grid like layout system with the support of old browser like IE9.

Feature

vue-block can provide you:

  • CSS grid like layout system.
  • Really easy to use API, especially for new Vue beginner.
  • Support IE9+ and other modern browser which support CSS calc.
  • Functional component, which is stateless and instanceless.

Install

Install with npm:

npm install --save-dev vue-block

Usage

Basicly vue-block is a Vue plugin. Also you can use it as a Vue component.

Plugin Usage:

import 'vue-block/dist/block.css';
import block from 'vue-block';
import Vue from 'vue';
Vue.use(block);

new Vue({
    el: '#app',
    template: `<block>
        <div slot="left"><div>
        <div slot="right"><div>
    </block>`
});

Component Usage:

import 'vue-block/dist/block.css';
import block from 'vue-block';
import Vue from 'vue';

new Vue({
    el: '#app',
    template: `<block>
        <div slot="left"><div>
        <div slot="right"><div>
    </block>`,
    components: { block }
});

API

vue-block's API is provide by all kinds of vue slot. It provide some default slot to handle the basic layout function.

For Example:

<!-- left and right -->
<block>
    <div slot="left">left<div>
    <div slot="right">right<div>
</block>

<!-- horizontal center -->
<block>
    <div slot="center">center 1<div>
    <div slot="center">center 2<div>
</block>

<!-- middle of the block, both vertical and horizontal -->
<block>
    <div slot="middle">middle 1<div>
    <div slot="middle">middle 2<div>
</block>

And most excited thing is vue-block support css grid like layout system.

For Example:

<block
    cols="100px 2fr 1fr"
    rows="100px 200px 100px"
    pattern="header header right, side main right, side main right">
    <div slot="header"></div>
    <div slot="side"></div>
    <div slot="main"></div>
    <div slot="right"></div>
</block>

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for doc
npm run doc

vue-block's People

Contributors

zmmbreeze avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.