Home > OS >  what is :data-col attribute in div element?
what is :data-col attribute in div element?

Time:11-12

I found this in vue component , I didn't understand the purpose of :data-col in div , could you explain please

<template>
  <div
    
    :
    :data-col="isNavMenuHidden ? '1-column' : null"
  >

CodePudding user response:

This is a combination of Vue attribute binding and HTML data-* attribute

The purpose of this code is to put the data-* attribute on the specified div when the isNavMenuHidden is true.

CodePudding user response:

this is a bind attribute and means that data-col is equal to 1-column when 'isNavMenuHidden' is true

  • Related