如何将选定值传递给vuejs函数?
v-model我想不会有帮助.
我需要在item: items | orderBy sortKey reverse
where reverse和sortKey是动态值之后设置过滤器的
值.
HTML
<select class="sort-filter" v-on="change: sortBy(???)">
<option value="title asc">Title (A-Z)</option>
<option value="title desc">Title (Z-A)</option>
<option value="price asc">Price (Min. - Max.)</option>
<option value="price desc">Price (Max. - Min.)</option>
</select>
Run Code Online (Sandbox Code Playgroud)
JS
methods: {
sortBy: function (sortKey) {
console.log(sortKey)
}
}
Run Code Online (Sandbox Code Playgroud) vue.js ×1