日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 前端技术 > vue >内容正文

vue

vue在微信里面的兼容问题_vuejs在安卓系统下微信X5内核这个兼容性问题如何破?...

發布時間:2025/3/15 vue 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 vue在微信里面的兼容问题_vuejs在安卓系统下微信X5内核这个兼容性问题如何破?... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

小弟第一次使用vue.js做項目開發就遇到了一個坑,本想把區域選擇獨立為一個子組件來使用,但是組件模式開發的select區域下拉列表在安卓系統的騰訊系的X5內核竟然報錯了,導致彈出的select選擇框無法選擇。

目前測試此問題存在于安卓系統下的騰訊系瀏覽器,UC系瀏覽器或webview,安卓下其他瀏覽器無問題。

有問題

無問題

主要代碼:

{{ currSheng }}

{{ sheng }}

{{ currShi }}

{{ shi }}

{{ currQu }}

{{ qu }}

import RegionData from './js/region-data.js'

export default{

name: 'region-picker',

data () {

return {

regionType: 1,

isQU: true,

shengObj: {},

shiObj: {},

quObj: {},

selectArray: {

sheng: [],

shi: [],

qu: []

},

currSheng: undefined,

currShi: undefined,

currQu: undefined

}

},

created: function () {

this.getSelectArray(0)

},

watch: {

currSheng: function (val, oldVal) {

this.selectArray.shi = []

this.selectArray.qu = []

let level = 1

this.shengObj = RegionData.find(

function (x) {

return x.name === val

}

)

this.regionType = this.shengObj.type

this.getSelectArray(level) // 渲染城市列表

this.currShi = undefined

},

currShi: function (val, oldVal) {

if (this.currShi !== undefined) {

this.shiObj = undefined

let level = 2

if (this.regionType === 0) { // 如果城市只有兩級,停止渲染區列表,返回數據

this.isQU = false

this.currQu = undefined

this.returnRegion(level)

} else {

this.isQU = true

this.shiObj = this.shengObj.sub.find(

function (x) {

return x.name === val

}

)

this.selectArray.qu = []

this.getSelectArray(level) // 渲染區域列表

this.currQu = undefined

}

}

},

currQu: function (val, oldVal) {

if (this.currQu !== undefined) {

this.returnRegion()

}

}

},

methods: {

getSelectArray: function (level) {

if (level === 0) { // 渲染省份列表

for (var i = 0; i < RegionData.length; i++) {

this.selectArray.sheng.push(RegionData[i].name)

}

} else if (level === 1) { // 渲染城市列表

for (i = 0; i < this.shengObj.sub.length; i++) {

this.selectArray.shi.push(this.shengObj.sub[i].name)

}

} else if (level === 2 && this.regionType === 1) {

for (i = 0; i < this.shiObj.sub.length; i++) {

this.selectArray.qu.push(this.shiObj.sub[i].name)

}

}

},

returnRegion (level) {

let regionData

if (level === 2) {

regionData = this.currSheng + this.currShi

} else {

regionData = this.currSheng + this.currShi + this.currQu

}

this.$emit('getRegion', regionData)

}

}

}

總結

以上是生活随笔為你收集整理的vue在微信里面的兼容问题_vuejs在安卓系统下微信X5内核这个兼容性问题如何破?...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。