Skip to content

Commit 0e1b078

Browse files
committed
update README
1 parent 932aea8 commit 0e1b078

File tree

2 files changed

+44
-54
lines changed

2 files changed

+44
-54
lines changed

README.md

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ Please go to [Document](https://tzfun.github.io/vue-web-terminal/)
5151

5252
# Quick Start
5353

54+
> The **Vue2** version will be officially archived from **December 24, 2024** and will no longer provide maintenance updates.
55+
> For the source code, see [vue2 branch](https://github.com/tzfun/vue-web-terminal/tree/vue2).
56+
5457
Install vue-web-terminal by npm. The `2.x.x` version corresponds to vue2, and the `3.x.x` version corresponds to vue3.
5558
It is recommended to download the latest version corresponding to the main version.
5659

@@ -77,38 +80,30 @@ const app = createApp(App).use(Terminal)
7780
Example:
7881

7982
```vue
83+
<script setup>
84+
import Terminal from "vue-web-terminal"
85+
const onExecCmd = (key, command, success, failed) => {
86+
if (key === 'fail') {
87+
failed('Something wrong!!!')
88+
} else {
89+
let allClass = ['success', 'error', 'system', 'info', 'warning'];
90+
91+
let clazz = allClass[Math.floor(Math.random() * allClass.length)];
92+
success({
93+
type: 'normal',
94+
class: clazz,
95+
tag: 'success',
96+
content: command
97+
})
98+
}
99+
}
100+
</script>
80101
<template>
81102
<div id="app">
82103
<terminal name="my-terminal" @exec-cmd="onExecCmd"></terminal>
83104
</div>
84105
</template>
85106
86-
<script>
87-
import Terminal from "vue-web-terminal"
88-
89-
export default {
90-
name: 'App',
91-
components: {Terminal},
92-
methods: {
93-
onExecCmd(key, command, success, failed) {
94-
if (key === 'fail') {
95-
failed('Something wrong!!!')
96-
} else {
97-
let allClass = ['success', 'error', 'system', 'info', 'warning'];
98-
99-
let clazz = allClass[Math.floor(Math.random() * allClass.length)];
100-
success({
101-
type: 'normal',
102-
class: clazz,
103-
tag: 'success',
104-
content: command
105-
})
106-
}
107-
}
108-
}
109-
}
110-
</script>
111-
112107
<style>
113108
body, html, #app {
114109
margin: 0;
@@ -121,7 +116,7 @@ Example:
121116

122117
# Contact Author
123118

124-
I am a backend coder who happens to have some knowledge of frontend. I developed this plugin out of personal interest.
119+
I am a backend coder, and I know a little bit about frontend. This plugin was created out of my interest.
125120

126121
If you have good ideas for code optimization or functions and are willing to contribute code, please submit [PR](https://github.com/tzfun/vue-web-terminal/pulls),
127122
If you have any questions about the use of the plugin or find bugs, please submit[issue](https://github.com/tzfun/vue-web-terminal/issues).

README_ZH.md

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@
5050

5151
# 快速上手
5252

53+
> **Vue2**版本从 **2024年12月24日** 开始正式归档,不再提供维护更新,
54+
> 源码见 [vue2分支](https://github.com/tzfun/vue-web-terminal/tree/vue2)
55+
5356
npm安装vue-web-terminal,`2.x.x`版本对应vue2,`3.x.x`版本对应vue3,建议下载对应大版本的最新版。
5457

5558
```shell
@@ -75,38 +78,30 @@ const app = createApp(App).use(Terminal)
7578
使用示例
7679

7780
```vue
81+
<script setup>
82+
import Terminal from "vue-web-terminal"
83+
const onExecCmd = (key, command, success, failed) => {
84+
if (key === 'fail') {
85+
failed('Something wrong!!!')
86+
} else {
87+
let allClass = ['success', 'error', 'system', 'info', 'warning'];
88+
89+
let clazz = allClass[Math.floor(Math.random() * allClass.length)];
90+
success({
91+
type: 'normal',
92+
class: clazz,
93+
tag: 'success',
94+
content: command
95+
})
96+
}
97+
}
98+
</script>
7899
<template>
79100
<div id="app">
80101
<terminal name="my-terminal" @exec-cmd="onExecCmd"></terminal>
81102
</div>
82103
</template>
83104
84-
<script>
85-
import Terminal from "vue-web-terminal"
86-
87-
export default {
88-
name: 'App',
89-
components: {Terminal},
90-
methods: {
91-
onExecCmd(key, command, success, failed) {
92-
if (key === 'fail') {
93-
failed('Something wrong!!!')
94-
} else {
95-
let allClass = ['success', 'error', 'system', 'info', 'warning'];
96-
97-
let clazz = allClass[Math.floor(Math.random() * allClass.length)];
98-
success({
99-
type: 'normal',
100-
class: clazz,
101-
tag: '成功',
102-
content: command
103-
})
104-
}
105-
}
106-
}
107-
}
108-
</script>
109-
110105
<style>
111106
body, html, #app {
112107
margin: 0;
@@ -119,7 +114,7 @@ const app = createApp(App).use(Terminal)
119114

120115
# 联系作者
121116

122-
我是一名后端Coder,恰巧对前端也会一点皮毛,个人兴趣开发了此插件,业余玩家请多指教
117+
我是一名后端Coder,恰巧对前端也会一点,个人兴趣开发了此插件。
123118

124119
如果对代码优化或功能有好的想法并乐意贡献代码欢迎提交[PR](https://github.com/tzfun/vue-web-terminal/pulls)
125120
,对插件使用存在疑问或发现bug请提交[issue](https://github.com/tzfun/vue-web-terminal/issues)

0 commit comments

Comments
 (0)