动态v模型无法使用v-html指令完成输入 [英] Dynamic v-model don't complete inputs using v-html directive
本文介绍了动态v模型无法使用v-html指令完成输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在其中应用了一个组件
I have a component where I applied
<div v-html="dataProperties.replace(/name/g, index)">
在原始HTML的dataProperties中,我有一个带有
的输入标签
v-model="data[name].property"
除了即使data [index] .property存在并且在我的组件数据中不为空,输入也保持为空.
Inside the dataProperties which is raw HTML, I have an input tag with
v-model="data[name].property"
except that the input stay empty even if data[index].property exist and isn't null in my component data.
<template>
<div class="entity-list" :class="{'client-empty': !entities.length, row: entities.length}">
<div v-for="(entity, index) in entities" class="col-md-6 entity-item">
<div class="data">
<slot :entity="entity">
{{ entity.id }}
</slot>
<div v-html="dataProperties.replace(/__name__/g, index)">
</div>
</div>
</div>
<template v-if="!entities.length">
<h6>Aucun gestionnaire</h6>
<img :src="imgPath" alt="tobad"/>
</template>
</div>
</template>
<script>
export default {
name: "ListingForm",
props: [
'entities',
'imgPath',
'dataProperties'
],
data() {
return {
}
}
}
</script>
推荐答案
查看全文