<template>
<div>
<!-- 使用 Layui Vue 的按钮组件 -->
<lay-button type="primary">主要按钮</lay-button>
<lay-button type="success">成功按钮</lay-button>
<lay-button type="warning">警告按钮</lay-button>
<lay-button type="danger">危险按钮</lay-button>
</div>
</template>
<script>
import { defineComponent } from 'vue';
import { LayButton } from 'layui-vue'; // 引入 Layui Vue 的按钮组件
export default defineComponent({
components: {
LayButton, // 注册按钮组件
},
});
</script>
<style scoped>
/* 可以在这里添加自定义样式 */
</style>
模板部分 (<template>):
lay-button 组件来创建不同类型的按钮(主要、成功、警告、危险)。脚本部分 (<script>):
defineComponent 定义一个 Vue 组件。import 引入 Layui Vue 的按钮组件 LayButton。components 中注册 LayButton,以便在模板中使用。样式部分 (<style scoped>):
上一篇:vue3 ts
下一篇:vue开发
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站