-
- 课程主题
- 学习梯形图编程规则相关知识
- 梯形图优势
- 易于掌握且程序一目了然
- 是常用的PLC编程语言
- 基本结构与顺序
- 类似继电器控制电路图
- 自上而下、从左到右顺序排列
- 触点位置限制
- 触点不能置于线圈右边
- 线圈不能直接连左母线
- 双线圈输出问题
- 避免同一编号线圈多次使用
- 双线圈输出可能导致错误
- 触点使用规则
- 串联并联触点可无限制使用
- 优化放置可减少指令调速
- 输出线圈连接
- 可并联输出多个线圈
- 不能串联输出多个线圈
- 元件触点特性
- 多种元件触点可多次重复使用
- 课程主题
小于 1 分钟
而古尔丹代价是什么
按下 Ctrl + Alt + L
,即可快速打开解决方案资源管理器。
Visual Studio 2022 Professional
激活码:TD244-P4NB7-YQ6XK-Y8MMM-YWV2J
按 Win + S
打开搜索栏,输入 任务计划程序
,然后点击打开。
Promise
是 JavaScript 中用于处理异步操作的对象,它代表着一个异步操作的最终完成(或失败)及其结果值。简单来说,Promise
提供了一种优雅的方式来处理像网络请求、定时器、文件读取等异步任务。
Promise
的三种状态:pending
(等待中):初始状态,既没有完成,也没有拒绝。fulfilled
(已成功):操作成功完成,Promise 有了一个结果值(通过 resolve()
实现)。rejected
(已失败):操作失败,Promise 有了拒绝的原因(通过 reject()
实现)。直接放在theme.ts里面的插件里面:
docsearch: {
appId: '', // 替换为你的 appId
apiKey: '', // 替换为你的 apiKey
indexName: '', // 替换为你的 indexName
// 可选项,参考 DocSearch 配置文档
placeholder: '搜索文档',
translations: {
button: {
buttonText: '搜索',
},
// 其他翻译选项
},
},
## 文件夹结构
```
├── .gitignore
├── .vscode/
├── index.html
├── node_modules/
├── package-lock.json
├── package.json
├── public/
├── src/
│ ├── App.vue
│ ├── assets/
│ │ └── vue.svg
│ ├── components/
│ ├── main.ts
│ ├── router/
│ │ └── index.ts
│ ├── style.css
│ ├── views/
│ │ ├── About.vue
│ │ └── Home.vue
│ └── vite-env.d.ts
├── tsconfig.app.json
├── tsconfig.json
├── tsconfig.node.json
├── vite.config.ts
└── vue-router-example汇总源码.md
```
====================== vue-router-example\.gitignore ======================
## vue-router-example\.gitignore
``` # 内容未读取(排除)
```
====================== vue-router-example\index.html ======================
## vue-router-example\index.html
```html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue + TS</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
```
====================== vue-router-example\package-lock.json ======================
## vue-router-example\package-lock.json
``` # 内容未读取(排除)
```
====================== vue-router-example\package.json ======================
## vue-router-example\package.json
```json
{
"name": "vue-router-example",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vue-tsc -b && vite build",
"preview": "vite preview"
},
"dependencies": {
"vue": "^3.5.10",
"vue-router": "^4.4.5"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.1.4",
"typescript": "^5.5.3",
"vite": "^5.4.8",
"vue-tsc": "^2.1.6"
}
}
```
====================== vue-router-example\tsconfig.app.json ======================
## vue-router-example\tsconfig.app.json
```json
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,
"jsx": "preserve",
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"]
}
```
====================== vue-router-example\tsconfig.json ======================
## vue-router-example\tsconfig.json
```json
{
"files": [],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
]
}
```
====================== vue-router-example\tsconfig.node.json ======================
## vue-router-example\tsconfig.node.json
```json
{
"compilerOptions": {
"target": "ES2022",
"lib": ["ES2023"],
"module": "ESNext",
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["vite.config.ts"]
}
```
====================== vue-router-example\vite.config.ts ======================
## vue-router-example\vite.config.ts
```ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
})
```
====================== vue-router-example\vue-router-example汇总源码.md ======================
## vue-router-example\vue-router-example汇总源码.md
``` # 内容未读取(排除)
```
====================== vue-router-example\src\App.vue ======================
## vue-router-example\src\App.vue
```vue
<script lang="ts" setup>
</script>
<template>
<!-- 根据当前路由,渲染对应的组件 -->
<router-view></router-view>
</template>
<style>
nav {
margin-bottom: 20px;
}
</style>
```
====================== vue-router-example\src\main.ts ======================
## vue-router-example\src\main.ts
```ts
// src/main.ts
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
const app = createApp(App)
app.use(router)
app.mount('#app')
```
====================== vue-router-example\src\style.css ======================
## vue-router-example\src\style.css
``` # 内容未读取(排除)
```
====================== vue-router-example\src\vite-env.d.ts ======================
## vue-router-example\src\vite-env.d.ts
```ts
/// <reference types="vite/client" />
```
====================== vue-router-example\src\assets\vue.svg ======================
## vue-router-example\src\assets\vue.svg
``` # 内容未读取(排除)
```
====================== vue-router-example\src\router\index.ts ======================
## vue-router-example\src\router\index.ts
```ts
// src/router/index.ts
import { createRouter, createWebHistory } from 'vue-router'
import Home from '../views/Home.vue'
import About from '../views/About.vue'
const routes = [
{ path: '/', component: Home },
{ path: '/about', component: About }
]
const router = createRouter({
history: createWebHistory(),
routes
})
export default router
```
====================== vue-router-example\src\views\About.vue ======================
## vue-router-example\src\views\About.vue
```vue
<template>
<div>
<h1>关于我们</h1>
<p>这是关于页面。</p>
</div>
</template>
```
====================== vue-router-example\src\views\Home.vue ======================
## vue-router-example\src\views\Home.vue
```vue
<template>
<div>
<h1>首页</h1>
<p>欢迎来到首页!</p>
</div>
</template>
```