A component library based on Vue 3.0, another way of presenting layui

A component library based on Vue 3.0, another way of presenting layui

2022-09-16 0 985
Resource Number 38567 Last Updated 2025-02-24
¥ 0USD Upgrade VIP
Download Now Matters needing attention
Can't download? Please contact customer service to submit a link error!
Value-added Service: Installation Guide Environment Configuration Secondary Development Template Modification Source Code Installation

This issue recommends the Vue3.0 version of the classic front-end UI framework Layui – layui vue.

A component library based on Vue 3.0, another way of presenting layui插图

Layui is a front-end UI framework written according to its own module specifications. Its simple and lightweight style, as well as elegant and abundant components, have received unanimous praise from many back-end developers. With the popularity of ES6, React and Vue have experienced unprecedented development, leading to layui announcing the cessation of maintenance in October 2021. Now, layui has returned with Vue3.0 version, and the pop-up layer component layer and backend template layui admin also have corresponding Vue3.0 versions, and the icon componentization solution icons vue has been added.

Installation

Install using npm, yarn, pnpm

npm install @layui/layui-vue --save
or
yarn add @layui/layui-vue --save

Global registration

import App from './ App.vue'
import { createApp } from 'vue'
import Layui from '@layui/layui-vue'
import '@layui/layui-vue/lib/index.css'

createApp(App).use(Layui).mount('#app')

The above code completes the introduction of layui vue. It should be noted that the style file needs to be imported separately

Import on demand

import App from './ App.vue'
import { createApp } from 'vue'
import { LayButton,  LayTable } from '@layui/layui-vue'
import '@layui/layui-vue/es/button/index.css';
import '@layui/layui-vue/es/table/index.css';

var app = createApp(App).

app.component("LayButton", LayButton);
app.component("LayTable", LayTable);

app.mount('#app')

Basic Example

<< span class="hljs-name">lay-layout></ span>
<< span class="hljs-name">lay-header></ span>
<< span class="hljs-name">lay-logo></ span>Layui Admin</< span class="hljs-name">lay-logo></ span>
</< span class="hljs-name">lay-header></ span>
<< span class="hljs-name">lay-side></ span></< span class="hljs-name">lay-side></ span>
<< span class="hljs-name">lay-body></ span>
<< span class="hljs-name">router-view></ span></< span class="hljs-name">router-view></ span>
</< span class="hljs-name">lay-body></ span>
<< span class="hljs-name">lay-footer></ span>pearadmin.com</< span class="hljs-name">lay-footer></ span>
</< span class="hljs-name">lay-layout></ span>

Topic

Custom Theme

Layui supports a certain degree of theme customization to meet the diverse visual needs of business and brand, including but not limited to visual customization of main colors, rounded corners, borders, and some components
Here are some of the most commonly used generic variables, and all style variables can be found here

@global-primary-color: #009688; < Span class="hljs comment">//Theme color
@global-checked-color: #5FB878; < Span class="hljs comment">//Select color
@global-border-radius: 2px; < Span class="hljs comment">//Roundness degree In addition to global theme configuration, we also provide customized theme configuration for components, which will cover the global configuration
@button-primary-color: #009688; < Span class="hljs comment">//Button theme color
@button-border-radius: 2px; < Span class="hljs comment">//Button fillet degree
...

Customization method

Create a separate ‘less’ variable file and import it to overwrite the variables in index. less

@import '@layui/layui-vue/lib/index.less'; < Span class="hljs comment">//Introduce the official provided less style entry file
@import 'your-theme-file.less'; < Span class="hljs comment">//Used to override the variables defined above

Note: Styles must be loaded in less format, and a common issue is the introduction of multiple styles where less styles are overwritten by CSS styles

Partial components

Color
Layui mainly uses the symbol of inclusiveness, dark green, as its main color tone. Due to its deep feeling, it is usually accompanied by light black, and blue, a more vivid color tone, is used to compensate for its color fatigue. Overall, it makes people feel fresh and natural, and more durable. The meaning of color selection: We are persistent in pragmatism, do not blindly compare ourselves, and always remember to bloom with vitality. This is exactly the value that Layui pursues

A component library based on Vue 3.0, another way of presenting layui插图1

In fact, layui is not afraid to try some bright colors, but in many cases it may not be suitable. Therefore, we classify these colors as “scenery”, which means presenting corresponding colors according to the actual scene. For example, if you want to give people a sense of alertness, you can try using the red color above

A component library based on Vue 3.0, another way of presenting layui插图2

Layui believes that gray represents minimalism because it is a magical color that can be paired with almost any element, is not prone to visual fatigue, and will never go out of style. Low profile yet elegant

A component library based on Vue 3.0, another way of presenting layui插图3

Button

Minimalist button

A component library based on Vue 3.0, another way of presenting layui插图4

Rounded corner button

A component library based on Vue 3.0, another way of presenting layui插图5

Layout

Basic layout

A component library based on Vue 3.0, another way of presenting layui插图6

Complex layout

A component library based on Vue 3.0, another way of presenting layui插图7

A component library based on Vue 3.0, another way of presenting layui插图8

Grid grid

Basic usage

A component library based on Vue 3.0, another way of presenting layui插图9

Grid offset

A component library based on Vue 3.0, another way of presenting layui插图10

Stream layout

A component library based on Vue 3.0, another way of presenting layui插图11

For more content, you can read it on your own

Component documentation:
http://layui-vue.pearadmin.com/zh-CN/components/color

资源下载此资源为免费资源立即下载
Telegram:@John_Software

Disclaimer: This article is published by a third party and represents the views of the author only and has nothing to do with this website. This site does not make any guarantee or commitment to the authenticity, completeness and timeliness of this article and all or part of its content, please readers for reference only, and please verify the relevant content. The publication or republication of articles by this website for the purpose of conveying more information does not mean that it endorses its views or confirms its description, nor does it mean that this website is responsible for its authenticity.

Ictcoder Free source code A component library based on Vue 3.0, another way of presenting layui https://ictcoder.com/kyym/a-component-library-based-on-vue-3-0-another-way-of-presenting-layui.html

Share free open-source source code

Q&A
  • 1, automatic: after taking the photo, click the (download) link to download; 2. Manual: After taking the photo, contact the seller to issue it or contact the official to find the developer to ship.
View details
  • 1, the default transaction cycle of the source code: manual delivery of goods for 1-3 days, and the user payment amount will enter the platform guarantee until the completion of the transaction or 3-7 days can be issued, in case of disputes indefinitely extend the collection amount until the dispute is resolved or refunded!
View details
  • 1. Heptalon will permanently archive the process of trading between the two parties and the snapshots of the traded goods to ensure that the transaction is true, effective and safe! 2, Seven PAWS can not guarantee such as "permanent package update", "permanent technical support" and other similar transactions after the merchant commitment, please identify the buyer; 3, in the source code at the same time there is a website demonstration and picture demonstration, and the site is inconsistent with the diagram, the default according to the diagram as the dispute evaluation basis (except for special statements or agreement); 4, in the absence of "no legitimate basis for refund", the commodity written "once sold, no support for refund" and other similar statements, shall be deemed invalid; 5, before the shooting, the transaction content agreed by the two parties on QQ can also be the basis for dispute judgment (agreement and description of the conflict, the agreement shall prevail); 6, because the chat record can be used as the basis for dispute judgment, so when the two sides contact, only communicate with the other party on the QQ and mobile phone number left on the systemhere, in case the other party does not recognize self-commitment. 7, although the probability of disputes is very small, but be sure to retain such important information as chat records, mobile phone messages, etc., in case of disputes, it is convenient for seven PAWS to intervene in rapid processing.
View details
  • 1. As a third-party intermediary platform, Qichou protects the security of the transaction and the rights and interests of both buyers and sellers according to the transaction contract (commodity description, content agreed before the transaction); 2, non-platform online trading projects, any consequences have nothing to do with mutual site; No matter the seller for any reason to require offline transactions, please contact the management report.
View details

Related Article

make a comment
No comments available at the moment
Official customer service team

To solve your worries - 24 hours online professional service