vue-web-terminalvue-web-terminal
Home
  • Get Started
  • Theme
  • Attribute
  • Event
  • Slot
  • API
  • Advanced Features
  • More
About
Q&A
  • GitHub
  • Gitee 码云
  • English
  • 中文简体
Home
  • Get Started
  • Theme
  • Attribute
  • Event
  • Slot
  • API
  • Advanced Features
  • More
About
Q&A
  • GitHub
  • Gitee 码云
  • English
  • 中文简体
  • About
  • Document

    • Get Started
    • Theme
    • Attribute
    • Event
    • Slot
      • Slots Details
      • Example
    • API
    • Advanced Features
    • More
  • Q&A

Slots

The plugin provides some slots. If you are not satisfied with the default style or the default implementation does not meet your needs, you can use these slots to customize this part of the display.

Slots Details

Slot nameArgumentsDescription
header/Customize the header style, still retain the drag area.
helpBox{ showHeader, item }Custom command search result prompt box, item is the search result.
normal{ message }Custom normal type message.
json{ message }Custom json type message.
table{ message }Custom table type message.
code{ message }Custom code type message.
html{ message }Custom html type message.
flash{ content }Custom flash style.
helpCmd{ item }Custom command search prompt style.
textEditor{ data }Custom text editor style.

Example

<terminal :name="name" @exec-cmd="onExecCmd">
    <!--  Custom header style  -->
    <template #header>
      This is my custom header
    </template>

    <!--  Customize JSON format message style  -->
    <template #json="data">
      {{ data.message }}
    </template>

    <!--  Customize the help prompt box style  -->
    <template #helpBox="{showHeader, item}">
      {{ item }}
    </template>

    <!--  Customize text editor style  -->
    <template #textEditor="{data}">
        <textarea name="editor" 
                  class="t-text-editor" 
                  v-model="data.value" 
                  @focus="data.onFocus" 
                  @blur="data.onBlur"></textarea>
        <div class="t-text-editor-floor" align="center">
            <button class="t-text-editor-floor-btn" @click="_textEditorClose(false)">Cancel</button>
            <button class="t-text-editor-floor-btn" @click="_textEditorClose(true)">Save & Close(Ctrl + S)</button>
        </div>
    </template>
</terminal>
Edit this page on GitHub
Last Updated:
Contributors: tzfun
Prev
Event
Next
API