- 博客(15)
- 收藏
- 关注
原创 在vue中将城市数据按列(每列最多12个)显示
1.在获取到城市列表(list)的组件中使用computedcomputed: { renderList: function () { //确定列数 let col = Math.ceil(this.list.length / 12) let result = [] //分三列数据 for ( var i = 0; i < col; i ++) { let data = this.list.slice(i * 12, i * 12 + 12) result.pus.
2020-12-27 01:00:53
335
原创 vue输入框过滤关键词
let val = this.searchWordapi.getSearchWord().then(res => { this.searchList = res.data.data.list.filter((item, index) => { return item.indexOf(val) > -1 })})
2020-12-26 21:51:04
337
原创 axios请求拦截器避免覆盖params
config.params = { appkey: '13safafsadf1的撒发生2912_15sasdafdfffds1122fsdfsad5039' }利用解构赋值避免被覆盖config.params = { ...config.params, appkey: '13681312912_1562064425039' }
2020-12-26 21:43:27
510
原创 vue动态在数据之间加“竖杠”
<span v-for="(v, i) in list.tab" :key="i">{{v + (i < list.tab.length - 1 ? '|' : '')}}</span>```
2020-12-20 19:35:41
4338
原创 vue在不同页面的不同组件(未有共同父级)利用vuex(状态管理模式)传递数据
1.下载npm install vuex -D,创建store.js文件import Vue from 'vue; import Vuex from 'vuex'; Vue.use(Vuex)2.const state = { position: '黑龙江'}const mutation = { setPosition (state, val) { state.position = val }}const actions = { setPosition ({ comm
2020-12-20 14:41:45
147
原创 按数据中首字母属性firstChar进行分类
var data = [{ 'id': 1, 'name': '北京', 'pinyin': 'beijing', 'acronym': 'bj', 'rank': 'S', 'firstChar': 'b' }, { 'id': 10, 'name': '上海', 'pinyin': 'shanghai', 'acronym': 'sh', 'rank': '
2020-12-18 16:41:16
418
1
原创 js将abcd...26字母全部显示
1.在vue data声明list: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('')2.利用v-for遍历<dd v-for="(item, index) in list" :key="index">{{item}}</dd>
2020-12-18 14:16:58
715
原创 elements-ui远程搜索组件在mt-app使用
1.引入组件<el-select v-model="value" multiple filterable remote reserve-keyword placeholder="请输入关键词" :remote-method="remoteMethod" :loading="loading"> <el-option v-for="item in options" :key="item.value
2020-12-18 13:23:05
117
原创 vue两个子组件互斥显示
1.在父组件分别数据声明provinceActive=false,cityActive=false,并将showWrapperActive传入到两子组件中 :showWrapperActive=“provinceActive”,:showWrapperActive=“cityActive”2.在子组件中利用props接收showWrapperActive,动态绑定类名class中‘active’=showWrapperActive3.在父组件中注册change_active方法 @change_acti
2020-12-18 01:21:05
978
原创 Module `scheduler/tracing` does not exist in the Haste module map
React Native (一)出现bundling failed: Error: Unable to resolve module scheduler/tracing from F:\ReactNative\project8\node_modules\react-native\Libraries\Renderer\oss\ReactNativeRenderer-dev.js: Module ...
2019-04-06 17:15:51
2099
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人