mirror of
https://github.com/tenrok/vue-select.git
synced 2026-05-17 02:29:37 +03:00
c9917dfd21
pnpm dlx codemod@0.18.7 nuxt/4/migration-recipe
43 lines
876 B
Vue
43 lines
876 B
Vue
<script setup lang="ts">
|
|
defineProps<{
|
|
width: string
|
|
height: string
|
|
x: number
|
|
y: number
|
|
squares: boolean
|
|
}>()
|
|
</script>
|
|
|
|
<template>
|
|
<svg aria-hidden="true" v-bind="$attrs">
|
|
<defs>
|
|
<pattern
|
|
:id="patternId"
|
|
:width="width"
|
|
:height="height"
|
|
patternUnits="userSpaceOnUse"
|
|
:x="x"
|
|
:y="y"
|
|
>
|
|
<path :d="`M.5 ${height}V.5H${width}`" fill="none" />
|
|
</pattern>
|
|
</defs>
|
|
<rect
|
|
width="100%"
|
|
height="100%"
|
|
:stroke-width="0"
|
|
:fill="`url(#${patternId})`"
|
|
/>
|
|
<svg v-if="squares" :x="x" :y="y" class="overflow-visible">
|
|
<rect
|
|
v-for="square in squares"
|
|
:key="`${square[0]}-${square[1]}`"
|
|
width="width + 1"
|
|
height="height + 1"
|
|
:x="square[0] * width"
|
|
:y="square[1] * height"
|
|
/>
|
|
</svg>
|
|
</svg>
|
|
</template>
|