补充 layer.msg 文档

This commit is contained in:
就眠儀式 2021-12-08 11:54:42 +08:00
parent 4708732d6e
commit debdc84b25
5 changed files with 68 additions and 12 deletions

View File

@ -14,7 +14,7 @@ export default {
setup() {
const openConfirm1 = function() {
layer.confirm("你没事吧???")
layer.confirm("layui-vue 1.0.0 已经发布")
}
return {
@ -42,7 +42,7 @@ export default {
setup() {
const openConfirm2 = function() {
layer.confirm("你没事吧???", {btn: [{text:'确认'},{text:'取消'}]})
layer.confirm("你如何看待 layui-vue 的发布", {btn: [{text:'站着看'},{text:'坐着看'}]})
}
return {

View File

@ -0,0 +1,47 @@
::: title 基础使用
:::
::: demo
<template>
<lay-button type="primary" @click="openSuccess">成功消息</lay-button>
<lay-button type="primary" @click="openFailure">失败消息</lay-button>
<lay-button type="primary" @click="openWarning">警告消息</lay-button>
<lay-button type="primary" @click="openPrimary">详情消息</lay-button>
<lay-button type="primary" @click="openLoading">加载消息</lay-button>
</template>
<script>
import { layer } from "../../../../src/index.ts"
export default {
setup() {
const openSuccess = function() {
layer.msg("成功消息", { icon : 1, time: 1000})
}
const openFailure = function() {
layer.msg("失败消息", { icon : 2, time: 1000})
}
const openWarning = function() {
layer.msg("警告消息", { icon : 3, time: 1000})
}
const openPrimary = function() {
layer.msg("详情消息", { icon : 4, time: 1000})
}
const openLoading = function() {
layer.msg("加载消息", { icon : 16, time: 1000})
}
return {
openSuccess, openFailure, openWarning, openPrimary, openLoading
}
}
}
</script>
:::

View File

@ -274,7 +274,11 @@ const zhCN = [
},{
path: '/zh-CN/components/confirm',
component: () => import('../../docs/zh-CN/components/confirm.md'),
meta: { title: '确认' },
meta: { title: '询问' },
},{
path: '/zh-CN/components/msg',
component: () => import('../../docs/zh-CN/components/msg.md'),
meta: { title: '信息' },
},
],
},

View File

@ -334,19 +334,24 @@ export default {
children: [
{
id: 90,
title: '模态窗',
title: '弹层',
subTitle: 'modal',
path: '/zh-CN/components/modal',
}, {
id: 90,
title: '加载',
},{
id: 91,
title: '加载',
subTitle: 'modal',
path: '/zh-CN/components/load',
}, {
id: 90,
title: '询问',
},{
id: 92,
title: '询问',
subTitle: 'confirm',
path: '/zh-CN/components/confirm',
},{
id: 93,
title: '消息',
subTitle: 'msg',
path: '/zh-CN/components/msg',
},
],
},

View File

@ -30,14 +30,14 @@
"peerDependencies": {
"vue": "^3.2.24",
"vue-router": "^4.0.12",
"@layui/layer-vue": "^1.0.8",
"@layui/layer-vue": "^1.0.9",
"@layui/icons-vue": "^1.0.0",
"@layui/hooks-vue": "^0.1.6"
},
"dependencies": {
"vue": "^3.2.24",
"vue-router": "^4.0.12",
"@layui/layer-vue": "^1.0.8",
"@layui/layer-vue": "^1.0.9",
"@layui/icons-vue": "^1.0.0",
"@layui/hooks-vue": "^0.1.6"
},