工作分类和城市列表筛选实现
This commit is contained in:
parent
6120b17c08
commit
f7b3429113
@ -48,5 +48,14 @@ export default {
|
|||||||
getJobDetail: (id) => request({
|
getJobDetail: (id) => request({
|
||||||
url: `/job_detail/${id}`,
|
url: `/job_detail/${id}`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
|
}),
|
||||||
|
|
||||||
|
testAPI: (data) => {
|
||||||
|
console.log(data, typeof data)
|
||||||
|
return request({
|
||||||
|
url: '/test/',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
@ -41,7 +41,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import {defineProps, toRefs, ref, computed, watch, onMounted} from "vue";
|
import {toRefs, ref, computed, watch, onMounted} from "vue";
|
||||||
import EventBus from "../helper/EventBus/index.js";
|
import EventBus from "../helper/EventBus/index.js";
|
||||||
|
|
||||||
const focusing = ref(false)
|
const focusing = ref(false)
|
||||||
@ -151,10 +151,9 @@ const check = (item, e) => {
|
|||||||
modelValue.value.push(item[props.value.key]);
|
modelValue.value.push(item[props.value.key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EventBus.emit("check", e.target.checked)
|
EventBus.emit("check", e.target.checked)
|
||||||
EventBus.emit("check", item[props.value.key])
|
EventBus.emit("check", item[props.value.key])
|
||||||
emit('update:modelValue', modelValue.value)
|
emit('update:modelValue', [...modelValue.value])
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
@ -35,6 +35,11 @@ const routes = [
|
|||||||
path: '/login',
|
path: '/login',
|
||||||
name: 'login',
|
name: 'login',
|
||||||
component: () => import('../views/Login/Login.vue')
|
component: () => import('../views/Login/Login.vue')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/test',
|
||||||
|
name: 'test',
|
||||||
|
component: () => import('../views/Test/index.vue')
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -120,9 +120,11 @@ const pageOperation = ref({
|
|||||||
page: 1
|
page: 1
|
||||||
})
|
})
|
||||||
|
|
||||||
// 分类及城市分类配置
|
// 分类及城市分类以及搜索配置
|
||||||
const config = computed(() => {
|
const config = computed(() => {
|
||||||
return {
|
return {
|
||||||
|
limit: pageOperation.value.limit,
|
||||||
|
page: pageOperation.value.page,
|
||||||
job_category_id_list: job_category_id_list.value,
|
job_category_id_list: job_category_id_list.value,
|
||||||
location_code_list: location_code_list.value,
|
location_code_list: location_code_list.value,
|
||||||
}
|
}
|
||||||
@ -183,7 +185,7 @@ onMounted(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
watch(config, (newValue, oldValue) => {
|
watch(config, (newValue, oldValue) => {
|
||||||
console.log(config)
|
console.log(config.value)
|
||||||
searchBarFixedTop.value && window.scrollTo(0, positionY)
|
searchBarFixedTop.value && window.scrollTo(0, positionY)
|
||||||
getJobList()
|
getJobList()
|
||||||
})
|
})
|
||||||
|
28
src/views/Test/index.vue
Normal file
28
src/views/Test/index.vue
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<button @click="add">点击</button>
|
||||||
|
<span>{{ testArray }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {computed, ref} from "vue";
|
||||||
|
|
||||||
|
let i = 0
|
||||||
|
const array = ref([])
|
||||||
|
|
||||||
|
const add = () => {
|
||||||
|
array.value = [i]
|
||||||
|
i++
|
||||||
|
}
|
||||||
|
|
||||||
|
const testArray = computed(() => {
|
||||||
|
console.log(123)
|
||||||
|
return array.value
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
Loading…
x
Reference in New Issue
Block a user