Vue TextArea - Overview

The TextArea is a UI component that enables a user to enter and edit a multi-line text.

View Demo

The following code adds a simple TextArea with a placeholder to your page.

Code
  • <template>
  • <DxTextArea placeholder="Type a text here..."/>
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import { DxTextArea } from 'devextreme-vue/text-area';
  •  
  • export default {
  • components: {
  • DxTextArea
  • }
  • }
  • </script>

By default, the TextArea checks the entered text for spelling errors. To disable this feature, assign false to the spellcheck property.

Code
  • <template>
  • <DxTextArea :spellcheck="false"/>
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import { DxTextArea } from 'devextreme-vue/text-area';
  •  
  • export default {
  • components: {
  • DxTextArea
  • }
  • }
  • </script>

If an end user should not be able to edit the text in the TextArea, assign true to the readOnly property. In this case, make sure to set the value property too.

Code
  • <template>
  • <DxTextArea
  • :read-only="true"
  • value="The text that should not be edited"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import { DxTextArea } from 'devextreme-vue/text-area';
  •  
  • export default {
  • components: {
  • DxTextArea
  • }
  • }
  • </script>
See Also