获取您自己的 Vue 服务器
App.vue
main.js
 
<template>
  <h1>Textarea</h1>
  <form @submit.prevent="registerAnswer">
    <label>
      <p>What do you think about our product?</p> 
      <textarea v-model="txtInp" placeholder="Write something.." rows="4" cols="35"></textarea>
    </label>
    <button type="submit">Submit</button>
  </form>
  <div>
    <h3>Submitted answer:</h3>
    <p id="pAnswer">{{ inpValSubmitted }}</p>
  </div>
</template>

<script>
export default {
  data() {
    return {
      txtInp: null,
      inpValSubmitted: 'Not submitted yet'
    }
  },
  methods: {
    registerAnswer() {
      if(this.txtInp) {
        this.inpValSubmitted = this.txtInp;
      }
    }
  }
}
</script>

<style scoped>
  div {
    border: dashed black 1px;
    border-radius: 10px;
    padding: 0 20px 20px 20px;
    margin-top: 20px;
    display: inline-block;
    max-width: 250px;
  }
  button {
    margin: 10px 0;
    display: block;
  }
  #pAnswer {
    background-color: lightgreen;
    padding: 5px;
  }
</style>                  
import { createApp } from 'vue'

import App from './App.vue'

const app = createApp(App)
app.mount('#app')
                  
https://127.0.0.1:5173/