vue2 slot 3个关键字 slot slot-scope v-slot 组件式api调用
vue2 slot 3个关键字 slot slot-scope v-slot
<abcApi v-slot="{ list }">
<Select
v-model="person.aaa"
:disabled="isDisabled || showDisabled">
<Option v-for="item in list"
:value="item.code"
:key="item.code">{{ item.name }}</Option>
</Select>
</abcApi>
v-slot="{ list }"
abcApi.vue
<template>
<div>
<slot :list="list"></slot>
</div>
</template>
<script>
export default {
components: {},
props: {},
data () {
return {
list: []
}
},
watch: {},
computed: {},
methods: {},
created () { },
activated () { },
mounted () {
const params = { typeFlag: 'aaa', parentCode: '' }
this.$api('/aaa', params).then(res => {
if (res && res.status === 20) {
this.list = res.data
}
})
},
beforeDestroy () { }
}
</script>
<style lang="less" scoped>
</style>
---------------------------------------------
生活的意义就是你自己知道你要做什么,明确目标。没有目标,后面都是瞎扯!
https://pengchenggang.gitee.io/navigator/
SMART原则:
目标必须是具体的(Specific)
目标必须是可以衡量的(Measurable)
目标必须是可以达到的(Attainable)
目标必须和其他目标具有相关性(Relevant)
目标必须具有明确的截止期限(Time-based)
生活的意义就是你自己知道你要做什么,明确目标。没有目标,后面都是瞎扯!
https://pengchenggang.gitee.io/navigator/
SMART原则:
目标必须是具体的(Specific)
目标必须是可以衡量的(Measurable)
目标必须是可以达到的(Attainable)
目标必须和其他目标具有相关性(Relevant)
目标必须具有明确的截止期限(Time-based)

浙公网安备 33010602011771号