<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                --- title: 起步 type: guide order: 1 --- 我們以 Vue 數據綁定的快速導覽開始。如果你對高級概述更感興趣,可查看這篇[博文](http://blog.evanyou.me/2015/10/25/vuejs-re-introduction/)。 嘗試 Vue.js 最簡單的方法是使用 [JSFiddle Hello World 例子](https://jsfiddle.net/yyx990803/okv0rgrk/)。在瀏覽器新標簽頁中打開它,跟著我們查看一些基礎示例。如果你喜歡用包管理器下載/安裝,查看[安裝](/guide/installation.html)教程。 ### Hello World ``` html <div id="app"> {{ message }} </div> ``` ``` js new Vue({ el: '#app', data: { message: 'Hello Vue.js!' } }) ``` {% raw %} <div id="app" class="demo"> {{ message }} </div> <script> new Vue({ el: '#app', data: { message: 'Hello Vue.js!' } }) </script> {% endraw %} ### 雙向綁定 ``` html <div id="app"> <p>{{ message }}</p> <input v-model="message"> </div> ``` ``` js new Vue({ el: '#app', data: { message: 'Hello Vue.js!' } }) ``` {% raw %} <div id="app2" class="demo"> <p>{{ message }}</p> <input v-model="message"> </div> <script> new Vue({ el: '#app2', data: { message: 'Hello Vue.js!' } }) </script> {% endraw %} ### 渲染列表 ``` html <div id="app"> <ul> <li v-for="todo in todos"> {{ todo.text }} </li> </ul> </div> ``` ``` js new Vue({ el: '#app', data: { todos: [ { text: 'Learn JavaScript' }, { text: 'Learn Vue.js' }, { text: 'Build Something Awesome' } ] } }) ``` {% raw %} <div id="app3" class="demo"> <ul> <li v-for="todo in todos"> {{ todo.text }} </li> </ul> </div> <script> new Vue({ el: '#app3', data: { todos: [ { text: 'Learn JavaScript' }, { text: 'Learn Vue.js' }, { text: 'Build Something Awesome' } ] } }) </script> {% endraw %} ### 處理用戶輸入 ``` html <div id="app"> <p>{{ message }}</p> <button v-on:click="reverseMessage">Reverse Message</button> </div> ``` ``` js new Vue({ el: '#app', data: { message: 'Hello Vue.js!' }, methods: { reverseMessage: function () { this.message = this.message.split('').reverse().join('') } } }) ``` {% raw %} <div id="app4" class="demo"> <p>{{ message }}</p> <button v-on:click="reverseMessage">Reverse Message</button> </div> <script> new Vue({ el: '#app4', data: { message: 'Hello Vue.js!' }, methods: { reverseMessage: function () { this.message = this.message.split('').reverse().join('') } } }) </script> {% endraw %} ### 綜合 ``` html <div id="app"> <input v-model="newTodo" v-on:keyup.enter="addTodo"> <ul> <li v-for="todo in todos"> <span>{{ todo.text }}</span> <button v-on:click="removeTodo($index)">X</button> </li> </ul> </div> ``` ``` js new Vue({ el: '#app', data: { newTodo: '', todos: [ { text: 'Add some todos' } ] }, methods: { addTodo: function () { var text = this.newTodo.trim() if (text) { this.todos.push({ text: text }) this.newTodo = '' } }, removeTodo: function (index) { this.todos.splice(index, 1) } } }) ``` {% raw %} <div id="app5" class="demo"> <input v-model="newTodo" v-on:keyup.enter="addTodo"> <ul> <li v-for="todo in todos"> <span>{{ todo.text }}</span> <button v-on:click="removeTodo($index)">X</button> </li> </ul> </div> <script> new Vue({ el: '#app5', data: { newTodo: '', todos: [ { text: 'Add some todos' } ] }, methods: { addTodo: function () { var text = this.newTodo.trim() if (text) { this.todos.push({ text: text }) this.newTodo = '' } }, removeTodo: function (index) { this.todos.splice(index, 1) } } }) </script> {% endraw %} 希望上例能讓你對 Vue.js 的工作原理有一個基礎概念。我知道你現在有許多疑問——繼續閱讀,在后面的教程將一一解答。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看