DevExtreme Vue - Overview

The TextBox is a widget that enables a user to enter and edit a single line of text.

View Demo

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

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

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

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