摘要: 1,安装 cors 模块 : npm install cors 2,代码 : var express = require('express') var app = express() var cors = require('cors') app.use(cors()) 即可解决跨域问题 。(http 阅读全文
posted @ 2019-11-02 15:47 武卡卡 阅读(1482) 评论(0) 推荐(1) 编辑
摘要: 阅读全文
posted @ 2019-11-02 14:23 武卡卡 阅读(4735) 评论(0) 推荐(0) 编辑
摘要: created() { var that=this axios.get('http://jsonplaceholder.typicode.com/todos') .then(function (res) { // handle success // console.log(res); that.to 阅读全文
posted @ 2019-11-02 13:09 武卡卡 阅读(620) 评论(0) 推荐(0) 编辑
摘要: <template> <div> <form @submit.prevent="addTodo"> <input v-model="title" type="text" name="title" placeholder="请添加代办事项..."> <input type="submit" value 阅读全文
posted @ 2019-11-02 08:10 武卡卡 阅读(3305) 评论(0) 推荐(1) 编辑
摘要: 1,在 methods 中 <template> <div> <form @submit="addTodo"> <input v-model="title" type="text" name="title"> <input type="submit" value="添加" class="btn"> 阅读全文
posted @ 2019-11-02 07:49 武卡卡 阅读(2223) 评论(0) 推荐(0) 编辑
摘要: <script> export default { name:'header' // 不要使用内置或保留的HTML元素 , 改为Header或者置或保留的HTML元素之外的名称就好了 } </script> <script> export default { name:'header' // 不要使 阅读全文
posted @ 2019-11-02 07:06 武卡卡 阅读(4370) 评论(0) 推荐(2) 编辑