更新文档

This commit is contained in:
就眠仪式 2021-10-15 14:27:58 +08:00
parent 8ced3fe819
commit 08569ef65e
9 changed files with 59 additions and 29 deletions

View File

@ -21,7 +21,7 @@ export default {
::: demo
<template>
<lay-block nm>引用区域的文字</lay-block>
<lay-block :nm="nm">引用区域的文字</lay-block>
</template>
<script>
@ -30,7 +30,10 @@ import { ref } from 'vue'
export default {
setup() {
const nm = ref(true)
return {
nm
}
}
}

View File

@ -32,7 +32,9 @@ export default {
<template>
<lay-menu selectedKey="5" tree>
<lay-menu-item title="首页" id="1">
<template v-slot:title> 无感 </template>
<template v-slot:title>
<router-link to="">哈哈哈</router-link>
</template>
</lay-menu-item>
<lay-menu-item title="用户" id="2"></lay-menu-item>
<lay-menu-item title="角色" id="3"></lay-menu-item>

View File

@ -1,7 +1,7 @@
::: demo
<template>
<lay-page :limit="limit" :total="total" showPage></lay-page>
<lay-page :limit="limit" :total="total" :show-page="showPage"></lay-page>
</template>
<script>
@ -12,10 +12,12 @@ export default {
const limit = ref(20)
const total = ref(100)
const showPage = ref(true)
return {
limit,
total
total,
showPage
}
}
}
@ -51,11 +53,11 @@ export default {
::: demo
<template>
<lay-page :limit="limit" :total="total" showPage theme="red"></lay-page>
<lay-page :limit="limit" :total="total" :show-page="showPage" theme="red"></lay-page>
<br>
<lay-page :limit="limit" :total="total" showPage theme="blue"></lay-page>
<lay-page :limit="limit" :total="total" :show-page="showPage" theme="blue"></lay-page>
<br>
<lay-page :limit="limit" :total="total" theme="orange"></lay-page>
<lay-page :limit="limit" :total="total" :show-page="showPage" theme="orange"></lay-page>
</template>
<script>
@ -66,10 +68,12 @@ export default {
const limit = ref(20)
const total = ref(100)
const showPage = ref(true)
return {
limit,
total
total,
showPage
}
}
}
@ -80,7 +84,7 @@ export default {
::: demo
<template>
<lay-page :limit="limit" :total="total" showCount showPage showLimit showRefresh showSkip></lay-page>
<lay-page :limit="limit" :total="total" :show-count="showCount" :show-page="showPage" :show-limit="showLimit" :show-refresh="showRefresh" showSkip="showSkip"></lay-page>
</template>
<script>
@ -91,10 +95,20 @@ export default {
const limit = ref(20)
const total = ref(100)
const showCount = ref(true)
const showPage = ref(true)
const showLimit = ref(true)
const showRefresh = ref(true)
const showSkip = ref(true)
return {
limit,
total
total,
showCount,
showPage,
showLimit,
showRefresh,
showSkip
}
}
}
@ -105,7 +119,7 @@ export default {
::: demo
<template>
<lay-page :limit="limit" :total="total" @jump="jump" showPage></lay-page>
<lay-page :limit="limit" :total="total" @jump="jump" :show-page="showSkip"></lay-page>
</template>
<script>
@ -116,6 +130,7 @@ export default {
const limit = ref(20)
const total = ref(100)
const showPage = ref(true)
const jump = function({ current }) {
console.log("当前页:" + current)
}
@ -123,7 +138,8 @@ export default {
return {
limit,
total,
jump
jump,
showPage
}
}
}

View File

@ -47,10 +47,10 @@ export default {
::: demo
<template>
<lay-progress percent="80" showText></lay-progress>
<lay-progress percent="80" :show-text="showText"></lay-progress>
<br/>
<br/>
<lay-progress percent="80" showText text="销售量"></lay-progress>
<lay-progress percent="80" :show-text="showText" text="销售量"></lay-progress>
</template>
<script>
@ -59,7 +59,10 @@ import { ref } from 'vue'
export default {
setup() {
const showText = ref(true)
return {
showText
}
}
}

View File

@ -17,7 +17,7 @@ export default {
const selected1 = ref("1");
return {
selected
selected1
}
}
}

View File

@ -44,7 +44,7 @@ export default {
::: demo
<template>
<lay-rate v-model="all2" length=10></lay-rate> {{all2}}
<lay-rate v-model="all2" :length="length"></lay-rate> {{all2}}
</template>
<script>
@ -54,9 +54,11 @@ export default {
setup() {
const all2 = ref(4);
const length = ref(10)
return {
all2
all2,
length
}
}
}

View File

@ -126,7 +126,7 @@ export default {
::: demo
<template>
<lay-table :columns="columns" id="id" :dataSource="dataSource" v-model:selectedKeys="selectedKeys" checkbox default-toolbar>
<lay-table :columns="columns" id="id" :dataSource="dataSource" v-model:selectedKeys="selectedKeys" :checkbox="checkbox" :default-toolbar="defaultToolbar">
<template v-slot:toolbar>
<lay-button size="sm">新增</lay-button>
<lay-button size="sm">删除</lay-button>
@ -147,6 +147,8 @@ export default {
setup() {
const selectedKeys = ref(['1'])
const checkbox = ref(true)
const defaultToolbar = ref(true)
const columns = [
{
@ -179,7 +181,9 @@ export default {
return {
columns,
dataSource,
selectedKeys
selectedKeys,
checkbox,
defaultToolbar
}
}
}

View File

@ -1,6 +1,6 @@
{
"name": "@layui/layui-vue",
"version": "0.1.0",
"version": "0.1.2",
"description": "a component library for Vue 3 base on layui-vue",
"main": "lib/layui-vue.umd.js",
"module": "lib/layui-vue.es.js",

View File

@ -5,8 +5,7 @@
:class="[isOpen && isTree ? 'layui-nav-itemed' : '']"
>
<a href="javascript:void(0)" @click="openHandle">
<slot v-if="slots.title" name="title"></slot>
<span v-else>{{ title }}</span>
{{ title }}
<i class="layui-icon layui-icon-down layui-nav-more" />
</a>
<dl
@ -26,9 +25,9 @@
:class="[selectKey === id ? 'layui-this' : '']"
@click="selectHandle()"
>
<a href="javascript:void(0)">
<slot v-if="slots.title" name="title"></slot>
<span v-else> {{ title }} </span>
<slot v-if="slots.title" name="title"></slot>
<a v-else href="javascript:void(0)">
{{ title }}
</a>
</li>
</template>
@ -37,10 +36,11 @@
import { defineProps, inject, Ref, ref, useSlots } from 'vue'
const slots = useSlots()
const props = defineProps<{
id: string
title: string
}>()
const props =
defineProps<{
id: string
title: string
}>()
const isOpen = ref(false)