工作总结12:封装组件
生活随笔
收集整理的這篇文章主要介紹了
工作总结12:封装组件
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?selectform組件
<!--封裝部門選擇的插件 需要的組件--> <template><el-select :value="value" placeholder="請選擇所屬部門" @change="handleChange"><el-optionv-for="department in departments":key="department.value":label="department.label":value="department.value"></el-option></el-select> </template><script> import { getAction } from "@/api";export default {name: "SelectForm",props: {value: { type: String, require: true }},model: {event: "change",prop: "value"},data() {return {departments: []};},created() {this.load();},methods: {load() {getAction("/department/list").then(res => {this.departments = res.data;});},handleChange(val) {this.$emit("change", val);}} }; </script><style scoped></style>?
總結
以上是生活随笔為你收集整理的工作总结12:封装组件的全部內容,希望文章能夠幫你解決所遇到的問題。