Discuss / Python / vue里面的method触发不了

vue里面的method触发不了

Topic source

提交表单之后也没反应,可能是什么原因啊?

INFO:root:Request: GET /register
INFO:root:Response handler...
INFO:root:call with args: {}
INFO:root:Request: GET /static/css/awesome.css
INFO:root:Response handler...
INFO:root:Request: GET /static/js/jquery.min.js
INFO:root:Response handler...
INFO:root:Request: GET /static/js/sha1.min.js
INFO:root:Response handler...
INFO:root:Request: GET /static/js/sticky.min.js
INFO:root:Response handler...
INFO:root:Request: GET /static/js/vue.min.js
INFO:root:Response handler...
INFO:root:Request: GET /static/js/awesome.js
INFO:root:Response handler...
INFO:root:Request: GET /static/js/vue.js
INFO:root:Response handler...
INFO:root:Request: GET /register
INFO:root:Response handler...
INFO:root:call with args: {}

是我的js文件没有加载成功

笑然一生

#3 Created at ... [Delete] [Delete and Lock User]

同学,你好,我出现了和你类似的问题,请问你是怎么解决的? 谢谢

郭子淳gzc

#4 Created at ... [Delete] [Delete and Lock User]

如果html中加载了css、js,一定要在aiohttp中加入add_static来处理css、js请求;

因为client除了会向服务器发送对html url的请求(这个在add_router中处理了),也会向服务器发送对css/js url的请求,如:RequestURL:http://localhost:8000/static/js/awesome.js , 这就需要add_static来处理了。

colorsumer

#5 Created at ... [Delete] [Delete and Lock User]

应该是vue.js版本的问题。

把 v-on="submit: submit" 改成 v-on: submit.prevent ="submit" 就好了

乡村老羊

#6 Created at ... [Delete] [Delete and Lock User]

我已经下载了最新的版本 应该是vue.js版本的问题。

把 v-on="submit: submit" 改成 v-on: submit.prevent ="submit" 就好了

问题依旧


  • 1

Reply