<script> import { defineAsyncComponent } from 'vue'; const scEditor = defineAsyncComponent(() => import('@/components/scEditor')); export default { emits: ['success', 'closed'], components: { scEditor },
<el-card shadow="never" header="文章内容" style="margin-top: 5px;"> <sc-editor v-model="form.content" placeholder="请输入内容" :height="400"></sc-editor> </el-card>
<el-form-item label="文章分类" prop="artclecate_id"> <el-select v-model="form.artclecate_id" clearable placeholder="请选择文章分类"> <el-option v-for="(v,index) in artlecate" :key="v.id" :label="v.name" :value="v.id"></el-option> </el-select> </el-form-item> data() { return { artlecate:[], } }, mounted() { this.getArtlecate(); }, methods: { async getArtlecate(){ var res = await this.$API.artclecate.read.get(); this.artlecate = res.data.list; }, }
<dialog2 v-if="asynDialog2" ref="dialog2" @success="handleSuccess" @closed="asynDialog2 = false"></dialog2> </template> 导入文件 import dialog2 from './dialog2'; components 里面加入 dialog2, data 里面加入数据 asynDialog2: false, 在 methods里面加入点击事件执行的方法 apply_pass(row){ this.asynDialog2 = true this.$nextTick(() => { this.$refs.dialog2.open('update').setData(row) }) },