快乐冲浪与生活

多体验、多体会、多体悟

0%

5 天学习 Nuxt.js,主要以官方文档为主,对于不明白的地方则问下豆包,加深理解。

资源:

  1. 官方 - 介绍
  2. 官方 - 安装
  3. 官方 - 配置
  4. 官方 - 视图

介绍

Nuxt is a free and open-source framework with an intuitive and extendable way to create type-safe, performant and production-grade full-stack web applications and websites with Vue.js.

验证目标:在特定场景下(OR 连接不同字段的条件),将 OR 查询拆分为 UNION ALL 能显著提升查询效率。

通过 Docker 运行 MySQL 服务

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
$ docker pull mysql:8.0
$ docker run -d \
    --name mysql-or-testing \
    -p 3306:3306 \
    -e MYSQL_ROOT_PASSWORD=123456 \
    -e MYSQL_CHARACTER_SET_SERVER=utf8mb4 \
    -e MYSQL_COLLATION_SERVER=utf8mb4_unicode_ci \
    -v mysql_data:/var/lib/mysql \
    --restart=always \
    mysql:8.0

查看服务运行状态:

基础查询、关联查询、排序与分组、特殊场景、索引设计

基础查询优化

🎯 目标:规避全表扫描、减少网络 / 内存开销,让查询更轻量化

  1. 只查所需字段,拒绝 SELECT *

❌ SELECT * FROM users;

✅ SELECT id, name, phone FROM users;

Mosquitto 是 MQTT 的开源实现之一,GitHub 地址 https://github.com/eclipse-mosquitto/mosquitto ,介绍信息如下:

Mosquitto is an open source implementation of a server for version 5.0, 3.1.1, and 3.1 of the MQTT protocol. It also includes a C and C++ client library, the mosquitto_pub mosquitto_rr, and mosquitto_sub utilities for publishing and subscribing, and the mosquitto_ctrl, mosquitto_signal, and mosquitto_passwd applications for helping administer the broker.

MQTT 是什么

MQTT(Message Queuing Telemetry Transport,消息队列遥测传输)是一种轻量级基于发布 / 订阅(Pub/Sub)模式的应用层网络协议,专为低带宽、高延迟、不稳定的网络环境(如物联网、嵌入式设备)设计

Zod 中定义的 Record 对应着 TS 中的 Record,用于构建键值对。

1
2
3
4
5
6
7
8
import * as z from 'zod'

const StudentSchema = z.record(z.string(), z.string())
type Student = z.infer<typeof StudentSchema>

// 等价于

type Student = Record<string, string>

JSON 和对象

TS 中 Record 与 JSON 和对象相似,对应的概念如下: