@@ -86,9 +86,11 @@ export default {
8686</script>
8787
8888<style>
89- body, html {
89+ body, html, #app {
9090 margin: 0;
9191 padding: 0;
92+ width: 100%;
93+ height: 100%;
9294}
9395</style>
9496```
@@ -99,32 +101,34 @@ body, html {
99101
100102terminal标签支持属性参数表
101103
102- | 参数 | 说明 | 类型 | 默认值 |
103- | --------------------| -----------------------------------------| ---------| --------------------|
104- | name | Terminal实例名称,同一页面的name必须唯一,Api中使用也需用到此值 | string | terminal |
105- | context | 初始化上下文文本 | string | /vue-web-terminal |
106- | title | header中显示的标题 | string | vue-web-terminal |
107- | show-header | 是否显示header | boolean | true |
108- | init-log | Terminal初始化时显示的日志,是由[ 消息对象] ( #消息对象 ) 组成的数组 | array | 略 |
109- | init-log-delay | 初始化显示日志时每条日志之间的间隔时间,单位毫秒 ms | number | 150 |
110- | show-log-time | 当消息** type** 为` normal ` 时是否显示时间 | boolean | true |
111- | warnLogByteLimit | 当前Terminal日志占用内存大小超出此限制会发出警告,单位` byte ` | number | 1024 * 1024 * 10 |
112- | warnLogCountLimit | 当前Terminal日志条数超出此限制会发出警告 | number | 200 |
113- | warnLogLimitEnable | 是否开启日志限制警告 | boolean | true |
114- | auto-help | 是否打开命令行自动搜索提示功能 | boolean | true |
115- | command-store | 自定义的命令行库,见[ 命令行定义格式] ( #命令行定义 ) | array | [ 内置命令行] ( #内置命令行 ) |
104+ | 参数 | 说明 | 类型 | 默认值 |
105+ | ---------------------| -----------------------------------------| ----------| -------------------|
106+ | name | Terminal实例名称,同一页面的name必须唯一,Api中使用也需用到此值 | string | terminal |
107+ | context | 初始化上下文文本 | string | /vue-web-terminal |
108+ | title | header中显示的标题 | string | vue-web-terminal |
109+ | show-header | 是否显示header | boolean | true |
110+ | init-log | Terminal初始化时显示的日志,是由[ 消息对象] ( #消息对象 ) 组成的数组 | array | 略 |
111+ | init-log-delay | 初始化显示日志时每条日志之间的间隔时间,单位毫秒 ms | number | 150 |
112+ | show-log-time | 当消息** type** 为` normal ` 时是否显示时间 | boolean | true |
113+ | warnLogByteLimit | 当前Terminal日志占用内存大小超出此限制会发出警告,单位` byte ` | number | 1024 * 1024 * 10 |
114+ | warnLogCountLimit | 当前Terminal日志条数超出此限制会发出警告 | number | 200 |
115+ | warnLogLimitEnable | 是否开启日志限制警告 | boolean | true |
116+ | auto-help | 是否打开命令行自动搜索提示功能 | boolean | true |
117+ | help-style | help自定义样式 | string | |
118+ | command-store | 自定义的命令行库,见[ 命令行定义格式] ( #命令行定义 ) | array | [ 内置命令行] ( #内置命令行 ) |
119+ | command-store-sort | 命令行库排序 | function | function(a,b) {} |
116120
117121## Select Events
118122
119123terminal标签支持事件表
120124
121- | 事件名称 | 说明 | 回调参数 |
122- | ---------------| ----------------------------------------------------------------------------------------------------------------| ----------------- ---------------------|
123- | execCmd | 执行自定义命令时触发。` success ` 和` failed ` 为回调函数,**
124- 必须调用两个回调其中之一才会回显!** ,其中` success ` 回调参数为一个[ 消息对象] ( #消息对象 ) ,` failed ` 回调参数为一个string | ` (cmdKey, command, success, failed) ` |
125- | beforeExecCmd | 执行任意命令之前触发 | ` (cmdKey, command) ` |
126- | onKeydown | 当获取光标焦点时,按下任意键盘触发 | ` (event) ` |
127- | onClick | 用户点击按钮时触发,参数 ` key ` 为按钮唯一识别,已有按钮:close、minScreen、fullScreen、title | ` (key) ` |
125+ | 事件名称 | 说明 | 回调参数 |
126+ | ---------------------------------------------------------------------------| ----------------------------------------------------------------| ---------------------|
127+ | execCmd | 执行自定义命令时触发。` success ` 和` failed ` 为回调函数,** | |
128+ | 必须调用两个回调其中之一才会回显!** ,其中` success ` 回调参数为一个[ 消息对象] ( #消息对象 ) ,` failed ` 回调参数为一个string | ` (cmdKey, command, success, failed) ` | |
129+ | beforeExecCmd | 执行任意命令之前触发 | ` (cmdKey, command) ` |
130+ | onKeydown | 当获取光标焦点时,按下任意键盘触发 | ` (event) ` |
131+ | onClick | 用户点击按钮时触发,参数 ` key ` 为按钮唯一识别,已有按钮:close、minScreen、fullScreen、title | ` (key) ` |
128132
129133## Api
130134
@@ -196,7 +200,7 @@ export default {
196200
197201### normal 普通文本
198202
199- content为字符串格式,支持html标签,time字段会在push时自动填充,class、 content、type必填,其他选填
203+ content为字符串格式,支持html标签,time字段会在push时自动填充,content、type必填,其他选填
200204
201205``` json
202206{
@@ -321,7 +325,7 @@ type为`table`时content为表格配置,`head`为表头,`rows`为每行的
321325type为` html ` 时可自定义内容格式,content为html标签构成
322326
323327``` js
324- execCmd (key, command, success)
328+ execCmd (key, command, success)
325329{
326330 // ...
327331 success ({
0 commit comments