獲取this.$route.query傳遞的參數,通常為number,但是在頁面刷新后會轉變為string,
這樣基於此的判斷條件就不生效了。
解決方法:
通過parseInt
手動轉變數據類型。
例:
this.intotype = parseInt(this.$route.query.type)
if (this.intotype === 2) {
this.dialogTitle = '上傳短視頻'
this.labelName = '短視頻'
}