mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-03-20 18:11:07 -05:00
feat: prompt editor (#3929)
* feat(Prompt): editor
* docs(ui dev): update supported inquirer types
(cherry picked from commit 3f9838b649)
This commit is contained in:
committed by
Haoqun Jiang
parent
204e1fcf6b
commit
dbac8171b9
@@ -526,7 +526,7 @@ However, you can add the following additional fields (which are optional and onl
|
||||
}
|
||||
```
|
||||
|
||||
Supported inquirer types: `checkbox`, `confirm`, `input`, `password`, `list`, `rawlist`.
|
||||
Supported inquirer types: `checkbox`, `confirm`, `input`, `password`, `list`, `rawlist`, `editor`.
|
||||
|
||||
In addition to those, the UI supports special types that only works with it:
|
||||
|
||||
|
||||
@@ -52,6 +52,11 @@ export default {
|
||||
align-items stretch
|
||||
justify-content center
|
||||
|
||||
&.vertical
|
||||
grid-template-columns auto
|
||||
grid-template-areas "info" "input"
|
||||
grid-gap $padding-item
|
||||
|
||||
.list-item-info
|
||||
margin-right ($padding-item * 2)
|
||||
</style>
|
||||
|
||||
39
packages/@vue/cli-ui/src/components/prompt/PromptEditor.vue
Normal file
39
packages/@vue/cli-ui/src/components/prompt/PromptEditor.vue
Normal file
@@ -0,0 +1,39 @@
|
||||
<template>
|
||||
<VueDisable
|
||||
:disabled="!prompt.enabled"
|
||||
class="prompt prompt-editor"
|
||||
>
|
||||
<div class="prompt-content vertical">
|
||||
<ListItemInfo
|
||||
:name="$t(prompt.message)"
|
||||
:description="$t(prompt.description)"
|
||||
:link="prompt.link"
|
||||
/>
|
||||
|
||||
<div class="prompt-input">
|
||||
<VueInput
|
||||
:value="value(prompt.value)"
|
||||
type="textarea"
|
||||
@update="value => answer(value)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<PromptError :error="prompt.error"/>
|
||||
</VueDisable>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Prompt from './Prompt'
|
||||
|
||||
export default {
|
||||
extends: Prompt,
|
||||
|
||||
buffer: true
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.vue-ui-input /deep/ > .content > .input-wrapper > textarea.input
|
||||
min-height 16em
|
||||
</style>
|
||||
Reference in New Issue
Block a user