Can not get router-link element.value #1640
Unanswered
prfardin
asked this question in
Help and Questions
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Version
4.1.6
Reproduction link
github.com/prfardin/efa-new
Steps to reproduce
this is my component and i can't get element value when my component tag is router-link, any idea?
<script setup lang="ts"> /** * for compile icons we use PrIcon components, and * it will create the span tag and put icon svg into it * but when there is no default slots icons must compile directly into self link * with no span tag, so in future we must remove addition span tag * when there is no default slots defined */ import {computed, onMounted, ref, useSlots, watchEffect} from "vue"; import { buttonClassObject } from "@bs/scripts/util/classes"; import PrIcon from "@bc/core/icon.vue"; import {icon, IconElement} from "../../src/scripts/util/util"; // must remove with future release of vue and must use as // import { ButtonPropsType } from "@bs/scripts/util/props"; interface ButtonPropsType { tag?: 'router-link' | 'a', to?: string, href?: string, default?: boolean, primary?: boolean, secondary?: boolean, muted?: boolean, xSmall?: boolean, rounded?: boolean, circle?: boolean, collapse?: boolean, icon?: string, ratio?: number, } const props = withDefaults(defineProps(), { tag: 'router-link' }) // define button classes from defined props const buttonClass = computed(() => buttonClassObject(props)) const slots = useSlots() const el = ref(null) function setIcon() { icon(el.value, props.icon, props.ratio) } onMounted(() => { watchEffect(setIcon) }) </script>i also put my project link to help me.
What is expected?
get element.value when component is router-link
What is actually happening?
cant get el.value when component is router-link
Beta Was this translation helpful? Give feedback.
All reactions