> For the complete documentation index, see [llms.txt](https://vuido.mimec.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vuido.mimec.org/usage/script-section.md).

# Script Section

The script section of the window component describes the behavior of the window. The object exported by the script contains options which are passed to the Vue instance when the window is created. For example:

{% code title="" %}

```markup
<script>
export default {
  data() {
    return {
      counter: 0
    };
  },
  methods: {
    increment() {
      this.counter++;
    },
    decrement() {
      this.counter--;
    }
  }
}
</script>
```

{% endcode %}

The `data()` function returns an object which describes the initial state of the window. Its properties become the properties of the Vue instance. All data properties are reactive, which means that the user interface is automatically updated when the values of these properties are changed.

The `methods` option defines functions which become the methods of the Vue instance. These methods can access and change data properties and call other methods of that instance using the `this` keyword. You can use methods to react to user input and implement the logic of the application.

You can also create special functions, called the lifecycle hooks, which are called when the instance is created, destroyed and updated. For example, you can run some code after an instance is created:

```markup
<script>
export default {
  data() {
    return {
      text: ''
    }
  },
  created() {
    this.text = 'Hello';
  }
}
</script>
```

See also [Instance Lifecycle Hooks](https://vuejs.org/v2/guide/instance.html#Instance-Lifecycle-Hooks) in the Vue.js documentation for more details.

Other options which can be used in the script section are described in the following chapters of this documentation.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://vuido.mimec.org/usage/script-section.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
