Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fork #10

Closed
wants to merge 15 commits into from
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "buefy",
"version": "0.9.21",
"name": "@dword-design/buefy-me",
"version": "0.0.7",
"homepage": "https://buefy.org",
"description": "Lightweight UI components for Vue.js (v3) based on Bulma",
"author": "Rafael Beraldo <rafael.pimpa@gmail.com>",
Expand All @@ -9,7 +9,7 @@
"Kikuo Emoto <kemoto@codemonger.io>"
],
"license": "MIT",
"main": "dist/cjs/index.js",
"main": "dist/esm/index.js",
"module": "dist/esm/index.js",
"unpkg": "dist/buefy.min.js",
"typings": "types/index.d.ts",
Expand All @@ -24,10 +24,10 @@
],
"repository": {
"type": "git",
"url": "https://github.com/buefy/buefy.git"
"url": "https://github.com/kikuomax/buefy"
},
"bugs": {
"url": "https://github.com/buefy/buefy/issues"
"url": "https://github.com/kikuomax/buefy/issues"
},
"vetur": {
"tags": "dist/vetur/tags.json",
Expand Down
81 changes: 35 additions & 46 deletions src/components/menu/MenuList.vue
Original file line number Diff line number Diff line change
@@ -1,51 +1,40 @@
<script>
import { h as createElement, resolveComponent } from 'vue'
<template>
<p v-if="label || $slots.label" class="menu-label">
<template v-if="label">
<template v-if="icon">
<b-icon
:icon="icon"
:pack="iconPack"
:size="size"
/>
<span>{{ label }}</span>
</template>
<template v-else>
{{ label }}
</template>
</template>
<slot v-else name="label" />
</p>
<ul class="menu-list" :role="ariaRole === 'menu' ? props.ariaRole : undefined">
<slot />
</ul>
</template>

const BMenuList = (props, context) => {
let vlabel = null
const slots = context.slots
if (props.label || slots.label) {
vlabel = createElement(
'p',
{ class: 'menu-label' },
props.label
? props.icon
? [
createElement(resolveComponent('b-icon'), {
icon: props.icon,
pack: props.iconPack,
size: props.size
}),
createElement('span', {}, props.label)
]
: props.label
: slots.label()
)
}
const vnode = createElement(
'ul',
{
class: 'menu-list',
role: props.ariaRole === 'menu' ? props.ariaRole : null
<script>
export default {
name: 'BMenuList',
props: {
label: String,
icon: String,
iconPack: String,
ariaRole: {
type: String,
default: ''
},
slots.default()
)
return vlabel ? [vlabel, vnode] : vnode
}

BMenuList.props = {
label: String,
icon: String,
iconPack: String,
ariaRole: {
type: String,
default: ''
},
size: {
type: String,
default: 'is-small'
size: {
type: String,
default: 'is-small'
}
}
}

export default BMenuList
</script>