Skip to content

Commit

Permalink
更新
Browse files Browse the repository at this point in the history
  • Loading branch information
Wh0ami-hy committed Sep 10, 2024
1 parent a13f70a commit 94bc6d7
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 11 deletions.
19 changes: 10 additions & 9 deletions _posts/.obsidian/workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"state": {
"type": "markdown",
"state": {
"file": "2023-12-30-node.md",
"file": "2023-12-30-Node.md",
"mode": "source",
"source": false
}
Expand Down Expand Up @@ -48,7 +48,7 @@
"state": {
"type": "search",
"state": {
"query": "",
"query": "file:node",
"matchingCase": false,
"explainSearch": false,
"collapseAll": false,
Expand All @@ -70,8 +70,7 @@
}
],
"direction": "horizontal",
"width": 300,
"collapsed": true
"width": 300
},
"right": {
"id": "d508948902057409",
Expand All @@ -87,7 +86,7 @@
"state": {
"type": "backlink",
"state": {
"file": "2023-12-30-node.md",
"file": "2023-12-30-Node.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
Expand All @@ -104,7 +103,7 @@
"state": {
"type": "outgoing-link",
"state": {
"file": "2023-12-30-node.md",
"file": "2023-12-30-Node.md",
"linksCollapsed": false,
"unlinkedCollapsed": true
}
Expand Down Expand Up @@ -139,7 +138,7 @@
"state": {
"type": "outline",
"state": {
"file": "2023-12-30-node.md"
"file": "2023-12-30-Node.md"
}
}
}
Expand All @@ -160,10 +159,12 @@
"command-palette:Open command palette": false
}
},
"active": "484e8eca18f08b6b",
"active": "14da16911b35c692",
"lastOpenFiles": [
"2024-09-09-前端框架中的状态管理.md",
"2024-09-10-Taro开发实践.md",
"2024-08-30-React最佳实践.md",
"2023-12-30-node.md",
"2024-09-09-前端框架中的状态管理.md",
"2024-02-07-Vue项目结构.md",
"2024-03-24-Quasar开发总结.md",
"2024-08-26-React入门.md",
Expand Down
4 changes: 2 additions & 2 deletions _posts/2023-12-30-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: post
catalog: true
tags:
- node
- Node
---


Expand Down Expand Up @@ -89,7 +89,7 @@ npm install xxx 利用 npm 安装xxx依赖到当前命令行所在目录
npm install xxx -g 利用npm安装全局依赖xxx
npm install xxx –save 安装并写入package.json的”dependencies”中
npm install xxx –save-dev 安装并写入package.json的”devDependencies”中
 

**npm删除依赖**
npm uninstall xxx 删除xxx依赖
npm uninstall xxx -g 删除全局依赖xxx
27 changes: 27 additions & 0 deletions _posts/2024-09-10-Taro开发实践.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
layout: post
catalog: true
tags:
- Taro

---

# 1. 概念

 Taro 在组件、API、路由等规范上,遵循微信小程序规范,所以在 Taro 中使用 React 和开发者熟悉的 Web 端有一些差异

因为在 Taro 3 中开发者使用的是真实的 React,React 的 API 如 `Component``useState``useEffect` 等都需要从 React 包中获取。

从 Taro v3.5 开始,Taro 将默认使用 React 18 版本

```
// 从 'react' 包中获取 React API
import React, { Component, useState, useEffect } from 'react'
```

UI组件使用Taro UI
# 2. 入口组件和页面组件

因为 Taro 遵循小程序的路由规范,所以引入了入口组件和页面组件的概念,分别对应小程序规范的入口组件 `app` 和页面组件 `page`

一个 Taro 应用由一个入口组件和至少一个页面组件所组成。

0 comments on commit 94bc6d7

Please sign in to comment.