v0.6.22

Getting Started

Last updated


This page covers how to install QuickUI and bind your first data object to a page.

Prerequisites


ItemRequirement
BrowserES2022, Proxy, IntersectionObserver and structuredClone support
HTTP serverRequired when using external i18n files or <temp :path>; fetch fails under file://
Node.jsOnly needed when building from source

Installation


CDN


  1. <script src="https://cdn.jsdelivr.net/npm/@pardnchiu/quickui@latest/dist/QuickUI.js"></script>

Loading the script registers three globals: QUI, _ and $. See Global Helpers.

npm


  1. npm i @pardnchiu/quickui

ESM


  1. import { QUI } from "@pardnchiu/quickui";

package.json points module at dist/QuickUI.esm.js, so bundlers resolve the bare package name to the ESM build. The ESM build is the same code as the CDN build with window.QUI exported at the end, so importing it still registers the globals.

From Source


  1. git clone https://github.com/pardnchiu/QuickUI.git
  2. cd QuickUI
  3. npm install
  4. npm run build:once

build:once runs tsc to bundle src/ into src/QuickUI.debug.js, then terser produces dist/QuickUI.js and dist/QuickUI.esm.js.

Your First App


  1. <div id="app">
  2. <h1>{{ title }}</h1>
  3. <p>{{ description }}</p>
  4. </div>
  5. <script>
  6. const app = new QUI({
  7. id: "app",
  8. data: {
  9. title: "Hello QuickUI",
  10. description: "A lightweight frontend framework",
  11. },
  12. });
  13. </script>
Live preview · @pardnchiu/quickui@0.6.22

id points to an existing element whose content becomes the template. Changing app.data.title later re-renders the page about 300 ms after the change.

Next Steps


GoalPage
Learn the template syntaxText Binding, Conditional Rendering, Loop Rendering
Handle user inputEvent Binding, Two-way Binding
Look up every optionConstructor Options
中文