-
Value: {JSON.stringify(this.value)}
, - ]; - } - - private onChange(event) { - this.value = event.detail; - } - - private toggleEnabled() { - this.disabled = !this.disabled; - } -} diff --git a/src/examples/select/select-multiple.tsx b/src/examples/select/select-multiple.tsx new file mode 100644 index 0000000000..e0ea27eed5 --- /dev/null +++ b/src/examples/select/select-multiple.tsx @@ -0,0 +1,65 @@ +import { Component, State } from '@stencil/core'; +import { Option } from '../../interface'; + +@Component({ + shadow: true, + tag: 'limel-example-select-multiple', + styleUrl: 'select.scss', +}) +export class SelectMultipleExample { + @State() + public value: Option; + + @State() + public disabled = false; + + private options: Option[] = [ + { text: 'Luke Skywalker', value: 'luke' }, + { text: 'Han Solo', value: 'han' }, + { text: 'Leia Organo', value: 'leia' }, + { text: 'Homer Simpson', value: 'homer' }, + { text: 'Moe Szyslak', value: 'moe' }, + { text: 'Ned Flanders', value: 'ned' }, + { text: 'David Tennant', value: '10' }, + { text: 'Matt Smith', value: '11' }, + { text: 'Peter Capaldi', value: '12' }, + { text: 'Jodie Witthaker', value: '13' }, + ]; + + constructor() { + this.onChange = this.onChange.bind(this); + this.toggleEnabled = this.toggleEnabled.bind(this); + } + + public render() { + return ( +
+
Value: {JSON.stringify(this.value)}
+