在表单标签内,我放置了一个hidden_field。 该hidden_field应该具有“ v-model”属性。 我已经尽力想了:
# nothing shows up
= f.hidden_field :model_attribute, "v-model" => "value"
# that's the one I love the most: it compiles v="{:model=>"value"}"
= f.hidden_field :model_attribute, v: { model: "value" }
# it compiles with the underscore
= f.hidden_field :model_attribute, v_model: "value"
# this throws a compile error, obviously
= f.hidden_field :model_attribute, v-model: "value"
# guess the compiled outcome?
= f.hidden_field :model_attribute, html: { "v-model" => "value" }
#same as previous
= f.hidden_field :model_attribute, options: { "v-model" => "value" }
铁轨在跟我拧吗? 谁能帮我吗?
答案 0 :(得分:0)