<div id="app">
  <input v-model="text"></input>
  <div>文字数:{{text.length}} (text.length)</div>
  <div>文字数:{{Array.from(text).length}} (Array.from(text).length)</div>
  <div>文字数:{{[...text].length}} ([...text].length)</>
</div>
#app {
  width: 300px;
  margin: 0 auto;
}
const App = {
  data() {
    return {
      text: ""
    };
  }
};

Vue.createApp(App).mount("#app");
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://unpkg.com/vue@next