GitHub
(이전 PDQuickUI, 버전 0.6.0부터 QuickUI로 이름 변경)
QuickUI는 PDRenderKit에서 파생된 프런트엔드 렌더링 프레임워크로, 프런트엔드 프레임워크 기능 향상에 중점을 두고 있습니다.
가상 DOM을 통합하여 렌더링 로직을 다시 작성하여 렌더링 효율성을 높이고 더 빠른 데이터 관찰 및 자동 업데이트를 가능하게 합니다.
이 프로젝트는 호환성과 성능을 보장하기 위해 PDRenderKit에서 프로토타입 확장을 제거하여 복잡한 애플리케이션에 적합하게 만듭니다.
모듈 버전과 비모듈 버전을 모두 제공하며 라이센스를 PDRenderKit의 GPL-3.0에서 MIT로 변경합니다.
특징
- 명확한 아키텍처: UI를 데이터 로직과 분리하여 유지 관리가 더 쉽습니다.
- 코드 단순성: 중복되는 코드를 줄이고 가독성을 높입니다.
- 자동 렌더링: 데이터 변경 및 업데이트를 자동으로 모니터링하여 수동 작업을 최소화합니다.
- 경량: 20kb 미만의 파일 크기 내에서 모든 기능을 유지합니다.
설치
-
npm에서 설치
npm i @pardnchiu/quickui
-
CDN에서 포함
-
QuickUI 직접 포함
<!-- Version 0.6.0 and above --> <script src="https://cdn.jsdelivr.net/npm/@pardnchiu/quickui@%5BVERSION%5D/dist/QuickUI.js"></script> <!-- Version 0.5.4 and below --> <script src="https://cdn.jsdelivr.net/npm/pdquickui@%5BVERSION%5D/dist/PDQuickUI.js"></script>
-
모듈 버전
// Version 0.6.0 and above import { QUI } from "https://cdn.jsdelivr.net/npm/@pardnchiu/quickui@[VERSION]/dist/QuickUI.esm.js"; // Version 0.5.4 and below import { QUI } from "https://cdn.jsdelivr.net/npm/pdquickui@[VERSION]/dist/PDQuickUI.module.js";
-
용법
-
QUI 초기화
const app = new QUI({ id: "", // Specify rendering element data: { // Custom DATA }, event: { // Custom EVENT }, when: { before_render: function () { // Stop rendering }, rendered: function () { // Rendered }, before_update: function () { // Stop updating }, updated: function () { // Updated }, before_destroy: function () { // Stop destruction }, destroyed: function () { // Destroyed } } });
개요
자동 렌더링: 데이터 변경이 감지되면 자동으로 다시 로드됩니다.
속성 개요
Attribute | Description |
---|---|
{{value}} | Inserts text into HTML tags and automatically updates with data changes. |
:path | Used with the temp tag to load HTML fragments from external files into the current page. |
:html | Replaces the element's innerHTML with text. |
:for | Supports formats like item in items, (item, index) in items, (key, value) in object. Iterates over data collections to generate corresponding HTML elements. |
:if :else-if :elif :else |
Displays or hides elements based on specified conditions, enabling branching logic. |
:model | Binds data to form elements (e.g., input), updating data automatically when input changes. |
:hide | Hides elements based on specific conditions. |
:animation | Specifies transition effects for elements, such as fade-in or expand, to enhance user experience. |
:mask | Controls block loading animations, supporting `true |
:[attr] | Sets element attributes, such as ID, class, image source, etc. Examples: :id/:class/:src/:alt/:href... |
:[css] | Sets element CSS, such as margin, padding, etc. Examples: :background-color, :opacity, :margin, :top, :position... |
@[event] | Adds event listeners that trigger specified actions upon activation. Examples: @click/@input/@mousedown... |
텍스트 교체
{{값}}
-
index.html
npm i @pardnchiu/quickui
-
결과
<!-- Version 0.6.0 and above --> <script src="https://cdn.jsdelivr.net/npm/@pardnchiu/quickui@%5BVERSION%5D/dist/QuickUI.js"></script> <!-- Version 0.5.4 and below --> <script src="https://cdn.jsdelivr.net/npm/pdquickui@%5BVERSION%5D/dist/PDQuickUI.js"></script>
:html
-
index.html
// Version 0.6.0 and above import { QUI } from "https://cdn.jsdelivr.net/npm/@pardnchiu/quickui@[VERSION]/dist/QuickUI.esm.js"; // Version 0.5.4 and below import { QUI } from "https://cdn.jsdelivr.net/npm/pdquickui@[VERSION]/dist/PDQuickUI.module.js";
-
결과
const app = new QUI({ id: "", // Specify rendering element data: { // Custom DATA }, event: { // Custom EVENT }, when: { before_render: function () { // Stop rendering }, rendered: function () { // Rendered }, before_update: function () { // Stop updating }, updated: function () { // Updated }, before_destroy: function () { // Stop destruction }, destroyed: function () { // Destroyed } } });
블록 삽입
> [!참고]
> 테스트할 때 브라우저에서 로컬 파일 제한을 비활성화하거나 라이브 서버를 사용하십시오.
:길
-
테스트.html
<h1 id="title">{{ title }}</h1> const app = new QUI({ id: "app", data: { title: "test" } });
-
index.html
<h1 id="test">test</h1>
-
결과
const app = new QUI({ id: "app", data: { html: "<b>innerHtml</b>" } });
루프 렌더링
:을 위한
-
index.html
<b>innerHtml</b>
-
결과
<h1 id="path-heading">path heading</h1> <p>path content</p>
-
결과
const app = new QUI({ id: "app" });
조건부 렌더링
-
index.html
<h1 id="path-heading">path heading</h1> <p>path content</p>
-
결과: 제목 = 1
- {{ item }} {{ CALC(index + 1) }}
-
결과: 제목 = null && isH2 = 참
Nest loop
-
index.html
-
{{ key }}: {{ val.name }}
-
{{ item.name }}
- {{ CALC(index1 + 1) }}. {{ item1.name }} - ${{ item1.price }}
-
{{ item.name }}
-
{{ key }}: {{ val.name }}
-
결과: 제목 = 3 && isH2 = null
- food: Food
- Snacks
- 1. Potato Chips -
- 2. Chocolate -
- Beverages
- 1. Juice -
- 2. Tea -
- Snacks
- home: Home
- Furniture
- 1. Sofa - 0
- 2. Table - 0
- Decorations
- 1. Picture Frame -
- 2. Vase -
- Furniture
- food: Food
-
결과: 제목 = null && isH2 = null
<h1 id="title-heading">{{ title }} {{ heading }}</h1> <h2 id="title-heading">{{ title }} {{ heading }}</h2> <h3 id="title-heading">{{ title }} {{ heading }}</h3> <h4 id="title-heading">{{ title }} {{ heading }}</h4> const app = new QUI({ id: "app", data: { heading: [Number|null], isH2: [Boolean|null], title: "test" } });
템플릿 렌더링
-
index.html
<h1 id="test">test 1</h1>
-
결과
<h2 id="test">test </h2>
바인딩
<h3 id="test">test 3</h3>
이벤트
<h4 id="test">test </h4>
CSS
> [!참고]
> :[CSS 속성]을 사용하여 데이터를 스타일 속성에 직접 바인딩하는 간단한 설정을 지원합니다.
-
index.html
const test = new QUI({ id: "app", data: { hint: "hint 123", title: "test 123" }, render: () => { return ` "{{ hint }}", h1 { style: "background: red;", children: [ "{{ title }}" ] }` } })
-
결과:
hint 123 <h1 id="test">test 123</h1>
기능
길이()
-
index.html
test const app = new QUI({ id: "app", data: { password: null, }, event: { show: function(e){ alert("Password:", app.data.password); } } });
-
결과
test const app = new QUI({ id: "app", event: { test: function(e){ alert(e.target.innerText + " clicked"); } } });
CALC()
-
index.html
test const app = new QUI({ id: "app", data: { width: "100px", color: "red" } });
-
결과
test
상() / 하()
-
index.html
<p>Total: {{ LENGTH(array) }}</p> const app = new QUI({ id: "app", data: { array: [1, 2, 3, 4] } });
-
결과
<p>Total: 4</p>
DATE(숫자, 형식)
-
index.html
<p>calc: {{ CALC(num * 10) }}</p> const app = new QUI({ id: "app", data: { num: 1 } });
-
결과
<p>calc: 10</p>
지연로드
:지연로드
-
index.html
<p>{{ UPPER(test1) }} {{ LOWER(test2) }}</p> const app = new QUI({ id: "app", data: { test1: "upper", test2: "LOWER" } });
-
결과
<p>UPPER lower</p>
SVG 교체
-
test.svg
<p>{{ DATE(now, YYYY-MM-DD hh:mm:ss) }}</p> const app = new QUI({ id: "app", data: { now: Math.floor(Date.now() / 1000) } });
-
index.html
<p>2024-08-17 03:40:47</p>
-
결과
<img src="/static/imghwm/default1.png" data-src="test.jpg" class="lazy" alt="QuickUI: 경량 프런트엔드 프레임워크" > const app = new QUI({ id: "app", data: { image: "test.jpg" }, option: { lazyload: true // Enable image lazy loading: true|false (default: true) } });
i18n
> [!참고]
> 형식이 객체인 경우 다국어 콘텐츠를 직접 구성합니다.
> 형식이 문자열인 경우 언어 파일은 가져오기를 통해 동적으로 로드됩니다.
-
en.json
<img src="/static/imghwm/default1.png" data-src="test.jpg" class="lazy" alt="QuickUI: 경량 프런트엔드 프레임워크" >
-
index.html
-
결과 i18nLang = zh
const app = new QUI({ id: "app", data: { svg: "test.svg", }, option: { svg: true // Enable SVG file transformation: true|false (default: true) } });
-
결과 i18nLang = en
수명주기 후크
{ "greeting": "Hello", "username": "Username" }
데이터 검색
npm i @pardnchiu/quickui
창조자
邱敬幃 Pardn Chiu
특허
이 프로젝트는 독점 라이선스에 따라 라이선스가 부여됩니다.
최종 사용자 라이센스 계약(EULA)에 명시된 조건에 따라서만 이 소프트웨어를 사용, 설치 및 실행할 수 있습니다.
©️ 2024 邱敬幃 Pardn Chiu
위 내용은 QuickUI: 경량 프런트엔드 프레임워크의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

파이썬과 자바 스크립트 간의 성능과 효율성의 차이는 주로 다음과 같이 반영됩니다. 1) 해석 된 언어로서, 파이썬은 느리게 실행되지만 개발 효율이 높고 빠른 프로토 타입 개발에 적합합니다. 2) JavaScript는 브라우저의 단일 스레드로 제한되지만 멀티 스레딩 및 비동기 I/O는 Node.js의 성능을 향상시키는 데 사용될 수 있으며 실제 프로젝트에서는 이점이 있습니다.

JavaScript는 1995 년에 시작하여 Brandon Ike에 의해 만들어졌으며 언어를 C로 실현했습니다. 1.C Language는 JavaScript의 고성능 및 시스템 수준 프로그래밍 기능을 제공합니다. 2. JavaScript의 메모리 관리 및 성능 최적화는 C 언어에 의존합니다. 3. C 언어의 크로스 플랫폼 기능은 자바 스크립트가 다른 운영 체제에서 효율적으로 실행하는 데 도움이됩니다.

JavaScript는 브라우저 및 Node.js 환경에서 실행되며 JavaScript 엔진을 사용하여 코드를 구문 분석하고 실행합니다. 1) 구문 분석 단계에서 초록 구문 트리 (AST)를 생성합니다. 2) 컴파일 단계에서 AST를 바이트 코드 또는 기계 코드로 변환합니다. 3) 실행 단계에서 컴파일 된 코드를 실행하십시오.

Python 및 JavaScript의 미래 추세에는 다음이 포함됩니다. 1. Python은 과학 컴퓨팅 분야에서의 위치를 통합하고 AI, 2. JavaScript는 웹 기술의 개발을 촉진하고, 3. 교차 플랫폼 개발이 핫한 주제가되고 4. 성능 최적화가 중점을 둘 것입니다. 둘 다 해당 분야에서 응용 프로그램 시나리오를 계속 확장하고 성능이 더 많은 혁신을 일으킬 것입니다.

개발 환경에서 Python과 JavaScript의 선택이 모두 중요합니다. 1) Python의 개발 환경에는 Pycharm, Jupyternotebook 및 Anaconda가 포함되어 있으며 데이터 과학 및 빠른 프로토 타이핑에 적합합니다. 2) JavaScript의 개발 환경에는 Node.js, VScode 및 Webpack이 포함되어 있으며 프론트 엔드 및 백엔드 개발에 적합합니다. 프로젝트 요구에 따라 올바른 도구를 선택하면 개발 효율성과 프로젝트 성공률이 향상 될 수 있습니다.

예, JavaScript의 엔진 코어는 C로 작성되었습니다. 1) C 언어는 효율적인 성능과 기본 제어를 제공하며, 이는 JavaScript 엔진 개발에 적합합니다. 2) V8 엔진을 예를 들어, 핵심은 C로 작성되며 C의 효율성 및 객체 지향적 특성을 결합하여 C로 작성됩니다.

JavaScript는 웹 페이지의 상호 작용과 역학을 향상시키기 때문에 현대 웹 사이트의 핵심입니다. 1) 페이지를 새로 고치지 않고 콘텐츠를 변경할 수 있습니다. 2) Domapi를 통해 웹 페이지 조작, 3) 애니메이션 및 드래그 앤 드롭과 같은 복잡한 대화식 효과를 지원합니다. 4) 성능 및 모범 사례를 최적화하여 사용자 경험을 향상시킵니다.

C 및 JavaScript는 WebAssembly를 통한 상호 운용성을 달성합니다. 1) C 코드는 WebAssembly 모듈로 컴파일되어 컴퓨팅 전력을 향상시키기 위해 JavaScript 환경에 도입됩니다. 2) 게임 개발에서 C는 물리 엔진 및 그래픽 렌더링을 처리하며 JavaScript는 게임 로직 및 사용자 인터페이스를 담당합니다.


핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

Video Face Swap
완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

인기 기사

뜨거운 도구

Atom Editor Mac 버전 다운로드
가장 인기 있는 오픈 소스 편집기

VSCode Windows 64비트 다운로드
Microsoft에서 출시한 강력한 무료 IDE 편집기

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

SublimeText3 영어 버전
권장 사항: Win 버전, 코드 프롬프트 지원!

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기
