Plumliil Documentation

website·Indexed 31 days ago

https://docs.plumliil.cn/

A collection of technical notes and guides covering frontend and backend technologies, including JavaScript, TypeScript, Vue (Vue-Router, Vuex), React, and MySQL. It also includes documentation for simplify-deploy, a Node.js-based SSH deployment tool.

Tokens
20.9K
Snippets
117
Records
147
Agent score
49%

What's inside Plumliil Docs

  1. Overview of VuePress theme-hope layout components

    The VuePress theme-hope layout consists of global elements and page-specific components that can be customized via theme options and page frontmatter.

    Global Layout Elements:

    • Navbar
    • Sidebar
    • Footer

    Page-Specific Elements:

    • Breadcrumbs
    • Page Title and information
    • Table of Contents (TOC)
    • Meta information (update time and contributors)
    • Comments section

    Interface Elements:

    • Dark Mode toggle button
    • Back to top button
    • Print button
  2. Overview of Markdown enhancements in VuePress Theme Hope

    VuePress generates pages from Markdown files using markdown-it. Theme Hope extends this functionality through two primary layers: standard VuePress enhancements and additional theme-specific enhancements provided by the vuepress-plugin-md-enhance plugin. These extensions allow for richer content including interactive components, charts, and advanced layout options.
  3. Overview of TypeScript

    TypeScript is a free and open-source programming language developed by Microsoft. It is a superset of JavaScript that supports the ECMAScript 6 (ES6) standard. It is specifically designed for the development of large-scale applications and can be compiled into plain JavaScript, allowing the resulting code to run in any web browser.
  4. Overview of React (React.js/ReactJS)

    React is a free and open-source JavaScript library used for building user interfaces based on UI components. Maintained by Meta (formerly Facebook) and a community of individual developers and companies, it serves as a foundation for developing single-page, mobile, or server-rendered applications (often using frameworks like Next.js). React focuses specifically on state management and rendering that state to the DOM; consequently, additional libraries are typically required for routing and specific client-side functionality.
  5. Understand MySQL core concepts and features

    MySQL is a free, open-source Relational Database Management System (RDBMS) designed for performance, stability, and scalability. Key architectural concepts include:

    • Database and Table Structure: Data is organized into databases, which contain tables consisting of rows and columns. Each column must have a defined data type.
    • SQL Language: Uses Structured Query Language (SQL) for data manipulation (Create, Insert, Update, Delete) and database management.
    • Data Types: Supports various types including integers, floating-point numbers, strings, dates, and times.
    • Indexing: Uses data structures to sort and store column values, significantly accelerating data retrieval speeds.
    • Transaction Support: Ensures data consistency and integrity via transactions—logical units of work that either fully succeed or roll back entirely.
    • Security: Includes user permission management, SSL encrypted transmission, and backup/recovery mechanisms.
    • Scalability and Availability: Supports high availability and scaling for large datasets through master-slave replication, sharding, and clustering.
  6. Understand JavaScript Object-Oriented Programming (OOP) principles

    Object-Oriented Programming in JavaScript focuses on objects as functional centers with specific responsibilities. The core pillars are Encapsulation, Inheritance, and Polymorphism. Unlike procedural programming, which focuses on a sequence of steps, OOP divides problems into objects and defines their interactions, making it more flexible, reusable, and maintainable for large-scale projects.
  7. Understand JavaScript Promise basics and states

    A Promise is a solution for asynchronous programming in JavaScript. Syntactically, it is an object that allows you to retrieve the result of an asynchronous operation. Once a Promise is created, it executes immediately. A Promise exists in one of three mutually exclusive states:

    • pending: The initial state, awaiting completion.
    • fulfilled: The operation completed successfully.
    • rejected: The operation failed.

    Crucially, once a Promise transitions from pending to either fulfilled or rejected, its state becomes immutable and cannot be changed again.

  8. Inspect MySQL databases and tables

    Use SHOW and DESC commands to retrieve metadata about your databases and table structures.
    -- Database inspection
    SHOW DATABASES; -- List all databases
    SELECT DATABASE(); -- Current connected database
    SHOW CREATE DATABASE db_name; -- Show creation script for a specific DB
    
    -- Table inspection
    DESC grade; -- Show table structure/columns
    SHOW CREATE TABLE grade; -- Show creation script for a specific table
  9. Optimize function references with useCallback

    Use useCallback to memoize a function definition. This prevents the function from being recreated on every render unless its dependencies change. This is particularly useful when passing functions to child components wrapped in React.memo, as it prevents unnecessary re-renders of those children.
    const render = React.useCallback(() => {
      let list = [];
      for (let i = 0; i < range.max; i++) {
        list.push(<li key={i}>{i}</li>);
      }
      return list;
    }, [range]); // Only recreates if range changes
  10. Declare variables using var, let, and const

    JavaScript provides three ways to declare variables, with a recommended priority of const > let > var.

    • var: Function-scoped. Variables are hoisted to the top of the function scope. If declared without a keyword inside a function, it becomes a global variable.
    • let: Block-scoped. Does not support hoisting (exists in a 'Temporal Dead Zone' until declaration). Cannot be redeclared in the same scope.
    • const: Block-scoped. Used for constants that cannot be reassigned. Note: While the reference is constant, properties of objects or elements of arrays declared with const can still be modified.
    // var hoisting
    function fn() {
      console.log(age); // undefined
      var age = 18;
    }
    
    // let block scope
    if(true) {
      let message = 'hello';
    }
    console.log(message); // ReferenceError
    
    // const usage
    const web = 'lyh.com';
    // web = 'new.com'; // TypeError
  11. Basic Vuex usage in Vue 3 with Composition API

    In Vue 3, use the useStore hook to access the Vuex store instance within the <script setup> block. You can then access the state directly or commit mutations using store.commit().
    <template>
      <div>
        <h1>{{ store.state.num }}</h1>
        <button @click="add">+1</button>
        <button>-1</button>
      </div>
    </template>
    
    <script setup>
    import { useStore } from "vuex";
    const store = useStore();
    
    const add = () => {
      store.commit("add");
      console.log(store.state.num);
    };
    </script>
  12. Use the setup function in Composition API

    The setup() function is the entry point for the Composition API. It executes once during component initialization. Data and methods returned from setup are directly available in the template. Note that this is not available inside setup. Avoid making setup an async function unless you are using the Suspense component, as an async setup turns the component into an asynchronous component.