問題タブ [vue-select]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
vue.js - 関数宣言の一部として Vue prop を使用する
Vue アプリで vue-select を使用しています。v-select のラッパーとしてコンポーネントを作成しました。options 配列の特定の列のみを返すには、vue-select の :reduce prop を使用します。
val
このコードは機能しますが、静的文字列を動的 prop にしたいと考えていますreturnKey
。これは prop としてコンポーネントに渡されます。
これを機能させるには、:reduce に渡される関数で 'option' 文字列と 'returnKey' の動的な値を組み合わせるには、どの構文を使用すればよいですか?