Skip to content

Latest commit

 

History

History
33 lines (21 loc) · 2.49 KB

File metadata and controls

33 lines (21 loc) · 2.49 KB

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>

Back Share your Solutions Check out Solutions