ฉันกำลังพยายามส่งค่าไปยังเทมเพลต dom-repeat
แต่ลักษณะการทำงานมีค่าเริ่มต้นเป็นรายการแรกในอาร์เรย์ ฉันกำลังพยายามตั้งค่าสตริงจากอาร์เรย์ของสตริง
องค์ประกอบหลัก
<select value="[[entry.method]]"
on-change="_changeMethod">
<template is="dom-repeat" items="[[entry.methods]]">
<option value="[[item]]">[[item]]</option>
</template>
</select>
องค์ประกอบย่อย
this.dispatchEvent(new CustomEvent('add-item', {
bubbles: true,
composed: true,
detail: {
method: 'b',
methods: ['a', 'b', 'c']
}));
เมนูแบบเลื่อนลงมีค่าเริ่มต้นเป็น 'a'
ฉันจะส่งผ่าน 'b'
เพื่อตั้งค่าดรอปดาวน์เริ่มต้นได้อย่างไร