<template>
<div class="min-h-screen flex items-center justify-center bg-gray-100">
<div class="bg-white p-8 rounded-lg shadow-lg w-full max-w-md">
<h2 class="text-2xl font-bold mb-6 text-gray-900">Welcome to Vue + TailwindCSS</h2>
<p class="text-gray-700 mb-4">This is a simple example of using Vue.js with TailwindCSS.</p>
<button class="bg-blue-500 text-white py-2 px-4 rounded hover:bg-blue-600 transition duration-300">
Click Me
</button>
</div>
</div>
</template>
<script>
export default {
name: 'App'
}
</script>
<style>
@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";
</style>
模板部分 (<template>
):
TailwindCSS
的类来快速构建样式,如 flex
, items-center
, justify-center
等。脚本部分 (<script>
):
App
。样式部分 (<style>
):
TailwindCSS
的基础样式、组件样式和工具样式。确保项目中已经安装并配置了 TailwindCSS。这个示例展示了如何在 Vue 项目中使用 TailwindCSS 来快速构建响应式和美观的用户界面。
上一篇:vue3遍历数组
下一篇:vue css deep
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站