New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

zj-layout

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zj-layout

基于自主开发的布局生成组件——Жидзин(Zidjin)系列组件库。

latest
npmnpm
Version
2.0.1
Version published
Maintainers
1
Created
Source

Zj-Layout 生成布局

基于自主开发的布局生成组件——Жидзин(Zidjin)系列组件

安装

推荐使用npm的方式安装

npm install zj-Layout

引入

全局引入,在 main.js 中写入以下内容:

import Vue from 'vue';
import App from './App.vue';
import ZjLayout from "zj-Layout";

Vue.use(ZjLayout);
new Vue({
  el: '#app',
  render: h => h(App)
});

局部引入,在vue页面文件中写入以下内容

export default {
    components: {
        ZjLayout: () => import('zj-Layout'),
    },
};

基本用法

初始化页面布局。

image-20211127194101427

<zj-Layout class="tri-layout" :config="config" debug>
	<template v-slot:hi>
		嗨,自由!
	</template>
</zj-Layout>

<script>
    export default {
        components: {
			ZjLayout: () => import('zj-Layout'),
		},
		data: () => ({
            config: {
                children: [
                    {
                        slot: 'hi',
                    },
                ]
            },
        })
    };
</script>

进阶用法

image-20211129121458570

<tri-layout class="tri-layout" :debug="true" :config="layoutConfig"></tri-layout>

<script>
    export default {
		components: {
		    TriLayout: () => import('tri-layout'),
		},
		
		data: () => ({
		    layoutConfig: {
				direction: 'column', // row 水平排列 column重直排列
				styles: { },
				debug:true,
				spacing: '0px',
				slot: 's1',
				view: 'v1',
				scroll: '', // true x y
				children: [
					{
						debug:true,
						direction: 'row',
						styles: {},
						slot: 's2',
						children: [                            
							{
								debug:true,
								direction: 'column',
								class:'s3',
								styles: {},
								slot: 's3',
							},
							{
								debug:true,
								direction: 'column',
								class:'s4',
								styles: { },
								slot: 's4',
							},
							{
								debug:true,
								direction: 'column',
								styles: { },
								class:'s5',
								/* view: 'v2', */
								slot:'s5',
							},
						]
					},
					{
						debug:true,
						direction: 'row',
						styles: {},
						slot: 's6',
						children: [                            
							{
								debug:true,
								direction: 'column',
								class:'s6-1',
								styles: {},
								slot: 's6-1',
								children: [
									{
										debug:true,
										direction: 'column',
										class:'s6-1-1',
										styles: {},
										slot: 's6-1-1',
									},
									{
										debug:true,
										direction: 'column',
										class:'s6-1-2',
										styles: {},
										slot: 's6-1-2',
									},
								]
							},
							{
								debug:true,
								direction: 'column',
								class:'s6-2',
								styles: {},
								slot: 's6-2',
								
							},
							{
								debug:true,
								direction: 'column',
								class:'s6-3',
								styles: {},
								slot: 's6-3',
								children: [
									{
										debug:true,
										direction: 'column',
										class:'s6-3-1',
										styles: {},
										slot: 's6-3-1',
									},
									{
										debug:true,
										direction: 'column',
										class:'s6-3-2',
										styles: {},
										slot: 's6-3-2',
									},
								]
							},
						]
					},
					{
						debug:true,
						direction: 'row',
						styles: {},
						slot: 's7',
						children: [                            
							{
								debug:true,
								direction: 'column',
								class:'s7-1',
								styles: {},
								slot: 's7-1',
							},
							{
								debug:true,
								direction: 'column',
								class:'s7-2',
								styles: { },
								slot: 's7-2',
							},
						]
					},	
				]
		        
		    },
		}),
		}
</script>
<style>
.s3{
        width:456px ;
        height: 80px;
    }
.s4{
		width: 580px;
		
	}
.s5{
		width: 486px;
	}
.s6-1{
		width: 340px;
		height: 660px;
	 }
.s6-1-1{
		width: 330px;
		height: 320px;
	}
.s6-1-2{
		
		width: 330px;
		height: 320px;
		
	}
.s6-2{
	 	width: 840px;
	 	height: 660px;
	 }
.s6-3{
		width: 340px;
		height: 660px;
		
	}
.s6-3-1{
		width: 330px;
		height: 320px;
	}
.s6-3-2{
		
		width: 330px;
		height: 320px;
		
	}
.s7-1{
		width: 380px;
		height: 320px;
	}
.s7-2{
		
		width: 1144px;
		height: 320px;
		
	}
</style>

ZjLayout Attributes

参数说明类型可选值默认值
styles公共样式Object--
config配置Object--
debug是否显示调试模式(布局边界)Booleantruefalse

Config Attributes

参数说明类型可选值默认值
direction方向Stringrowcolumn
class样式类String--
styles样式Object--
debug是否显示调试模式Booleantruefalse
spacing间距Number-0
slot插槽 (v-slot)String-s1
view路由视图 (router-view)String-v1
scroll滚动条String--
children子模块Array--

Children of Config Attributes

参数说明类型可选值默认值
debug是否显示调试模式Booleantruefalse
direction方向Stringcolumnrow
styles样式Object--
slot插槽String-s2
children子模块Array--

版本说明

V1.0.0.20211130-release

第一代稳定版本,经过多次内测。下一步文档的补完,页面布局更灵活配置。

V2.0.0.20211223-release

支持Vue3的版本。

V2.0.1.20230117-release

修正了文档漏写配置中class属性的说明、view说明描述错误。

Keywords

布局

FAQs

Package last updated on 17 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts