You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -192,20 +192,22 @@ The dragConf structure is as follows:
192
192
193
193

194
194
195
-
In addition to mouse control, you can also [call API to simulate dragging](#dragging)
195
+
In addition to mouse control, you can also [call API to simulate dragging](#dragging())
196
196
197
197
## Api
198
198
199
199
This plugin provides some APIs that can use Vue to actively initiate event requests to the plugin.
200
200
201
+
PS:**All api calls require the name of the terminal.**
202
+
201
203
```js
202
204
importTerminalfrom"vue-web-terminal"
203
205
204
206
// det api
205
207
Terminal.$api
206
208
```
207
209
208
-
### pushMessage
210
+
### pushMessage()
209
211
210
212
```js
211
213
// Each terminal will define a name, see the previous document for details
@@ -219,7 +221,7 @@ let message = {
219
221
Terminal.$api.pushMessage(name, message)
220
222
```
221
223
222
-
### updateContext
224
+
### updateContext()
223
225
224
226
For example, */vue-web-terminal/tzfun* in the current input line `$ /vue-web-terminal/tzfun > ` is the context, and the context text can be freely set by the developer, but you need to use `.sync` to bind a variable.
225
227
@@ -249,22 +251,24 @@ export default {
249
251
</script>
250
252
```
251
253
252
-
### fullscreen
254
+
### fullscreen()
253
255
254
256
Make the current terminal enter or exit full screen.
255
257
256
258
```js
257
259
Terminal.$api.fullscreen('my-terminal')
258
260
```
259
261
262
+
### isFullscreen()
263
+
260
264
Determine if the current state is full screen.
261
265
262
266
```js
263
267
// true or false
264
268
let fullscreen =Terminal.$api.isFullscreen('my-terminal')
265
269
```
266
270
267
-
### dragging
271
+
### dragging()
268
272
269
273
When [Feature Drag](#Drag) is enabled, you can use the following method to simulate drag to change the window position, where the parameter `x` is the distance from the left border of the terminal to the left border of the browser's visible range, in px, `y ` is the distance from the upper border of the terminal to the upper border of the browser's visible range.
You can use the api to execute a command to the Terminal, and the execution process will be echoed in the Terminal window. This is a way to use a script to simulate the user executing the command.
0 commit comments