Your search did not match any results.
Text Area

Text Area


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

Copy to CodeSandBox
<template> <div> <div class="dx-fieldset"> <div class="dx-fieldset-header">Default Mode</div> <div class="dx-field"> <DxCheckBox :value="false" text="Limit text length" @value-changed="onCheckboxValueChanged" /> </div> </div> <div class="left-content"> <DxTextArea :height="90" :max-length="maxLength" :value.sync="value" /> </div> <div class="full-width-content"> <div class="dx-fieldset"> <div class="dx-fieldset-header">Event Handling and API</div> <div class="dx-field"> <div class="dx-field-label">Synchronize text areas </div> <div class="dx-field-value"> <DxSelectBox :items="valueChangeEvents" :value.sync="eventValue" value-expr="name" display-expr="title" /> </div> </div> </div> <DxTextArea :height="90" :value.sync="valueForEditableTextArea" :value-change-event="eventValue" /> <DxTextArea :height="90" :read-only="true" :value="valueForEditableTextArea" /> </div> </div> </template> <script> import DxTextArea from 'devextreme-vue/text-area'; import DxCheckBox from 'devextreme-vue/check-box'; import DxSelectBox from 'devextreme-vue/select-box'; import service from './data.js'; export default { components: { DxCheckBox, DxTextArea, DxSelectBox }, data() { return { eventValue: service.valueChangeEvents[0].name, maxLength: null, value: service.getContent(), valueForEditableTextArea: service.getContent(), valueChangeEvents: service.valueChangeEvents }; }, methods: { onCheckboxValueChanged(e) { if (e.value) { this.value = service.getContent().substring(0, 100); this.maxLength = 100; } else { this.value = service.getContent(); this.maxLength = null; } } } }; </script> <style> .full-width-content { width: 100%; margin-top: 30px; } .full-width-content > .dx-widget { margin-bottom: 20px; } .full-width-content .dx-field { max-width: 385px; } </style>
import Vue from 'vue'; import App from './App.vue'; new Vue({ el: '#app', components: { App }, template: '<App/>' });
<!DOCTYPE html> <html> <head> <title>DevExtreme Demo</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> <link rel="stylesheet" type="text/css" href="" /> <link rel="stylesheet" type="text/css" href="" /> <script src=""></script> <script src=""></script> <script type="text/javascript" src="config.js"></script> <script type="text/javascript"> System.import('./index.js'); </script> </head> <body class="dx-viewport"> <div class="demo-container"> <div id="app"> </div> </div> </body> </html>
const valueChangeEvents = [{ title: 'On Blur', name: 'change' }, { title: 'On Key Up', name: 'keyup' }]; let content = 'Prepare 2013 Marketing Plan: We need to double revenues in 2013 and our marketing strategy is going to be key here. R&D is improving existing products and creating new products so we can deliver great AV equipment to our customers.Robert, please make certain to create a PowerPoint presentation for the members of the executive team.'; export default { valueChangeEvents: valueChangeEvents, getContent() { return content; } };
System.config({ transpiler: 'plugin-babel', meta: { '*.vue': { loader: 'vue-loader' }, }, paths: { 'npm:': '' }, map: { 'vue': 'npm:vue@2.6.3/dist/vue.esm.browser.js', 'vue-loader': 'npm:dx-systemjs-vue-browser@latest/index.js', 'devextreme': 'npm:devextreme@20.1', 'devextreme-vue': 'npm:devextreme-vue@20.1', 'jszip': 'npm:jszip@3.1.3/dist/jszip.min.js', 'quill': 'npm:quill@1.3.7/dist/quill.js', 'devexpress-diagram': 'npm:devexpress-diagram@1.0.17', 'devexpress-gantt': 'npm:devexpress-gantt@1.0.10', 'plugin-babel': 'npm:systemjs-plugin-babel@0/plugin-babel.js', 'systemjs-babel-build': 'npm:systemjs-plugin-babel@0/systemjs-babel-browser.js' }, packages: { 'devextreme-vue': { main: 'index.js' }, 'devextreme': { defaultExtension: 'js' }, 'devextreme/events/utils': { main: 'index' }, 'devextreme/events': { main: 'index' }, }, babelOptions: { sourceMaps: false, stage0: true } });