用什么軟件做網(wǎng)站最快搜索量排行
360企業(yè)安全瀏覽器兼容模式顯示異常 ,現(xiàn)象測(cè)試環(huán)境頻發(fā) ,本地連測(cè)試無(wú)法復(fù)現(xiàn),線上反饋問(wèn)題。
出現(xiàn)問(wèn)題的電腦為windows且使用360企業(yè)安全瀏覽器打開(kāi)兼容模式可復(fù)現(xiàn)
復(fù)現(xiàn)過(guò)程:
不直接點(diǎn)擊超鏈接跳轉(zhuǎn)頁(yè)面 ,登錄后直接通過(guò)出問(wèn)題的頁(yè)面的全鏈接訪問(wèn)成功復(fù)現(xiàn)問(wèn)題。
解決方案和過(guò)程
通過(guò)控制臺(tái)打印出localStorage里的內(nèi)容看所取得數(shù)據(jù)是否存在 ,在看使用的方法是否兼容不同瀏覽器 ,可能部分?jǐn)?shù)組的方法不兼容導(dǎo)致, 因?yàn)槲疫@個(gè)是取的vueX里的內(nèi)容 要先看能否打印出來(lái),多次嘗試后發(fā)現(xiàn)稅率列表沒(méi)有取到。所以要在頁(yè)面加載前保證稅率列表存在。
<el-table-columnprop="taxRate"label="稅率"width="60"align="right"><template slot-scope="scope">//vue的mixins混入功能<span> {{ getTaxRateName(scope.row.taxRate) }} </span></template></el-table-column>
相關(guān)知識(shí)點(diǎn)
mixins使用一、局部混入:
1)、混入 (mixin) 提供了一種非常靈活的方式,來(lái)分發(fā) Vue 組件中的可復(fù)用功能。一個(gè)混入對(duì)象可以包含任意組件選項(xiàng)。當(dāng)組件使用混入對(duì)象時(shí),所有混入對(duì)象的選項(xiàng)將被“混合”進(jìn)入該組件本身的選項(xiàng)。
2)、選項(xiàng)合并
當(dāng)組件和混入對(duì)象含有同名選項(xiàng)時(shí),這些選項(xiàng)將以恰當(dāng)?shù)姆绞竭M(jìn)行“合并”。
比如,數(shù)據(jù)對(duì)象在內(nèi)部會(huì)進(jìn)行遞歸合并,并在發(fā)生沖突時(shí)以組件數(shù)據(jù)優(yōu)先。
①:新建minxins.js文件
import { mapState } from 'vuex'
export default {data() {return {// taxRateList: []}},computed: {...mapState(['taxRateList'])},mounted() {},methods: {/*** 獲取 稅率字典list* @returns {Promise<void>}*/// async getTaxrateList() {// let list = await this.$api.common.***({// classCode: 'taxRate'// })// this.$set(this, 'taxRateList', list)// },/*** 通過(guò)稅率code 返回相應(yīng)名稱* @param code* @returns {*}*/getTaxRateName(code) {if (this.taxRateList.length) {let rate = this.taxRateList.find(t => t.codeCode == code)if (rate) {return rate.codeName}return ''}},/*** 返回稅率名稱,過(guò)濾掉百分號(hào)* @param code* @returns {*}*/getTaxRate(code) {let name = this.getTaxRateName(code)if (name && name.endsWith('%')) {return name.slice(0, -1)}return ''}}
}
import mixins from '@/mixins'Vue.mixin(mixins)
Vue.use(VueCookies)
new Vue({router,store,render: h => h(App)
}).$mount('#app')
這么貼心不給個(gè)關(guān)注嗎~~