<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>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                #Vuejs 2.0 教程:與后端 API 進行交互 api.php ``` Route::post('/todo/create', function (Request $request) { $data = ['title' => $request->get('title')]; $todo = App\Todo::create($data); return $todo; })->middleware('api', 'cors'); Route::patch('/todo/{id}/completed', function ($id) { $todo = App\Todo::find($id); $todo->completed = !$todo->completed; $todo->save(); return $todo; })->middleware('api', 'cors'); Route::patch('/todo/{id}/delete', function ($id) { $todo = App\Todo::find($id); $todo->delete(); return response()->json(['deleted']); })->middleware('api', 'cors'); ``` TodoForm.vue ``` addTodo(newTodo){ this.axios.post('http://laravel-package.dev/api/todo/create', {title: this.newTodo.title}).then(response => { console.log(response.data); this.todos.push(response.data); this.newTodo = {id: null, title: '', completed: false}; }); } ``` Todos.vue ``` deleteTodo(index){ this.axios.patch('http://laravel-package.dev/api/todo/' + this.todos[index].id + '/delete').then(response => { console.log(response.data); this.todos.splice(index, 1); }); }, toggleCompletion(todo){ this.axios.patch('http://laravel-package.dev/api/todo/' + todo.id + '/completed').then(response => { console.log(response.data); todo.completed = !todo.completed; }); } ```
                  <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>

                              哎呀哎呀视频在线观看