Skip to content

custom element hard #Web Components

By webfansplz @webfansplz

Take the Challenge    简体中文

Have you heard about Web Components ?

Vue has excellent support for both creating and consuming custom elements.

For this challenge, you can try it out. Lets go 👇:

<script setup lang='ts'>

import { onMounted } from "vue"

/**
 * Implement the code to create a custom element.
 * Make the output of page show "Hello Vue.js".
*/
const VueJs = "???"

onMounted(() => {
  document.getElementById("app")!.innerHTML = "<vue-js message=\"Hello Vue.js\"></vue-js>"
})

</script>

<template>
  <div id="app"></div>
</template>

Share your Solutions Check out Solutions