<nuxt-button class="custom-button" :style="{ backgroundColor: 'blue' }"> 蓝色按钮 </nuxt-button> 创建自定义组件 如果NuxtUI 中的现成组件无法满足特定需求,开发者可以基于现成组件创建自定义组件。比如创建一个自定义按钮组件: // src/components/CustomButton.vue <template> <nuxt-button class="custom...
按钮组件:<nui-button>,用于创建各种类型的按钮。 输入框组件:<nui-input>,用于创建文本输入框。 导航栏组件:<nui-navbar>,用于创建顶部导航栏。 表格组件:<nui-table>,用于展示表格数据。 组件的基本用法 按钮组件 按钮组件的使用非常简单,只需要引入并使用即可: <nui-button type="primary" @click="handleCli...
<template> <div> <nui-button type="primary">Primary</nui-button> <nui-button type="success">Success</nui-button> <nui-button type="danger">Danger</nui-button> </div> </template> <script> export default { components: { 'nui-button': () => import('nuxt-ui/dist/components/Button')...
<nui-button type="primary" size="large" @click="handleClick"> 点击我 </nui-button> </template> <script> export default { methods: { handleClick() { console.log('按钮被点击了'); } } } </script> 输入框组件 输入框组件可以用于输入文本或数字等信息。 <template> <nui-input v-model="i...
app.config.tsCollapsible.vue export default defineAppConfig({ ui: { button: { slots: { base: 'group font-bold', trailingIcon: 'group-data-[state=open]:rotate-180 transition-transform duration-200' }, defaultVariants: { color: 'neutral', variant: 'subtle' } } } }) Nuxt...
<template> <div class="w-screen h-screen flex justify-around items-center"> <UButton>Button</UButton> <UBreadcrumb :links="links" /> <Icon name="uil:github" size="48" /> </div> </template> <script setup lang="ts"> const links = [ { label: 'Home', icon: 'i-heroicons-home...
</div> <span>XXX</span> </div> <div class="flex gap-2 items-baseline grow"> <UButton icon="i-mdi:close-circle-outline">XXX</UButton> <UModal> <UButton>XXX</UButton> </UModal> <UCheckbox label="XXX"></UCheckbox> <UInput :model-value="'XXX'"></UInput> </div> </div> ...
{selectedPerson.name}}</span><spanclass="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2"><ChevronUpDownIconclass="h-5 w-5 text-gray-400"aria-hidden="true"/></span></HeadlessListboxButton><transitionleave-active-class="transition duration-100 ease-in"leave-from-...
button>9<mt-button slot="right" v-if="headerType == 'mRight'">{{stringRight}}</mt-button>10<mt-button slot="right" v-if="headerType == 'setting'">11<div>12<i class="icon iconfont icon-31shezhi"></i>13</div>14</mt-button>15</mt-header>16<v-indexPopup v-model="tab">...
We then add our own margin class styles "ml-auto h-min mt-3" to position the button to the right end and add a bit of margin to the top. Finally, we have the the :ui prop that allows us overwrite the default value of the other props directly within the component. In this case,...