Coder Social home page Coder Social logo

terryz / v-selectmenu Goto Github PK

View Code? Open in Web Editor NEW
187.0 7.0 25.0 749 KB

SelectMenu for Vuejs, A simple, easier and highly customized menu solution

Home Page: https://terryz.github.io/docs-vue/#/selectmenu

License: MIT License

JavaScript 74.35% Stylus 23.50% HTML 0.38% Sass 1.77%
javascript vuejs menu multiple-level multiple-group embed contextmenu i18n quick-search

v-selectmenu's Introduction

Hi there

I am TerryZ, a game player who writes code

Github metrics

Metrics

Components

Vue 3 series

v-pagev-dropdownv-regionv-selectpagev-dialogs

Documentation for the Vue 3 series component: docs-vue3

Vue 2 series

Name Version
v-dropdown npm (custom registry)
v-region npm (custom registry)
v-selectpage npm (custom registry)
v-selectmenu npm version
v-page npm (custom registry)
v-suggest npm version
v-dialogs npm (custom registry)
v-tablegrid npm version
v-uploader npm version
v-gallery npm version
v-playback npm version

Documentation for the Vue 2 series component: docs-vue

jQuery series Plugins

SelectPageSelectMenubDialogbPagebTabs

Activity charts

Metrics

v-selectmenu's People

Contributors

aliveghost04 avatar aminkt avatar s-stopo avatar terryz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

v-selectmenu's Issues

Getting the specific row selected

How can I get information about a specific row/menu item a user has selected? I've tried the following:

<v-selectmenu :data="menu" :regular="true" @values="selected">
     <button>Select</button>
 </v-selectmenu>`

methods: {
     this.selected(a) {
            console.log(a);
      }
 }

But that doesn't seem to work. I've also tried in the data property itself:

{
    content: 'Dashboard',
    callback : this.selected('dashboard')
  }

But I can't get the callback to pass the argument to the method (the callback stops working all together when you try to pass in an argument).

I just want to be able to figure out what row/menu item a user selected. How can I do that?

Cannot set default value

Hi, when i editing form, i need to set default value of this select box. But it's not working

<v-selectmenu :data="list" class="form-control" v-model="value">
</v-selectmenu>
data () {
    return {
      value: 1,
      list: [
        {id: 1, name: 'Chicago Bulls', desc: '芝加哥公牛'},
        {id: 2, name: 'Cleveland Cavaliers', desc: '克里夫兰骑士'}
      ]
    }
}

CALLBACK METHODS

please, could you make callback methods using "this.methods"?

Data values cleared when "Select All" chosen twice

Steps to Reproduce:

  1. Create an advanced menu with the multiple choice option.
  2. Choose menu and in "Select Option" popup, click the Select All button (checkbox) twice or more times.
  3. Clear the selections (trash can).
  4. All data values in the list will disappear resulting in the "not found" message.

Just started to look into this, but just thought I would post it to let you know.

Button text is not being updated

After selecting an option button text should be changed. It always shows Select an option

<v-selectmenu v-model="state.selectedChatFilter"
                          :regular="true"
                          :data="chatFilters"></v-selectmenu>
chatFilters: [
	{name: 'Active Chats', id: 'activeChats', content: 'Active Chats'},
	{name: 'Closed Chats', id: 'closedChats', content: 'Closed Chats'},
	{name: 'All Chats', id: 'allChats', content: 'All Chats'}
]
selectedChatFilter = 'activeChats'

Also if I remove key content from list, text (Active Chats/Closed Chats/All Chats) is not being displayed in options

关于样式修改

标签目前是动态适应的,怎么设置成固定长度?选项的背景样式怎么设置?

Select All in Advanced Menu with Groups does partial selection only

Hi,

When I loaded a group data set, clicking the "select all" checkbox selects only the items of the active group, not every item in the menu. Is there a way to get everything selected (rather than forcing end-users to enter each group first)?

If I have an event like 'Select All clicked', I could check the number of items picked against the total number of items in the menu and cater for the difference but here I cannot hook into a 'Select all clicked' event/call.

Thank you!

初始化出问题了

image
代码:
image
image
image

使用的时候可以使用,但是会报错
希望大佬有空解答一下

selectmenu UI issue - menu always re-opens when you trying to close it via button

When you click the button to open a menu, that works as intended. But when you click the same button to close a menu, the menu will close briefly (its display is set to none), but then it immediately re-opens again. I've posted a gif below to illustrate the issue better:

https://makeagif.com/i/Ewp3vx

This is typically not the intended behavior of such menus. When the menu is open, and you click the button, the menu should close; it shouldn't re-open.

Call a method in the 'callback' option?

Is there any way to call a method inside the 'callback' option? For example:

{
     content:'Click Here!',
     callback : this.callMethod(),
}

My larger question is: how is one supposed to dynamically change the values in the select? For example: dynamically change whether an option is disabled or not.

Great looking component by the way!

Needs small Accessibility improvements

A couple of adjustments could be made to improve accessibility (a11y):

  1. The search input in the dropdown needs to have a label and or aria tags (even if not visible)
  2. The dropdown header (sm-header) should probably not be an H3, best to use a class instead, since modifying the template is not an option for that item. Have an H3 causes conflicts with the rest of the document hierarchy.

I am using the WAVE tool for A11Y
https://wave.webaim.org/

Customize Header

could i change your header v-selectmenu "select an option" ?, i wanna make some customization in header. please can you make it customizeable?

v-select emitting `input` on load

The component is emitting an input event when it loads, which triggers event handlers despite there being no change in model data.

add item problem

my system setting is here:

vue.js version: vue2
using library:
1. vue-cli
2. bootstrap-vue

and my source code

<b-col sm="2">
          <v-selectmenu 
            :data="app_list"
            language='en'
            :multiple='true'
            key-field="id"
            show-field="name"
            v-model="app_value"
            title='Select Your App'
            ref='test'>
          </v-selectmenu>        
</b-col>
<script>
import vSelectMenu from 'v-selectmenu'
Vue.use(vSelectMenu);

export default {
    name : 'App_test',  
    props: ['sessionKey'],
    components: {
    },
    data:function () {
       let options = qs.parse(location.search, { ignoreQueryPrefix: true })
       return {
           app_value:'',
           app_list:[
               {
                   id:0, name:'test',
               }
           ],
     },
    methods:{
        getDate(){
            let url = myUrl;
            let api_url = axios.get(url)
            api_url.then((response)=>{
                 for(let i =0; i<response.data.length; i++){
                        this.app_list.push({id:i+1, name:response.data[i]})
                 }
            })
        }
    }
}

However, v-selectmenu list can't update variable values.
looks like this.

result:

menu list: test
console.log(app_list):
[ { "id": 0, "name": "test" }, { "id": 1, "name": "HAI" }, { "id": 2, "name": "TEST012" } ]

How can i solve this problem?

Query/Search Not Working

This is a nice component. Great work! It looks like there is an issue with the query/search functionality, however. As soon as the user begins typing in the query/search field the below exception occurs.

You can check out a small project here I setup which demonstrates the issue. I also noticed the issue is occurring in your "Advanced menu" example.

Uncaught TypeError: Cannot read property 'name' of undefined
    at VueComponent.getRowText (v-selectmenu.js?34fb:1)
    at eval (v-selectmenu.js?34fb:1)
    at Array.filter (<anonymous>)
    at VueComponent.filter (v-selectmenu.js?34fb:1)
    at VueComponent.processKey (v-selectmenu.js?34fb:1)
    at invoker (vue.esm.js?efeb:2027)
    at HTMLInputElement.fn._withTask.fn._withTask (vue.esm.js?efeb:1826)

Concerning new version

Hi,

Does this latest code address all the current outstanding issues or are they being left open because they have not been tested yet?

Long text options

Hi, if i have an option with long text, it will offset from browser. This need ability to wrap the text into multiple row.

screen shot 2018-10-24 at 9 11 23 am

use router-links in NESTED menu?

You sent me this on reddit:

For custom router-link:

<v-selectmenu :data="list" type="regular" >
  <template #row="{ row }">
    <router-link :to="row.url" >{{row.name}}</router-link>
  </template>
</v-selectmenu>

But that doesn't seem to work if the menu is nested. Is it possible to use router-links for nested items?

Documentation?

Great UI and i gave u a star and forked this UI but where is the documentation? Simple things should be explained better, for example, how do i change "select an option" ? I don't want use i18n but i have too, and i can't change the title without language.js. I need a dynamic option to change the title but i couldn't find anything on GH (i am sure there is a way to do it). I don't want to use Vue.use(), how do i use it without "use()"? How can i use the {options} without use()? These small things should have examples or documentation. As i said, great UI(loved it), but not many will use it only because we don't have examples or documentation and running through the code to understand how it works some dev have no time. The documentation or good examples solve these problems. What i found is a short briefing and this is not enough to make the development enjoyable.

多选项全选问题

当多个选项的时候一个选项点击的全选按钮,另一个选项也点击了全选按钮,之前被选中的被覆盖了,处于未选中状态

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.