Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

vue custom event validation

<script>
export default{
 mounted(){
    console.log(this.$slots.footer);
  },
  emits:{
    "buy-now-clicked": function(data){
      if (!data){
        return false;
      }
                           I
      return true;
  },
  props:{product:{type: Object, default: () => ({})}},
 methods:{
    handleBuyNowClick(){
    this.$emit("buy-now-clicked", this.product);
    },
    handleAddToCartClick(){
      this.$emit("add-to-cart-clicked", this.product);
    }
  }
};
</script>
 
PREVIOUS NEXT
Tagged: #vue #custom #event #validation
ADD COMMENT
Topic
Name
9+9 =