📝(cascader): 更新文档

更新文档
This commit is contained in:
就眠儀式 2022-06-21 16:04:22 +08:00
parent 28d617ccc0
commit c6e14ac986
3 changed files with 39 additions and 3 deletions

View File

@ -176,7 +176,7 @@ const selectBar = (item: any, selectIndex: number, parentIndex: number) => {
if (!item.children) { if (!item.children) {
// //
let data: never[] = []; let data: any[] = [];
function extractData(orginData: any, dataContainer: any, index: number) { function extractData(orginData: any, dataContainer: any, index: number) {
const element = orginData[index].data; const element = orginData[index].data;
const selectIndex = orginData[index].selectIndex; const selectIndex = orginData[index].selectIndex;

View File

@ -253,6 +253,36 @@ export default {
::: :::
::: title 关闭标题
:::
::: demo
<template>
<lay-button @click="changeVisible9" type="primary">关闭标题</lay-button>
<lay-layer title="false" move="true" shade="false" v-model="visible9">
内容
</lay-layer>
</template>
<script>
import { ref, watch } from "vue";
import { useRoute, useRouter } from "vue-router";
export default {
setup() {
const visible9 = ref(false)
const changeVisible9 = function() {
visible9.value = !visible9.value
}
return {
visible9
};
}
};
</script>
:::
::: title 函数调用 ::: title 函数调用
::: :::
@ -270,20 +300,25 @@ import { layer } from "@layui/layer-vue"
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
export default { export default {
setup() { setup() {
let id = null; let id = null;
const open = function() { const open = function() {
id = layer.open({title:"标题",content:"内容", shade: false, btn: [ id = layer.open({title:"标题",content:"内容", shade: false, btn: [
{text:"关闭", callback: function(ids) { {text:"关闭", callback: function(layerId) {
layer.close(ids); layer.close(layerId);
}} }}
]}) ]})
} }
const close = function() { const close = function() {
layer.close(id) layer.close(id)
} }
const closeAll = function() { const closeAll = function() {
layer.closeAll() layer.closeAll()
} }
return { return {
open, open,
close, close,

View File

@ -16,6 +16,7 @@
<li> <li>
<h3>1.1.9 <span class="layui-badge-rim">2022-06-20</span></h3> <h3>1.1.9 <span class="layui-badge-rim">2022-06-20</span></h3>
<ul> <ul>
<li>[新增] cascader 级联组件, 将数据按照指定的格式传入后分层分级,通过此组件逐级查看并选择。</li>
<li>[新增] page-header 组件,页面的路径比较简单,则使用页头组件要,比面包屑更直观一点</li> <li>[新增] page-header 组件,页面的路径比较简单,则使用页头组件要,比面包屑更直观一点</li>
<li>[修复] layer 组件 btn 属性 callback 回调参数 id 为空的问题</li> <li>[修复] layer 组件 btn 属性 callback 回调参数 id 为空的问题</li>
<li>[优化] layer 组件 callback 回调 id 参数, 配合 layer.close() 关闭当前弹层</li> <li>[优化] layer 组件 callback 回调 id 参数, 配合 layer.close() 关闭当前弹层</li>