Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

combo_box控件在窗口打开时其selected_index属性总为0而不与模型的一致 #33

Open
ufbycd opened this issue Mar 3, 2022 · 0 comments

Comments

@ufbycd
Copy link

ufbycd commented Mar 3, 2022

<window tr_text="General Settings" anim_hint="htranslate" v-model="general_settings">
...
<combo_box  readonly="true" options="Chinese;English;" v-data:value="{language_id}"/>
...
</window>
general_settings_t* general_settings_create(void) {
  general_settings_t* general_settings = TKMEM_ZALLOC(general_settings_t);
  return_value_if_fail(general_settings != NULL, NULL);

  general_settings->language_id = 1;

  return general_settings;
}

打开窗口时,combo_box总是显示第0个选项而不跟模型的一致。

而将模型绑定到selected_index上:

<combo_box  readonly="true" options="Chinese;English;" v-data:selected_index="{language_id}"/>

打开窗口时,combo_box显示的选项而跟模型的一致;但操作UI改变选项后,模型属性language_id没有跟随UI变化。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant