Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

props vue 3

// single file component
<script setup>
const props = defineProps({
  foo: String
})
</script>


// or without "setup" in script tag
export default {
  props: {
    title: String
  },
  setup(props) {
    console.log(props.title)
  }
}
 
PREVIOUS NEXT
Tagged: #props #vue
ADD COMMENT
Topic
Name
1+6 =