M
M
Maxim2021-06-30 12:24:33
Vue.js
Maxim, 2021-06-30 12:24:33

Why doesn't it see the value from props in Vue?

Tell me why in the setup when opening the page it doesn’t see props.value, if I just output to the console props сonsole.log (props) then it displays the content, but props.value is not, it’s empty

<script lang="ts">
import { defineComponent, ref, useContext } from '@nuxtjs/composition-api'

export default defineComponent({
  props: {
    value: {
      type: String,
      required: true,
    },
  },
  setup(props, { emit }) {
    const { $axios } = useContext()

    const text = ref('')

    console.log(props)

    text.value = props.value
 }
})

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Kulakov, 2021-06-30
@kulakoff Vue.js

Maybe props.value is just an empty string?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question