Vue3整合Tailwindcss之padding样式类
    		       		warning:
    		            这篇文章距离上次修改已过444天,其中的内容可能已经有所变动。
    		        
        		                
                
<template>
  <div class="bg-white shadow-md rounded px-4 py-6 md:flex md:items-center md:justify-between">
    <div class="flex-1">
      <p class="text-sm leading-5 text-gray-600">
        This is a toast message.
      </p>
    </div>
    <div class="flex-shrink-0 mt-4 md:mt-0">
      <div class="inline-flex text-gray-400">
        <svg class="w-6 h-6" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>
      </div>
    </div>
  </div>
</template>
 
<script>
export default {
  // ...
}
</script>
 
<style scoped>
/* 这里可以添加更多的样式,如果需要 */
</style>这个代码实例展示了如何在Vue 3项目中使用Tailwind CSS来创建一个带有图标的提示框组件。它使用了Tailwind的实用程序类来设置背景、边框、颜色、填充和图标。通过scoped属性,样式仅应用于当前组件,不会影响其他组件或页面的样式。
评论已关闭