您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

components-nativeselect.asciidoc 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. ---
  2. title: NativeSelect
  3. order: 18
  4. layout: page
  5. ---
  6. [[components.nativeselect]]
  7. = [classname]#NativeSelect#
  8. ifdef::web[]
  9. [.sampler]
  10. image:{live-demo-image}[alt="Live Demo", link="http://demo.vaadin.com/sampler/#ui/data-input/multiple-value/drop-down-menu"]
  11. endif::web[]
  12. [classname]#NativeSelect# is a drop-down selection component implemented with
  13. the native selection input of web browsers, using the HTML
  14. [literal]#++<select>++# element.
  15. [source, java]
  16. ----
  17. // Create the selection component
  18. NativeSelect<String> select =
  19. new NativeSelect<>("Native Selection");
  20. // Add some items
  21. select.setItems("Mercury", "Venus", ...);
  22. ----
  23. The [methodname]#setColumns()# allows setting the width of the list as
  24. "columns", which is a measure that depends on the browser.
  25. [[figure.components.nativeselect.basic]]
  26. .The [classname]#NativeSelect# Component
  27. image::img/nativeselect-basic.png[width=20%, scaledwidth=35%]
  28. Common selection component features are described in
  29. <<dummy/../../../framework/components/components-selection#components.selection,"Selection Components">>.
  30. == CSS Style Rules
  31. [source, css]
  32. ----
  33. .v-select {}
  34. .v-select-select {}
  35. ----
  36. The component has a [literal]#++v-select++# overall style. The native
  37. [literal]#++select++# element has [literal]#++v-select-select++# style.