工作分类和城市列表筛选实现
This commit is contained in:
parent
6120b17c08
commit
f7b3429113
@ -48,5 +48,14 @@ export default {
|
||||
getJobDetail: (id) => request({
|
||||
url: `/job_detail/${id}`,
|
||||
method: 'get',
|
||||
})
|
||||
}),
|
||||
|
||||
testAPI: (data) => {
|
||||
console.log(data, typeof data)
|
||||
return request({
|
||||
url: '/test/',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
}
|
@ -41,7 +41,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<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";
|
||||
|
||||
const focusing = ref(false)
|
||||
@ -151,10 +151,9 @@ const check = (item, e) => {
|
||||
modelValue.value.push(item[props.value.key]);
|
||||
}
|
||||
}
|
||||
|
||||
EventBus.emit("check", e.target.checked)
|
||||
EventBus.emit("check", item[props.value.key])
|
||||
emit('update:modelValue', modelValue.value)
|
||||
emit('update:modelValue', [...modelValue.value])
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
|
@ -35,6 +35,11 @@ const routes = [
|
||||
path: '/login',
|
||||
name: 'login',
|
||||
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
|
||||
})
|
||||
|
||||
// 分类及城市分类配置
|
||||
// 分类及城市分类以及搜索配置
|
||||
const config = computed(() => {
|
||||
return {
|
||||
limit: pageOperation.value.limit,
|
||||
page: pageOperation.value.page,
|
||||
job_category_id_list: job_category_id_list.value,
|
||||
location_code_list: location_code_list.value,
|
||||
}
|
||||
@ -183,7 +185,7 @@ onMounted(() => {
|
||||
})
|
||||
|
||||
watch(config, (newValue, oldValue) => {
|
||||
console.log(config)
|
||||
console.log(config.value)
|
||||
searchBarFixedTop.value && window.scrollTo(0, positionY)
|
||||
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