Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagetypescript
<template>
  <div class="font-bold">
    {{ testString }}
  </div>
  <div class="font-bold">
    {{ getHelloWorldText() }}
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'

export default defineComponent({
    props: {
        // Type-Safe properties! 
        myComplexProperty: {
          type: Object as PropType<MyInterface>,
          required: true,
        }
    }, 
    emits: [],
    setup(props, { emit }) {
    const testString = ref<String>('Hello');
    
],    function setup(props, { emit }) {
getHelloWorldText(): string{
      return `${testString.value} World`;
    }
    
    return { testString, getHelloWorldText },
    },
})
</script>

<style scoped>

</style>

...