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 1,381
Resource Number 38567 Last Updated 2025-02-24
¥ 0HKD 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/a-component-library-based-on-vue-3-0-another-way-of-presenting-layui/

Share free open-source source code

Q&A
  • 1. Automatic: After making an online payment, click the (Download) link to download the source code; 2. Manual: Contact the seller or the official to check if the template is consistent. Then, place an order and make payment online. The seller ships the goods, and both parties inspect and confirm that there are no issues. ICTcoder will then settle the payment for the seller. Note: Please ensure to place your order and make payment through ICTcoder. If you do not place your order and make payment through ICTcoder, and the seller sends fake source code or encounters any issues, ICTcoder will not assist in resolving them, nor can we guarantee your funds!
View details
  • 1. Default transaction cycle for source code: The seller manually ships the goods within 1-3 days. The amount paid by the user will be held in escrow by ICTcoder until 7 days after the transaction is completed and both parties confirm that there are no issues. ICTcoder will then settle with the seller. In case of any disputes, ICTcoder will have staff to assist in handling until the dispute is resolved or a refund is made! If the buyer places an order and makes payment not through ICTcoder, any issues and disputes have nothing to do with ICTcoder, and ICTcoder will not be responsible for any liabilities!
View details
  • 1. ICTcoder will permanently archive the transaction process between both parties and snapshots of the traded goods to ensure the authenticity, validity, and security of the transaction! 2. ICTcoder cannot guarantee services such as "permanent package updates" and "permanent technical support" after the merchant's commitment. Buyers are advised to identify these services on their own. If necessary, they can contact ICTcoder for assistance; 3. When both website demonstration and image demonstration exist in the source code, and the text descriptions of the website and images are inconsistent, the text description of the image shall prevail as the basis for dispute resolution (excluding special statements or agreements); 4. If there is no statement such as "no legal basis for refund" or similar content, any indication on the product that "once sold, no refunds will be supported" or other similar declarations shall be deemed invalid; 5. Before the buyer places an order and makes payment, the transaction details agreed upon by both parties via WhatsApp or email can also serve as the basis for dispute resolution (in case of any inconsistency between the agreement and the description of the conflict, the agreement shall prevail); 6. Since chat records and email records can serve as the basis for dispute resolution, both parties should only communicate with each other through the contact information left on the system when contacting each other, in order to prevent the other party from denying their own commitments. 7. Although the probability of disputes is low, it is essential to retain important information such as chat records, text messages, and email records, in case a dispute arises, so that ICTcoder can intervene quickly.
View details
  • 1. As a third-party intermediary platform, ICTcoder solely protects transaction security and the rights and interests of both buyers and sellers based on the transaction contract (product description, agreed content before the transaction); 2. For online trading projects not on the ICTcoder platform, any consequences are unrelated to this platform; regardless of the reason why the seller requests an offline transaction, please contact the administrator to report.
View details

Related Source code

ICTcoder Customer Service

24-hour online professional services