fix: update data

This commit is contained in:
Qiuxia Fan
2021-12-27 15:47:28 +08:00
parent e8f23d9ead
commit 227ef4f092
3 changed files with 25 additions and 15 deletions

View File

@@ -14,10 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License. -->
<template>
<el-select
size="small"
:size="size"
v-model="selected"
:placeholder="placeholder"
class="selectors"
@change="changeSelected"
>
<el-option
@@ -49,8 +48,10 @@ const props = defineProps({
placeholder: { type: String, default: "Select a option" },
});
const selected = ref<string>("");
function changeSelected(val: string) {
const optionSele = props.options.filter((d: Option) => d.value === val);
function changeSelected() {
const optionSele = props.options.filter(
(d: Option) => d.value === selected.value
)[0];
emit("change", optionSele);
}
</script>