Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

vue smart-select the text on the list is not updated after changing selected option by script

Đang mở
#4,339 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
javascript
Lĩnh vực
frontend

Hướng nghiên cứu

Bắt đầu với bản tái hiện Vue 3.5.23 được cung cấp, sử dụng component smart-select, binding v-model của nó và thay đổi selectedId bằng script. Xác minh hành vi trong thiết lập Chrome đã được báo cáo, sau đó lần theo đường cập nhật của smart-select. Hoàn tất khi nhãn danh sách chuyển từ Option 1 sang Option 3 sau khi script chạy và việc chọn một tùy chọn cập nhật giá trị được binding một cách nhất quán.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

  • Framework7 version: 8.3.4
  • Vue.js version: 3.5.23
  • Platform and Target: window11 chrome browser
Describe the bug

smart-select, the text on the list is not updated after changing selected option by script, while the popup selected option is updated correctly.

<script setup>
import { reactive } from 'vue'

let input = reactive({
  selectedId: 1,
  options: [
    {
      id: 1,
      text: 'Option 1',
    },
    {
      id: 2,
      text: 'Option 2',
    },
    {
      id: 3,
      text: 'Option 3',
    },
  ],
})

setTimeout(() => {
  input.selectedId = 3 // change selected option after 3 seconds
}, 3000)
</script>

<template>
  <f7-app>
    <f7-page>
      <f7-list class="select-list">
        <f7-list-item title="Options" smart-select :smart-select-params="{
          openIn: 'popup',
          closeOnSelect: true,
        }">
          <select v-model="input.selectedId">
            <option v-for="obj in input.options" :key="obj.id" :value="obj.id" :selected="input.selectedId === obj.id">{{ obj.text }}</option>
          </select>
        </f7-list-item>
      </f7-list>
    </f7-page>
  </f7-app>
</template>

<style lang="less">
body, html, #app {
  width: 100%;
  height: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
}
</style>

At the beginning, shows Option 1, a script will change it to Option 3 after 3 seconds.
Image

3 seconds later, it is still Option 1
Image

while the popup is updated correctly
Image

clicking Option 3 in popup will not change the value outside, unless click Option 2.

Ngôn ngữ chính
JavaScript
Star
18.8k
Fork
3.2k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của framework7io/framework7

Tất cả issue của framework7io/framework7

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.