Vue踩坑紀錄

2021-10-17 04:32:38 字數 1097 閱讀 1395

前端: vue, vuetify

後端: flask, flask-cors

資料庫: mongodb

前後通訊: axios

"/dashboard"

, methods=

['get'])

defkey_index()

: key_index = db.sns.find(,)

.sort([(

"datetime",-

1)])

return dumps(key_index)

except exception as e:

return dumps(

)-get methods 獲取資料庫的資料, 並以json格式回傳

},

在 /frontend/main.js中加入:

import axios from

'axios'

vue.prototype.$axios = axios

vue.config.productiontip =

false

;

export

default},

//create method

created()

, methods:).

catch

(err =>

)}

因資料庫訪問的資料單位不同,須另行計算再display

computed:

,

原先直接以 }呈現,雖然還是可以render 但會報錯!

報錯原因: 後端傳來的data還沒load成功,render為空

解決辦法: 以v-if 來判斷data是否load,load成功才呈現於頁面

//報錯

}<

/span>

//解決辦法

"indexes"

>

}<

/span>

YII踩坑紀錄

username trim username required message 使用者名稱不能為空 username unique targetclass common models user message 使用者名稱已存在 username string min 6,max 60,toolong...

thrift開發踩坑全紀錄

使用thrift搭建的系統已經穩定執行了一段時間了,該系統是公司的核心流式系統,高峰時qps在40萬。作為目前最流行的rpc框架,thrift不僅提供了通訊協議,同時提供了網路框架,解脫了程式設計師的生產力。thrift也是阿帕奇hadoop系列的rpc實現工具。本文主要聚焦在搭建c 實現的thri...

Vue踩坑記錄

解決方法如下 第一步 在靜態檔案下引入我們要更換的的 第二步 在index.html檔案中新增這樣一段 icon href static logo.png type image x icon shortcut icon href static logo.png type image x icon 展...