|
@@ -20,19 +20,35 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
-import { ref, defineEmits } from 'vue';
|
|
|
|
|
|
+import { ref, defineEmits, defineProps, watch } from 'vue';
|
|
import { hotRank } from '../../../api/index';
|
|
import { hotRank } from '../../../api/index';
|
|
import hotIcon from '../../../assets/img/hot.png';
|
|
import hotIcon from '../../../assets/img/hot.png';
|
|
const emit = defineEmits(['changeSearch']);
|
|
const emit = defineEmits(['changeSearch']);
|
|
const listHot = ref([]);
|
|
const listHot = ref([]);
|
|
const colorRanking = ['#FE2D46', '#F60', '#FAA90E'];
|
|
const colorRanking = ['#FE2D46', '#F60', '#FAA90E'];
|
|
|
|
+const props = defineProps({
|
|
|
|
+ province: String,
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+const hot = () => {
|
|
|
|
+ hotRank({
|
|
|
|
+ data: {
|
|
|
|
+ province: props.province || undefined,
|
|
|
|
+ },
|
|
|
|
+ }).then(res => {
|
|
|
|
+ listHot.value = res || [];
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
|
|
-hotRank({}).then(res => {
|
|
|
|
- listHot.value = res || [];
|
|
|
|
|
|
+watch(props, () => {
|
|
|
|
+ console.log(props.province);
|
|
|
|
+ hot();
|
|
});
|
|
});
|
|
|
|
+
|
|
const searchHot = text => {
|
|
const searchHot = text => {
|
|
emit('changeSearch', text);
|
|
emit('changeSearch', text);
|
|
};
|
|
};
|
|
|
|
+hot();
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|