一個(gè)數(shù)組v-for循環(huán)渲染form項(xiàng),限制每一項(xiàng)表單的樣式
<ElForm
:model="form"
label-width="100px"
ref="form">
<ElFormItem
v-for="(v, k) in form.msg_config"'
:key="k"
label="跳轉(zhuǎn)鏈接"
:prop="`msg_config[${k}].redirect_url`"
:rules="[{required: true, message: '請(qǐng)?zhí)顚懱D(zhuǎn)鏈接', trigger: 'blur'}]">
<ElInput v-model="form.msg_config[k].redirect_url" placeholder="請(qǐng)輸入跳轉(zhuǎn)鏈接"></ElInput>
</ElFormItem>
</ElForm>
<ElBreadcrumb separator-class="el-icon-arrow-right">
<template v-for="(item, index) in $route.matched">
<ElBreadcrumbItem :key="index">
<span v-if="item.meta && item.meta.isTxt">{{ item.path ? item.meta.title : '首頁' }}</span>
<RouterLink v-else :to="item.path || '/'">
{{ item.path ? item.meta.title : '首頁' }}
</RouterLink>
</ElBreadcrumbItem>
</template>
</ElBreadcrumb>