delete unused ellipsis.scss partial and its import, update all components to use truncate and line-clamp-2 utilities
59 lines
1.8 KiB
Vue
59 lines
1.8 KiB
Vue
<template>
|
|
<view class="map-navigation-card bg-white rounded-[24px] overflow-hidden w-full">
|
|
<view class="map-navigation-card__media">
|
|
<image class="map-navigation-card__image block w-full" :src="data.image" mode="aspectFill" />
|
|
<view class="map-navigation-card__badge flex flex-items-center text-white text-[12px] font-bold">
|
|
<text class="map-navigation-card__badge-icon">{{ badge.icon }}</text>
|
|
<text>{{ badge.text }}</text>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="map-navigation-card__content flex flex-items-center">
|
|
<view class="map-navigation-card__info flex-full">
|
|
<view class="map-navigation-card__title text-[#1e293b] text-[18px] font-bold truncate">
|
|
{{ data.title }}
|
|
</view>
|
|
<view class="map-navigation-card__distance text-[#94a3b8] text-[14px] font-bold truncate">
|
|
{{ data.distance }}
|
|
</view>
|
|
</view>
|
|
<view
|
|
class="map-navigation-card__button flex flex-items-center flex-justify-center bg-[#0f172a] text-white text-[18px] font-bold"
|
|
:class="{ 'is-disabled': disabled }" @click="handleAction">
|
|
<text class="map-navigation-card__button-icon">{{ action.icon }}</text>
|
|
<text>{{ action.text }}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { computed } from "vue";
|
|
|
|
const props = defineProps({
|
|
data: {
|
|
type: Object,
|
|
default: () => ({}),
|
|
},
|
|
disabled: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
});
|
|
|
|
const emit = defineEmits(["select", "action"]);
|
|
|
|
const badge = computed(() => props.data.badge || {});
|
|
const action = computed(() => props.data.action || {});
|
|
|
|
const handleAction = () => {
|
|
if (props.disabled) return;
|
|
emit("select", props.data);
|
|
emit("action", props.data);
|
|
};
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
@import "./styles/index.scss";
|
|
</style>
|