Home > Software engineering >  if-emoji lookup table with Vue
if-emoji lookup table with Vue

Time:04-29

I'm using the npm module Project

emojiorimage.vue

<template>
  <h2>    
    <div v-if="usesmily === 'true'">{{ smily }}</div>
    <div v-else><img :scr="imgpath" width="50" height="50" 
        :alt="imgpath" /></div>
  </h2>
</template>

<script>
export default {
  props: ["usesmily", "smily", "imgpath"],
};
</script>

App.vue

<template>
  <div id="app">
    <h1>Emoji or Image</h1>

    <emojiorimage
      usesmily="false"
      smily="           
  • Related