[修复] dropdown 组件 触发逻辑

This commit is contained in:
就眠仪式 2021-10-07 18:21:28 +08:00
parent 8f90b73fd0
commit 3ed5a411f4
2 changed files with 7 additions and 6 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@layui/layui-vue", "name": "@layui/layui-vue",
"version": "0.0.10", "version": "0.0.11",
"description": "a component library for Vue 3 base on layui-vue", "description": "a component library for Vue 3 base on layui-vue",
"main": "lib/layui-vue.umd.js", "main": "lib/layui-vue.umd.js",
"module": "lib/layui-vue.es.js", "module": "lib/layui-vue.es.js",
@ -24,7 +24,7 @@
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://gitee.com/Jmysy/layui-vue" "url": "https://gitee.com/layui-vue/layui-vue"
}, },
"keywords": [ "keywords": [
"layui-vue", "layui-vue",
@ -34,9 +34,9 @@
"author": "就眠儀式", "author": "就眠儀式",
"license": "MIT", "license": "MIT",
"bugs": { "bugs": {
"url": "https://gitee.com/Jmysy/layui-vue/issues" "url": "https://gitee.com/layui-vue/layui-vue/issues"
}, },
"homepage": "https://gitee.com/Jmysy/layui-vue/blob/master/README.md", "homepage": "https://gitee.com/layui-vue/layui-vue/blob/master/README.md",
"peerDependencies": { "peerDependencies": {
"vue": "^3.2.19", "vue": "^3.2.19",
"vue-router": "^4.0.10" "vue-router": "^4.0.10"

View File

@ -2,10 +2,11 @@
<div <div
v-if="trigger === 'click'" v-if="trigger === 'click'"
class="layui-dropdown" class="layui-dropdown"
@click="open"
:class="[openState ? 'layui-dropdown-up' : '']" :class="[openState ? 'layui-dropdown-up' : '']"
> >
<slot></slot> <div @click="open">
<slot></slot>
</div>
<dl class="layui-anim layui-anim-upbit"> <dl class="layui-anim layui-anim-upbit">
<ul class="layui-menu layui-dropdown-menu"> <ul class="layui-menu layui-dropdown-menu">
<slot name="content"></slot> <slot name="content"></slot>